> It's possible to restrict the values of a variable to a specific set?. I
> wish to do something like this:
> set S;
> set I;
> var x{i in I} in S;
> But doesn't work. Currently I'm simulating this behaviour using binary
> varibles but maybe there is a more direct way to do it.
In mip there is no way other than using auxiliary binary variables.
For example, if x can take on only values 1.2, 3.4, and 5.6, one could
model that as follows:
x = 1.2 * z1 + 3.4 * z2 + 5.6 * z3
z1 + z2 + z3 = 1
where z1, z2, z3 are binary variables.
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk