Minimum Cost Transhipment


    {  Exmpl15.1-1_MinCostTranship.mpl  }

    {  AMPL A Modeling Language for Mathematical Programming, 2nd Edition }

    {  Chapter 15.1,  Minimum Cost Transhipment,  Size: 3x9,  Page 319 }


TITLE
    MinCost_Transhipment;

INDEX
    city  := (pitt,ne,se,bos,ewr,bwi,atl,mco);
    city2 := city;
    link[city,city2] := (pitt.ne,pitt.se,ne.bos,ne.ewr,ne.bwi,se.ewr,se.bwi,se.atl,se.mco);

DATA
    Supply[city] := (450,  0,  0,  0,  0,  0,  0,  0);
    Demand[city] := (  0,  0,  0, 90,120,120, 70, 50);
    Cost[city,city2 IN link] := [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 IN link] := [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