Minimum Cost Transhipment
{ Exmpl15.1-2_MinCostTranship.mpl }
{ AMPL A Modeling Language for Mathematical Programming, 2nd Edition }
{ Chapter 15.1, Minimum Cost Transhipment, Size: 3x9, Page 324 }
TITLE
MinCost_Transhipment2;
INDEX
city := (pitt,ne,se,bos,ewr,bwi,atl,mco);
city2 := city;
p_city[city] := (pitt);
d_city[city] := (ne,se);
w_city[city] := (bos,ewr,bwi,atl,mco);
pdlink[city,city2] := (pitt.ne,pitt.se);
dwlink[city,city2] := (ne.bos,ne.ewr,ne.bwi,se.ewr,se.bwi,se.atl,se.mco)
link[city,city2] := pdlink + dwlink;
DATA
Supply[city] := [pitt,450];
Demand[city] := [bos, 90,
ewr,120,
bwi,120,
atl, 70,
mco, 50];
Cost[city,city2] := [pitt, ne, 2.5,
pitt, se, 3.5,
ne,bos, 1.7,
ne,ewr, 0.7,
ne,bwi, 1.3,
se,ewr, 1.3,
se,bwi, 0.8,
se,atl, 0.2,
se,mco, 2.1];
Capacity[city,city2] := [pitt, ne, 250,
pitt, se, 250,
ne,bos, 100,
ne,ewr, 100,
ne,bwi, 100,
se,ewr, 100,
se,bwi, 100,
se,atl, 100,
se,mco, 100];
VARIABLE
Ship[city,city2 IN link];
MODEL
MIN TotalCost = SUM(city,city2 IN link: Cost * Ship);
SUBJECT TO
Balance[city] -> BAL:
Supply + SUM(city2 IN link: Ship[city:=city2,city2:=city]) = Demand + SUM(city2 IN link: Ship);
BOUNDS
Ship <= Capacity;
END
Back To Top
|
Maximal Home Page
|
List of Models |
Previous Page
|
Next Page