* * GAMS program for Wyndor glass example, see * Hillier & Liberman, p. 33 * * Modified to solve to integer optimality, the places are marked with <<<<<<< * * Thomas Stidsen, David Pisinger * $eolcom // option iterlim=999999999,reslim=300,optcr=0.0,optca=0.0,solprint=OFF,limrow=0,limcol=0; SETS i 'factory' /f1, f2, f3/ j 'glass type' /g1, g2/ PARAMETERS c(j) 'profit pr. batch glass for each type' / g1 3 g2 5 / b(i) 'available production time pr. factory' / f1 4 f2 12 f3 18 / ; TABLE a(i,j) 'time pr. glass type pr. factory' g1 g2 f1 1.0 0.0 f2 0.0 2.0 f3 3.0 2.0 ; * integer variables are declared as INTEGER <<<<<<<<< VARIABLES z FREE 'total profit to be optimized' INTEGER VARIABLE x(j) 'no. glass products of each type' ; EQUATIONS profit 'total profit' fac(i) 'factory prod. limitations' ; profit .. z =e= sum(j, c(j)*x(j)) ; fac(i).. sum(j, a(i,j)*x(j)) =l= b(i) ; MODEL wyndor /ALL/ ; * problem is a MIP problem <<<<<<<<< SOLVE wyndor USING MIP MAXIMIZING z ; DISPLAY x.L; // x.L : Level, i.e. result DISPLAY x.LO; // x.LO : Lower bound for variable value DISPLAY x.UP; // x.UP : Upper bound for variable value DISPLAY x.M; // x.MA : Marginal value for variable x, i.e. reduced costs DISPLAY fac.M; // value of the dual variables