$ondollar title Wastewater Net Design (ILP) Example 11.11 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; option mip = zoom; set i "nodes" /1*9/; alias (i,j); alias (i,k); set arc(i,j) "arc set of the digraph" /1.2, 1.3, 2.3, 2.4, 3.4, 3.9, 4.3, 4.8, 5.6, 5.7, 6.7, 6.8, 7.4, 7.9, 8.9/; parameter f(i,j) "fixed costs of flow on arc (i,j)" /1.2 240, 1.3 350, 2.3 200, 2.4 750, 3.4 610, 3.9 3800, 4.3 1840, 4.8 780, 5.6 620, 5.7 800, 6.7 500, 6.8 630, 7.4 1120, 7.9 3800, 8.9 2500/; parameter c(i,j) "variable costs of flow on arc (i,j)" /1.2 21, 1.3 30, 2.3 22, 2.4 58, 3.4 43, 3.9 1, 4.3 49, 4.8 63, 5.6 44, 5.7 51, 6.7 56, 6.8 94, 7.4 82, 7.9 1, 8.9 2/; parameter u(i,j) "capacity on arc (i,j)" /1.2 27, 1.3 27, 2.3 30, 2.4 30, 3.4 44, 3.9 122, 4.3 108, 4.8 122, 5.6 21, 5.7 21, 6.7 29, 6.8 29, 7.4 42, 7.9 42, 8.9 122/; parameter b(k) "net demand at node k" /1 -27, 2 -3, 3 -14, 4 -36, 5 -21, 6 -8, 7 -13, 8 0, 9 122/; free variable cost "total shipping cost"; positive variables x(i,j) "flow on arc (i,j)"; binary variables y(i,j) "fixed charge variable for arc (i,j)"; equations obj "minimize total cost", bal(k) "balance of flow at node k" switch(i,j) "switching constraint for fixed charge on arc (i,j)"; obj.. cost =e= sum((i,j)$arc(i,j), c(i,j)*x(i,j) + f(i,j)*y(i,j)); bal(k).. sum(i$arc(i,k), x(i,k)) - sum(j$arc(k,j), x(k,j)) =e= b(k); switch(i,j)$arc(i,j).. x(i,j) =l= u(i,j)*y(i,j); model wastewat /all/; solve wastewat using mip minimizing cost;