[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Re[Help-glpk] strict varibale to set

**From**: |
Andrew Makhorin |

**Subject**: |
Re: Re[Help-glpk] strict varibale to set |

**Date**: |
Fri, 28 Aug 2009 19:08:39 +0400 |

>* 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.