help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] More conditional variables fun


From: Andrew Makhorin
Subject: Re: [Help-glpk] More conditional variables fun
Date: Wed, 14 Oct 2009 00:13:46 +0400

> Now I #39;d like to be able to model conditional non-binary
> variables. Does anybody know how to formulate this in mathprog?

> ----------Begin Description -------------------
> *) a,b are binary
> *) c,d,e is continuous.
> *) I #39;d like c to be 
>     - 0 if a=b=0
>     - d if a=0,b=1
>     - e if a=1,b=0
>     - 0 if a=b=1
> ----------End Description

Let:

z1 = 1:  0 if a=b=0
z2 = 1:  d if a=0,b=1
z3 = 1:  e if a=1,b=0
z4 = 1:  0 if a=b=1

Then:

z1 + z2 + z3 + z4 = 1

a = z3 + z4

b = z2 + z4

c = if z2 then d else (if z3 then e else 0)

where z1, z2, z3, z4 are auxiliary binary variables.





reply via email to

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