Difference: TransportationProblemInAMPL (1 vs. 2)

Revision 22008-04-02 - MichaelOSullivan

Line: 1 to 1
 
META TOPICPARENT name="AMPLGuide"

The Transportation Problem in AMPL

Added:
>
>

AMPL Formulation

The formulation of the transportation problem is AMPL is a straighforward translation of the matehmatical programme for the transportation problem.

The sets ${\cal S}$ and ${\cal D}$ are declared as SUPPLY_NODES and DEMAND_NODES respectively:

set SUPPLY_NODES;
set DEMAND_NODES;

The supply $s_i, i \in {\cal S}$ and demand $d_j, j \in {\cal D}$ are declared as integer parameters:

param Supply {SUPPLY_NODES} >= 0, integer;
param Demand {DEMAND_NODES} >= 0, integer;

The cost $c_{ij}$ is declared over the SUPPLY_NODES and DEMAND_NODES:

param Cost {SUPPLY_NODES, DEMAND_NODES};

Now, the mathematical proramme follows directly:

var Flow {i in SUPPLY_NODES, j in DEMAND_NODES} >= 0, integer;

minimize TotalCost:
  sum {i in SUPPLY_NODES, j in DEMAND_NODES} Cost[i, j] * Flow[i, j];

subject to UseSupply {i in SUPPLY_NODES}:
  sum {j in DEMAND_NODES} Flow[i, j] = Supply[i];

subject to MeetDemand {j in DEMAND_NODES}:
  sum {i in SUPPLY_NODES} Flow[i, j] = Demand[j];
Note that we assume the transportation is balanced.
 -- MichaelOSullivan - 02 Apr 2008
Added:
>
>
META FILEATTACHMENT attachment="latex526e21edb215dffbfdb5ee74dd06358b.png" attr="h" comment="" date="1207132191" name="latex526e21edb215dffbfdb5ee74dd06358b.png" stream="GLOB(0xa44d1b8)" tmpFilename="latex526e21edb215dffbfdb5ee74dd06358b.png" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="latex3c99455acbafe055e535fc129b4dd12e.png" attr="h" comment="" date="1207132191" name="latex3c99455acbafe055e535fc129b4dd12e.png" stream="GLOB(0xa456928)" tmpFilename="latex3c99455acbafe055e535fc129b4dd12e.png" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="latexa518db3a714367f452620a2d18e0d61e.png" attr="h" comment="" date="1207132191" name="latexa518db3a714367f452620a2d18e0d61e.png" stream="GLOB(0xa4568f8)" tmpFilename="latexa518db3a714367f452620a2d18e0d61e.png" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="latex57f16e685545faa46af73ecce6b4eb7c.png" attr="h" comment="" date="1207132191" name="latex57f16e685545faa46af73ecce6b4eb7c.png" stream="GLOB(0xa44d5e4)" tmpFilename="latex57f16e685545faa46af73ecce6b4eb7c.png" user="MichaelOSullivan" version="1"
META FILEATTACHMENT attachment="latex15b62f2a4b15b2f0ea551529e221b54f.png" attr="h" comment="" date="1207132191" name="latex15b62f2a4b15b2f0ea551529e221b54f.png" stream="GLOB(0xa44d950)" tmpFilename="latex15b62f2a4b15b2f0ea551529e221b54f.png" user="MichaelOSullivan" version="1"

Revision 12008-04-02 - MichaelOSullivan

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="AMPLGuide"

The Transportation Problem in AMPL

-- MichaelOSullivan - 02 Apr 2008

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback