Problem 1, from table 8.2 index source := 1..3; ! equivalent to writing "source := (1,2,3);" destination := 1..4; data Shipcost[source,destination]:= ( 464,513,654,867, 352,416,690,791, 995,682,388,685); Output[source]:= (75,125,100); ! the output for the 3 sources Demand[destination]:= (80,65,70,85); ! the demand for the 4 destinations variables Ship[source,destination]; ! these are the 3*4 = 12 decision variables model min C = sum(source,destination: Shipcost*Ship); ! the sum is over both indices subject to C1[source]: ! constraint 1 sum(destination: Ship) = Output; ! the total shipped by each cannery equals its output C2[destination]: ! constraint 2 sum(source: Ship) = Demand; ! the total shipped to each warehouse equals its demand end ----------------------------------------------------------------------------------------------------------------------- Problem 2, from table 8.12 index source := (Colombo,Sacron,Calorie,Dummy); ! sources are rivers destination := (B_min,B_extra,Los_Devils,San_Go,Hollyglass); ! destinations are cities data DeliveryCost[source,destination] := ( 16,16,13,22,17, 14,14,13,19,15, 19,19,20,23,-1, ! replace the M’s from table 8.12 -1,0 ,-1, 0, 0); ! with -1’s Supply[source] := (50 60 50 50); Demand[destination] := (30 20 70 30 60); variables Ship[source,destination] where (DeliveryCost[source,destination] >= 0); ! this is the only new line model min cost = sum(source,destination: DeliveryCost*Ship); subject to C1[source]: sum(destination: Ship) = Supply; C2[destination]: sum(source: Ship) = Demand; end