AMPL - A Sample Model

A Sample Model

A transportation problem from George Dantzig is used to provide a sample AMPL model. This problem finds the least cost shipping schedule that meets requirements at markets and supplies at factories.

Dantzig, G B, Chapter 3.3. In Linear Programming and Extensions. Princeton University Press, Princeton, New Jersey, 1963.

set Plants; set Markets; # Capacity of plant p in cases param Capacity{p in Plants}; # Demand at market m in cases param Demand{m in Markets}; # Distance in thousands of miles param Distance{Plants, Markets}; # Freight in dollars per case per thousand miles param Freight; # Transport cost in thousands of dollars per case param TransportCost{p in Plants, m in Markets} := Freight * Distance / 1000; # Shipment quantities in cases var shipment{Plants, Markets} >= 0; # Total transportation costs in thousands of dollars minimize cost: sum{p in Plants, m in Markets} TransportCost * shipment; # Observe supply limit at plant p s.t. supply{p in Plants}: sum{m in Markets} shipment <= Capacity; # Satisfy demand at market m s.t. demand{m in Markets}: sum{p in Plants} shipment >= Demand; data; set Plants := seattle san-diego; set Markets := new-york chicago topeka; param Capacity := seattle 350 san-diego 600; param Demand := new-york 325 chicago 300 topeka 275; param Distance : new-york chicago topeka := seattle 2.5 1.7 1.8 san-diego 2.5 1.8 1.4; param Freight := 90;

Read more about this topic:  AMPL

Famous quotes containing the words sample and/or model:

    As a rule they will refuse even to sample a foreign dish, they regard such things as garlic and olive oil with disgust, life is unliveable to them unless they have tea and puddings.
    George Orwell (1903–1950)

    Socrates, who was a perfect model in all great qualities, ... hit on a body and face so ugly and so incongruous with the beauty of his soul, he who was so madly in love with beauty.
    Michel de Montaigne (1533–1592)