$ondollar title Nifty Notes Scheduling (ILP) Example 11.12 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; option mip = zoom; set j "binder jobs" /1*6/; alias (j,jp); parameter p(j) "process time of j" /1 12, 2 8, 3 3, 4 10, 5 4, 6 18/; scalar M "bigM"; M = sum(j, p(j)); parameter r(j) "release time of j" /1 -20, 2 -15, 3 -12, 4 -10, 5 -3, 6 2/; parameter d(j) "due date of j" /1 10, 2 2, 3 72, 4 -8, 5 -6, 6 60/; free variables meanc "mean completion time", maxc "max completion time", meanf "mean flow time", maxf "max flow time", meanl "mean lateness", maxl "max lateness", meant "mean tardiness", maxt "max tardiness"; positive variable tardy(j) "tardiness of job j"; positive variables x(j) "start time of job j"; binary variables y(j,jp) "disjunction variable for j and jp"; equations meancdef "mean completion definition", maxcdef(j) "max completion definition", meanfdef "mean flow time definition", maxfdef(j) "max flow time definition", meanldef "mean lateness definition", maxldef(j) "max lateness definition", tardidef(j) "tardiness definition", meantdef "mean tardiness definition", maxtdef(j) "max tardiness definition", start(j) "release to start for j", disj1(j,jp) "disjunction part 1 for j and jp", disj2(j,jp) "disjunction part 2 for j and jp"; meancdef.. meanc =e= sum(j,x(j)+p(j))/card(j); maxcdef(j).. maxc =g= x(j)+p(j); meanfdef.. meanf =e= sum(j,x(j)+p(j)-r(j))/card(j); maxfdef(j).. maxf =g= x(j)+p(j)-r(j); meanldef.. meanl =e= sum(j,x(j)+p(j)-d(j))/card(j); maxldef(j).. maxl =g= x(j)+p(j)-d(j); tardidef(j).. tardy(j) =g= x(j)+p(j)-d(j); meantdef.. meant =e= sum(j, tardy(j))/card(j); maxtdef(j).. maxt =e= tardy(j); start(j).. x(j) =g= r(j); disj1(j,jp)$(ord(j) lt ord(jp)).. x(j)+p(j) =l= x(jp) + M*(1-y(j,jp)); disj2(j,jp)$(ord(j) lt ord(jp)).. x(jp)+p(jp) =l= x(j) + M*y(j,jp); model niftynot /all/; solve niftynot using MIP minimizing meanc; solve niftynot using MIP minimizing maxc; solve niftynot using MIP minimizing meanf; solve niftynot using MIP minimizing maxf; solve niftynot using MIP minimizing meanl; solve niftynot using MIP minimizing maxl; solve niftynot using MIP minimizing meant; solve niftynot using MIP minimizing maxt;