$ondollar title Optimal Ovens Inc. (NF) Example 10.1 of Rardin (1998) $offsymxref offsymlist offuelxref offuellist offupper option limrow = 0, limcol = 0; set i "nodes" /1*8/; alias (i,j); alias (i,k); set arc(i,j) "arc set of the digraph" /1.3, 1.4, 1.8, 2.3, 2.4, 2.8, 3.4, 3.5, 3.6, 3.7, 4.3, 4.5, 4.6, 4.7/; parameter c(i,j) "unit costs of flow" /1.3 7, 1.4 8, 2.3 4, 2.4 7, 3.5 25, 3.6 5, 3.7 17, 4.5 29, 4.6 8, 4.7 5/; parameter b(k) "net demand at node k" /1 -1000, 2 -1000, 3 0, 4 0, 5 450, 6 500, 7 610, 8 440/; free variable cost "total shipping cost"; positive variables x(i,j) "flow on arc (i,j)"; x.up('3','4') = 25; x.up('4','3') = 25; equations obj "minimize total cost", bal(k) "balance of flow at node k"; obj.. cost =e= sum((i,j)$arc(i,j), c(i,j)*x(i,j)); bal(k).. sum(i$arc(i,k), x(i,k)) - sum(j$arc(k,j), x(k,j)) =e= b(k); model optoven /all/; solve optoven using lp minimizing cost;