help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[Help-glpk] strict varibale to set


From: Germán Ferrari
Subject: Re: Re[Help-glpk] strict varibale to set
Date: Fri, 28 Aug 2009 12:19:50 -0300

Ok, that's what i'm doing currently. Thank you very much.


On Fri, Aug 28, 2009 at 12:08 PM, Andrew Makhorin <address@hidden> wrote:
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]