Hi all, I am trying to write a MIO in python but I am having some difficulties in writing one of the constraints.
I have defined aij to be a binary variable and xi is each row of a dataset which is an array with the size 1*3.
I need a to be a matrix so I can multiply each of its columns by xi but in gurobi decision variables are defined as dicts. How can I do this?
for tb in TB:
for j in range(1,p+1):
a[j,tb]= m.addVar(obj=0,vtype=GRB.BINARY, name="a[%s,%s]"%(j,tb))
Please sign in to leave a comment.