Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

for the first one you forgot a ]

second I'm not sure this below is what you want to do(sorry if it does not, tell me and I will erase my answer)

i = [ 0, 3]
j = [1, 5]
ijzip = zip(i, j)
p = MixedIntegerLinearProgram(solver='GLPK')
v = p.new_variable(nonnegative=True)
p.add_constraint((sum([sum([ v[i,j]]) for i,j in ijzip ])  <= 1))
show(p)