Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The Transportation Problem in AMPL | ||||||||
Line: 23 to 23 | ||||||||
param Cost {SUPPLY_NODES, DEMAND_NODES}; | ||||||||
Changed: | ||||||||
< < | Now, the mathematical proramme follows directly: | |||||||
> > | Now, the mathematical programme follows directly: | |||||||
Changed: | ||||||||
< < | var Flow {i in SUPPLY_NODES, j in DEMAND_NODES} >= 0, integer; | |||||||
> > | var Flow {SUPPLY_NODES, DEMAND_NODES} >= 0, integer; | |||||||
minimize TotalCost: sum {i in SUPPLY_NODES, j in DEMAND_NODES} Cost[i, j] * Flow[i, j]; | ||||||||
Line: 38 to 38 | ||||||||
Note that we assume the transportation is balanced. | ||||||||
Added: | ||||||||
> > | Adding BoundsIn the main discussion of transportation problems, we saw that adding bounds to the flow variables allowed us to easily either bound the transportation of good from a supply node to a demand node or remove an arc from the problem altogether. We can add bounds to our AMPL formulation by declaring 2 new parameters with defaults:param Lower {SUPPLY_NODES, DEMAND_NODES} integer default 0; param Upper {SUPPLY_NODES, DEMAND_NODES} integer default Infinity;and adding them to the Flow variable declaration:
var Flow {i in SUPPLY_NODES, j in DEMAND_NODES} >= Lower[i, j], <= Upper[i, j], integer; Balancing Transportation Problems | |||||||
-- MichaelOSullivan - 02 Apr 2008 |