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: Nodes / 0 4 8 12/: supdem; Arcs ( Nodes, Nodes)/0,4 0,8 0,12 4,8 4,12 8,12/: cost,flow; ENDSETS ! The objective; MIN = @SUM( arcs( i, j): cost( i, j) * flow( i, j)); ! flow balance; ! no capacity necessary due to supdem of -1 and 1; @FOR( Nodes( i): @SUM( Arcs(i,j): flow(i,j)) - @SUM( Arcs( j,i): flow( j, i)) = supdem( i)); ! Here is the data; DATA: supdem = 1 0 0 -1; cost = 43 83 137 43 77 47; ENDDATA END Global optimal solution found. Objective value: 120.0000 Total solver iterations: 0 Variable Value Reduced Cost SUPDEM( 0) 1.000000 0.000000 SUPDEM( 4) 0.000000 0.000000 SUPDEM( 8) 0.000000 0.000000 SUPDEM( 12) -1.000000 0.000000 COST( 0, 4) 43.00000 0.000000 COST( 0, 8) 83.00000 0.000000 COST( 0, 12) 137.0000 0.000000 COST( 4, 8) 43.00000 0.000000 COST( 4, 12) 77.00000 0.000000 COST( 8, 12) 47.00000 0.000000 FLOW( 0, 4) 1.000000 0.000000 FLOW( 0, 8) 0.000000 10.00000 FLOW( 0, 12) 0.000000 17.00000 FLOW( 4, 8) 0.000000 13.00000 FLOW( 4, 12) 1.000000 0.000000 FLOW( 8, 12) 0.000000 0.000000 Row Slack or Surplus Dual Price 1 120.0000 -1.000000 2 0.000000 -43.00000 3 0.000000 0.000000 4 0.000000 30.00000 5 0.000000 77.00000 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: Nodes / 0 4 8 12/: supdem; Arcs ( Nodes, Nodes)/: cost,flow; ENDSETS ! The objective; MIN = @SUM( arcs( i, j): cost( i, j) * flow( i, j)); ! flow balance; ! no capacity necessary due to supdem of -1 and 1; @FOR( Nodes( i): @SUM( Arcs(i,j): flow(i,j)) - @SUM( Arcs( j,i): flow( j, i)) = supdem( i)); ! Here is the data; DATA: supdem = 1 0 0 -1; !My "Big-M" is 10000; cost = 10000 43 83 137 10000 1000 43 77 10000 1000 1000 47 10000 10000 10000 10000; ENDDATA END Global optimal solution found. Objective value: 120.0000 Total solver iterations: 4 Variable Value Reduced Cost SUPDEM( 0) 1.000000 0.000000 SUPDEM( 4) 0.000000 0.000000 SUPDEM( 8) 0.000000 0.000000 SUPDEM( 12) -1.000000 0.000000 COST( 0, 0) 10000.00 0.000000 COST( 0, 4) 43.00000 0.000000 COST( 0, 8) 83.00000 0.000000 COST( 0, 12) 137.0000 0.000000 COST( 4, 0) 10000.00 0.000000 COST( 4, 4) 1000.000 0.000000 COST( 4, 8) 43.00000 0.000000 COST( 4, 12) 77.00000 0.000000 COST( 8, 0) 10000.00 0.000000 COST( 8, 4) 1000.000 0.000000 COST( 8, 8) 1000.000 0.000000 COST( 8, 12) 47.00000 0.000000 COST( 12, 0) 10000.00 0.000000 COST( 12, 4) 10000.00 0.000000 COST( 12, 8) 10000.00 0.000000 COST( 12, 12) 10000.00 0.000000 FLOW( 0, 0) 0.000000 10000.00 FLOW( 0, 4) 1.000000 0.000000 FLOW( 0, 8) 0.000000 0.000000 FLOW( 0, 12) 0.000000 17.00000 FLOW( 4, 0) 0.000000 10043.00 FLOW( 4, 4) 0.000000 1000.000 FLOW( 4, 8) 0.000000 3.000000 FLOW( 4, 12) 1.000000 0.000000 FLOW( 8, 0) 0.000000 10083.00 FLOW( 8, 4) 0.000000 1040.000 FLOW( 8, 8) 0.000000 1000.000 FLOW( 8, 12) 0.000000 10.00000 FLOW( 12, 0) 0.000000 10120.00 FLOW( 12, 4) 0.000000 10077.00 FLOW( 12, 8) 0.000000 10037.00 FLOW( 12, 12) 0.000000 10000.00 Row Slack or Surplus Dual Price 1 120.0000 -1.000000 2 0.000000 -120.0000 3 0.000000 -77.00000 4 0.000000 -37.00000 5 0.000000 0.000000 MODEL: SETS: nodes/det dal cty1 cty2 cty3 dum/:supdem; arcs(nodes,nodes)/det,cty1 det,cty2 det,cty3 det,dum dal,cty1 dal,cty2 dal,cty3 dal,dum/ :cap,flow,cost; ENDSETS !obj. function; MIN=@SUM(arcs:cost*flow); !cap constraints; @FOR(arcs(i,j):flow(i,j)