This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: OR & IE 320 – Optimization I Summer 2004 Prelim 1 Solution 1. (a) The LP that the AMPL model describes is: min 1000 × ∑ s ∈ SUPPLIERS, l ∈ LOCS Ship ls cost ls s.t ∑ l ∈ LOCS Ship ls ≤ u limit s ∀ s ∈ SUPPLIERS ∑ s ∈ SUPPLIERS Ship ls ≥ l limit l ∀ l ∈ LOCS Ship ls ≥ ∀ l ∈ LOCS ,s ∈ SUPPLIERS From the data file, we get the shipping costs for the given instance to be: cost = 10 12 9 11 12 15 10 9 12 11 13 9 (cost[ l,s ] gives the unit shipping cost from supplier s to location l ). The upper bounds associated with the suppliers is given by ulimit which in this case is: ulimit = 450 350 500 The lower bounds associated with the locations is given by llimit which for the given instance is: llimit = 90 150 250 420 The optimal solution is to ship 10 units from A to L1, 150 units from A to L2, 250 from B to L3, 80 from C to L1 and 420 from C to L4, incurring a total cost of 8500000. (b) Now, we have to add a constraint for each location that the total amount of oil shipped to it cannot exceed a particular fraction (given by share[ l ]) of the total supply to all locations. We can write this constraint algebraically as: X s ∈ SUPPLIERS Ship ls ≤ Share l × X m ∈ LOCS,s ∈ SUPPLIERS Ship ms ∀ l ∈ LOCS The LHS of the above inequality gives the total oil supplied to location l . The double summation on the RHS gives the total oil supplied to all locations. Notice that in a constraint, the index l specifies the location for which we have the constraint. Consequently it is fixed. So, we use a different index m to sum over all the locations on the RHS. The AMPL translation of the above set of constraints is: subject to NewConstraint { l in LOCS } : sum { s in SUPPLIERS } Ship[l,s] ≤ Share[l]* sum { s in SUPPLIERS, m in LOCS } Ship[m,s]; As noted earlier, we use a different index m to sum over the locations in each constraint. Of course, we have to define the parameter Share before using it and also give its values in the data file. So, we have to make the following additions to the AMPL model and data files. Changes in model file param Share { LOCS } ; subject to NewConstraint { l in LOCS } : sum { s in SUPPLIERS } Ship[l,s] ≤ Share[l]* sum { s in SUPPLIERS, m in LOCS } Ship[m,s]; Change in data file param Share :=...
View
Full Document
 Fall '08
 TODD
 Optimization, optimal solution, RHS

Click to edit the document details