> 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
"Conditional" equality constraint:
t = if z then a else b
where z is binary, t, a, b are continuous, can be modeled as
follows:
z = 1: 0 <= t - a <= 0
-M1 <= t - b <= +M2
z = 0: -M3 <= t - a <= +M4
0 <= t - b <= 0
Thus:
-M3 * (1 - z) <= t - a <= +M4 * (1 - z)
-M1 * z <= t - b <= +M2 * z
where M1, M2, M3, M4 are appropriate "big M's".
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk