MODEL: ! Problem A5 p. 403 ; ! Since demand is 210, exactly $210,000 is required; ! for production, in addition to the shipping costs; ! determined by the code below.; SETS: Plants / Det Atl Den NY/: supply; Customers / Den NY LA Chi Phi Dummy/ : demand; arcs( Plants, Customers): cost, volume; ENDSETS ! The objective; MIN = @SUM( arcs( i, j): cost( i, j) * volume( i, j)); ! The demand constraints; @FOR( Customers( j): @SUM( Plants( i): volume( i, j)) = demand( j)); ! The supply constraints; @FOR( Plants( i): @SUM( Customers( j): volume( i, j)) = supply( i)); ! Here is the data; DATA: supply = 150 100 250 250; demand = 250 250 80 70 60 40; !My "Big-M" is 10000000; cost = 1253 637 10000000 10000000 10000000 0 1398 841 10000000 10000000 10000000 0 0 10000000 1059 996 1691 0 10000000 0 2786 802 100 0; ENDDATA END Global optimal solution found. Objective value: 338610.0 Total solver iterations: 6 Variable Value Reduced Cost SUPPLY( DET) 150.0000 0.000000 SUPPLY( ATL) 100.0000 0.000000 SUPPLY( DEN) 250.0000 0.000000 SUPPLY( NY) 250.0000 0.000000 DEMAND( DEN) 250.0000 0.000000 DEMAND( NY) 250.0000 0.000000 DEMAND( LA) 80.00000 0.000000 DEMAND( CHI) 70.00000 0.000000 DEMAND( PHI) 60.00000 0.000000 DEMAND( DUMMY) 40.00000 0.000000 COST( DET, DEN) 1253.000 0.000000 COST( DET, NY) 637.0000 0.000000 COST( DET, LA) 0.1000000E+08 0.000000 COST( DET, CHI) 0.1000000E+08 0.000000 COST( DET, PHI) 0.1000000E+08 0.000000 COST( DET, DUMMY) 0.000000 0.000000 COST( ATL, DEN) 1398.000 0.000000 COST( ATL, NY) 841.0000 0.000000 COST( ATL, LA) 0.1000000E+08 0.000000 COST( ATL, CHI) 0.1000000E+08 0.000000 COST( ATL, PHI) 0.1000000E+08 0.000000 COST( ATL, DUMMY) 0.000000 0.000000 COST( DEN, DEN) 0.000000 0.000000 COST( DEN, NY) 0.1000000E+08 0.000000 COST( DEN, LA) 1059.000 0.000000 COST( DEN, CHI) 996.0000 0.000000 COST( DEN, PHI) 1691.000 0.000000 COST( DEN, DUMMY) 0.000000 0.000000 COST( NY, DEN) 0.1000000E+08 0.000000 COST( NY, NY) 0.000000 0.000000 COST( NY, LA) 2786.000 0.000000 COST( NY, CHI) 802.0000 0.000000 COST( NY, PHI) 100.0000 0.000000 COST( NY, DUMMY) 0.000000 0.000000 VOLUME( DET, DEN) 20.00000 0.000000 VOLUME( DET, NY) 130.0000 0.000000 VOLUME( DET, LA) 0.000000 9997688. VOLUME( DET, CHI) 0.000000 9998561. VOLUME( DET, PHI) 0.000000 9999263. VOLUME( DET, DUMMY) 0.000000 145.0000 VOLUME( ATL, DEN) 60.00000 0.000000 VOLUME( ATL, NY) 0.000000 59.00000 VOLUME( ATL, LA) 0.000000 9997543. VOLUME( ATL, CHI) 0.000000 9998416. VOLUME( ATL, PHI) 0.000000 9999118. VOLUME( ATL, DUMMY) 40.00000 0.000000 VOLUME( DEN, DEN) 170.0000 0.000000 VOLUME( DEN, NY) 0.000000 0.1000062E+08 VOLUME( DEN, LA) 80.00000 0.000000 VOLUME( DEN, CHI) 0.000000 810.0000 VOLUME( DEN, PHI) 0.000000 2207.000 VOLUME( DEN, DUMMY) 0.000000 1398.000 VOLUME( NY, DEN) 0.000000 9999384. VOLUME( NY, NY) 120.0000 0.000000 VOLUME( NY, LA) 0.000000 1111.000 VOLUME( NY, CHI) 70.00000 0.000000 VOLUME( NY, PHI) 60.00000 0.000000 VOLUME( NY, DUMMY) 0.000000 782.0000 Row Slack or Surplus Dual Price 1 338610.0 -1.000000 2 0.000000 -616.0000 3 0.000000 0.000000 4 0.000000 -1675.000 5 0.000000 -802.0000 6 0.000000 -100.0000 7 0.000000 782.0000 8 0.000000 -637.0000 9 0.000000 -782.0000 10 0.000000 616.0000 11 0.000000 0.000000 MODEL: ! Problem B23 p. 410 ; SETS: Plants / 1 2 3 4/: supply; !4 is a dummy plant; Customers / 1 2 3 4/ : demand; arcs( Plants, Customers): profit, volume; ENDSETS ! The objective; MAX = @SUM( arcs( i, j): profit( i, j) * volume( i, j)); ! The demand constraints; @FOR( Customers( j): @SUM( Plants( i): volume( i, j)) = demand( j)); ! The supply constraints; @FOR( Plants( i): @SUM( Customers( j): volume( i, j)) = supply( i)); ! Here is the data; ! we need -M for some of the dummy supplies; DATA: supply = 3000 5000 5000 3000; demand = 4000 3000 6000 3000; profit = 65 63 62 64 68 67 65 62 63 60 59 60 -100000 -100000 0 0; ENDDATA Global optimal solution found. Objective value: 834000.0 Total solver iterations: 6 Variable Value Reduced Cost SUPPLY( 1) 3000.000 0.000000 SUPPLY( 2) 5000.000 0.000000 SUPPLY( 3) 5000.000 0.000000 SUPPLY( 4) 3000.000 0.000000 DEMAND( 1) 4000.000 0.000000 DEMAND( 2) 3000.000 0.000000 DEMAND( 3) 6000.000 0.000000 DEMAND( 4) 3000.000 0.000000 PROFIT( 1, 1) 65.00000 0.000000 PROFIT( 1, 2) 63.00000 0.000000 PROFIT( 1, 3) 62.00000 0.000000 PROFIT( 1, 4) 64.00000 0.000000 PROFIT( 2, 1) 68.00000 0.000000 PROFIT( 2, 2) 67.00000 0.000000 PROFIT( 2, 3) 65.00000 0.000000 PROFIT( 2, 4) 62.00000 0.000000 PROFIT( 3, 1) 63.00000 0.000000 PROFIT( 3, 2) 60.00000 0.000000 PROFIT( 3, 3) 59.00000 0.000000 PROFIT( 3, 4) 60.00000 0.000000 PROFIT( 4, 1) -100000.0 0.000000 PROFIT( 4, 2) -100000.0 0.000000 PROFIT( 4, 3) 0.000000 0.000000 PROFIT( 4, 4) 0.000000 0.000000 VOLUME( 1, 1) 0.000000 2.000000 VOLUME( 1, 2) 0.000000 2.000000 VOLUME( 1, 3) 0.000000 1.000000 VOLUME( 1, 4) 3000.000 0.000000 VOLUME( 2, 1) 0.000000 1.000000 VOLUME( 2, 2) 3000.000 0.000000 VOLUME( 2, 3) 2000.000 0.000000 VOLUME( 2, 4) 0.000000 4.000000 VOLUME( 3, 1) 4000.000 0.000000 VOLUME( 3, 2) 0.000000 1.000000 VOLUME( 3, 3) 1000.000 0.000000 VOLUME( 3, 4) 0.000000 0.000000 VOLUME( 4, 1) 0.000000 100004.0 VOLUME( 4, 2) 0.000000 100002.0 VOLUME( 4, 3) 3000.000 0.000000 VOLUME( 4, 4) 0.000000 1.000000 Row Slack or Surplus Dual Price 1 834000.0 1.000000 2 0.000000 4.000000 3 0.000000 2.000000 4 0.000000 0.000000 5 0.000000 1.000000 6 0.000000 63.00000 7 0.000000 65.00000 8 0.000000 59.00000 9 0.000000 0.000000