$ondollar title Custom Metal Working (ILP) Example 11.13 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; option mip = zoom; set j "jobs" /1*3/, k "workstations" /1*7/; alias (j,jp); alias (k,kp); set succ(j,k,kp) "job j successor pairs" /1.1.2, 1.2.3, 1.3.4, 1.4.6, 2.7.1, 2.1.2, 2.2.3, 3.2.3, 3.3.5, 3.5.6, 3.6.4/; table p(j,k) "process time of j on k" 1 2 3 4 5 6 7 1 3 10 8 45 1 2 6 11 6 50 3 5 9 25 2 1; scalar M "bigM"; M = sum((j,k), p(j,k)); free variable maxc "max completion time"; positive variables x(j,k) "start time of job j on workstation k"; binary variables y(j,jp,k) "disjunction variable for j and jp on k"; equations maxcdef(j,k) "max completion definition", pred(j,k,kp) "precedence within jobs", disj1(j,jp,k) "disjunction part 1 for j and jp on k", disj2(j,jp,k) "disjunction part 2 for j and jp on k"; maxcdef(j,k).. maxc =g= x(j,k)+p(j,k); pred(j,k,kp)$succ(j,k,kp).. x(j,k) + p(j,k) =l= x(j,kp); disj1(j,jp,k)$(ord(j) lt ord(jp) and p(j,k) gt 0 and p(jp,k) gt 0).. x(j,k)+p(j,k) =l= x(jp,k) + M*(1-y(j,jp,k)); disj2(j,jp,k)$(ord(j) lt ord(jp) and p(j,k) gt 0 and p(jp,k) gt 0).. x(jp,k)+p(jp,k) =l= x(j,k) + M*y(j,jp,k); model custommw /all/; solve custommw using MIP minimizing maxc;