Professional Documents
Culture Documents
A large manufacturing company produces liquid nytrogen in ve plants spread out in East Pennsylvania Each plant has a monthly production capacity Plant i 1 2 3 4 5 Capacity pi 120 95 150 120 140 It has seven retailers in the same area Each retailer has a monthly demand to be satised Retailer j 1 2 3 4 5 6 7 Demand dj 55 72 80 110 85 30 78 transportation between any plant i and any retailer j has a cost of cij dollars per volume unit of nytrogen cij is constant and depends on the distance between i and j nd how much nitrogen to be transported from each plant to each retailer . . . while minimizing the total transportation cost
Transportation model
1 Variables: qty from plant i to retailer j: xij (non-negative) Constraints: 1. capacity: 2. demand:
7 j=1 xij 5 i=1 xij
pi dj
i j
3 4 5
Reduced cost of variable v is accessed with sufx .rc (e.g. qty[4].rc) Shadow price of constraint c is accessed with sufx .dual (e.g. demandConstr[4].dual) displaying iiss in AMPL requires a CPLEX option: option cplex_options iisfind 1; After the solve; command, print them out with display {i in _ncons: _con[i].iis != "non"} (_conname [i], con[i].iis); (Horrible, isnt it?)
5 30;
7 12;
6 9 5 6 4 6
7 := 1 4 9 6 6;
Suppose that inventory capacity at each retailer is 30% of the retailers demand. How does the model change? Add constraint
At the beginning of the year, it knows exactly the demand di of plastic for every month i. It also has a maximum production capacity of P and an inventory capacity of C. The inventory is empty on 01/01 and has to be empty again on 12/31 production has a monthly cost ci
xij 1.3dj
i=1
j = 1, 2 . . . , 7
What do we produce at each month to minimize total production cost while satisfying demand?
How much to produce each month i: xi , i = 1, 2 . . . , 12 Anything else? The inventory level at the beginning of each month (demand is satised by part of production and part of inventory): yi , i = 0, 1, 2 . . . , 12 Why 0? Because we need to know (actually we need to constrain!) the inventory on 01/01 and on 12/31.
Production capacity constraint: xi P i = 1, 2 . . . , 12 Beginning/end of year: y0 = 0, y12 = 0 What goes in must go out. . . xi yi1 i di yi xi + yi1 = di + yi i = 1, 2 . . . , 12
min
12 i=1 ci xi
xi + yi1 = di + yi i = 1, 2 . . . , 12 0 xi P i = 1, 2 . . . , 12 yi 0 i = 1, 2 . . . , 12 y0 = y12 = 0
param demand {Months}; var production {Months} >= 0 <= Capacity; var inventory {MonthsPlus} >= 0; minimize prodCost: sum {i in Months} cost [i] * production [i]; conservation {i in Months}: production [i] + inventory [i-1] = demand [i] + inventory [i]; Jan1Inv: inventory [0] = 0; Dec31Inv: inventory [12] = 0;
Problem data
param Capacity = 120; param cost := 1 14 2 19 5 10 6 7 9 7 10 10 param demand := 1 110 2 70 5 140 6 90 9 100 10 105
3 15 7 4 11 11
4 11 8 5 12 13;
3 85 7 40 11 140
4 90 8 80 12 80;