default.txt 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. SETS
  2. I canning plants / SEATTLE, SAN-DIEGO /
  3. J markets / NEW-YORK, CHICAGO, TOPEKA / ;
  4. PARAMETERS
  5. A(I) capacity of plant i in cases
  6. / SEATTLE 350
  7. SAN-DIEGO 600 /
  8. B(J) demand at market j in cases
  9. / NEW-YORK 325
  10. CHICAGO 300
  11. TOPEKA 275 / ;
  12. TABLE D(I,J) distance in thousands of miles
  13. NEW-YORK CHICAGO TOPEKA
  14. SEATTLE 2.5 1.7 1.8
  15. SAN-DIEGO 2.5 1.8 1.4 ;
  16. SCALAR F freight in dollars per case per thousand miles /90/ ;
  17. PARAMETER C(I,J) transport cost in thousands of dollars per case ;
  18. C(I,J) = F * D(I,J) / 1000 ;
  19. VARIABLES
  20. X(I,J) shipment quantities in cases
  21. Z total transportation costs in thousands of dollars ;
  22. POSITIVE VARIABLE X ;
  23. EQUATIONS
  24. COST define objective function
  25. SUPPLY(I) observe supply limit at plant i
  26. DEMAND(J) satisfy demand at market j ;
  27. COST .. Z =E= SUM((I,J), C(I,J)*X(I,J)) ;
  28. SUPPLY(I) .. SUM(J, X(I,J)) =L= A(I) ;
  29. DEMAND(J) .. SUM(I, X(I,J)) =G= B(J) ;
  30. MODEL TRANSPORT /ALL/ ;
  31. SOLVE TRANSPORT USING LP MINIMIZING Z ;