1 # A TRANSPORTATION PROBLEM
3 # This problem finds a least cost shipping schedule that meets
4 # requirements at markets and supplies at factories.
7 # Dantzig G B, "Linear Programming and Extensions."
8 # Princeton University Press, Princeton, New Jersey, 1963,
18 /* capacity of plant i in cases */
21 /* demand at market j in cases */
23 param d{i in I, j in J};
24 /* distance in thousands of miles */
27 /* freight in dollars per case per thousand miles */
29 param c{i in I, j in J} := f * d[i,j] / 1000;
30 /* transport cost in thousands of dollars per case */
32 var x{i in I, j in J} >= 0;
33 /* shipment quantities in cases */
35 minimize cost: sum{i in I, j in J} c[i,j] * x[i,j];
36 /* total transportation costs in thousands of dollars */
38 s.t. supply{i in I}: sum{j in J} x[i,j] <= a[i];
39 /* observe supply limit at plant i */
41 s.t. demand{j in J}: sum{i in I} x[i,j] >= b[j];
42 /* satisfy demand at market j */
46 set I := Seattle San-Diego;
48 set J := New-York Chicago Topeka;
50 param a := Seattle 350
53 param b := New-York 325
57 param d : New-York Chicago Topeka :=
59 San-Diego 2.5 1.8 1.4 ;