logmip2.gms : LogMIP User's Manual Example 2 - Example to illustrate disjunctions
Example to illustrate disjunctions with multiple terms and logic
propositions.
Aldo Vecchietti, LogMIP User's Manual, http://www.logmip.ceride.gov.ar/
Reference:
- Vecchietti, A, LogMIP User's Manual, 2007. http://www.logmip.ceride.gov.ar/eng/documentation/logmip_manual.pdf
Small Model of Types: LOGMIP mip
$title LogMIP User's Manual Example 2 (LOGMIP2,seq=335)
$ontext
Example to illustrate disjunctions with multiple terms and logic
propositions.
Aldo Vecchietti, LogMIP User's Manual, http://www.logmip.ceride.gov.ar/
$offtext
positive variables c, x1, x2; variable z;
binary variable y1,y2,y3;
equations obj,e1,e2,e3,e4,e5,e6,dummy;
obj.. z =e= c + 2*x1 + x2;
e1.. -x1 + x2 + 2 =l= 0; e2.. c =e= 5;
e3.. - x2 + 2 =l= 0; e4.. c =e= 7;
e5.. x1 - x2 =l= 1;
e6.. x1 =e= 0;
* enter dummy equation to force the y variables into the model
dummy.. y1 + y2 + y3 =g= 0;
model m / all / ;
x1.up = 5; x2.up = 5; c.up = 7;
$onecho > "%lm.info%"
disjunction d1,d2 ;
d1 is
if y1 then
e1;e2;
elsif y2 then
e3;e4;
endif;
d2 is
if y3 then
e5;
else e6;
endif;
y1 -> not y3;
y2 -> not y3;
y3 -> not y2;
$offecho
option mip=lmbigm;
solve m using mip minimizing z;