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:
“The present war having so long cut off all communication with Great-Britain, we are not able to make a fair estimate of the state of science in that country. The spirit in which she wages war is the only sample before our eyes, and that does not seem the legitimate offspring either of science or of civilization.”
—Thomas Jefferson (17431826)
“...that absolutely everything beloved and cherished of the bourgeoisie, the conservative, the cowardly, and the impotentthe State, family life, secular art and sciencewas consciously or unconsciously hostile to the religious idea, to the Church, whose innate tendency and permanent aim was the dissolution of all existing worldly orders, and the reconstitution of society after the model of the ideal, the communistic City of God.”
—Thomas Mann (18751955)