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:

    All that a city will ever allow you is an angle on it—an oblique, indirect sample of what it contains, or what passes through it; a point of view.
    Peter Conrad (b. 1948)

    For an artist to marry his model is as fatal as for a gourmet to marry his cook: the one gets no sittings, and the other gets no dinners.
    Oscar Wilde (1854–1900)