Closed qtbhappy closed 4 years ago
Hi. I wonder if we can define variable indexing on tuple set? Like the following: tuple set Arc = {<1,1>,<1,2>, <1,3>, <2,3>};
float+ var x[a in Arc]; //variable on tuple set Arc
this would be: from mip import *
m = Model() Arcs = [(1, 1), (1, 2), (1, 3)]
x = {a: m.add_var() for a in Arcs}
m += xsum(x[a] for a in Arcs) == 1
Hi. I wonder if we can define variable indexing on tuple set? Like the following: tuple set Arc = {<1,1>,<1,2>, <1,3>, <2,3>};
float+ var x[a in Arc]; //variable on tuple set Arc