Lecture 2 Beyond optimality: Information provided by an LP solution We will see that solving a linear programming problem can provide more information about an optimal solution than merely values of the decision variables. 1. Shadow prices on constraints a. Definition = dual variables = marginal values = pi values = reduced costs (for non-negativity constraints only) The shadow price on a particular constraint represents the change in the value of the objective function per unit change in the RHS value of the constraint. (Note that changes are made one-at-a-time on constraints in reduced form). b. Calculation of shadow prices for the ‘water quality example’ (1) Perturbation technique (more intuitive, less systematic) Recall the original water quality problem with its non-redundant constraints: minimize z = 2x1 + x2 subject to (original non-redundant constraints; RHS = bi) x1 b1 0.8 x1 + x2 1.6 b2 x1 b3 0.95 x2 0.95 b4 The optimal solution was: z = 2.4; x1 = x2 = 0.8 Now, find the shadow prices by making one-at-a-time changes to the RHS (bi) of each constraint. (Change by an arbitrary amount so the constraint line remains within the same solution space defined by the original constraints). 9 (a) Constraint #1: x1 0.8 Increase the RHS by a(n arbitrary) unit => x1 0.9 (increase by 0.1) New solution: x1 = 0.9, x2 = 0.7; z = 2x1 + x2 = 2.5 Now calculate the value of the objective function resulting from a unit increase in this constraint: Shadow price, y1 = z/b1 = (2.5 - 2.4)/(0.9 - 0.8) = +1.0 (positive) This implies a Tk. 0.1* increase in total cost for every 0.1 increase in the RHS of constraint #1 (in its reduced form). [Note that on the LINDO output the shadow price is -1.0. This is because the total minimum cost is increasing, which is a less desirable (optimal) state to be in.] --------------------------------------------------------------------------------------------------------------------Note that there must be appropriate units associated with the unit increase in the RHS. Recall the original constraint #1: 3 mg/l + 0.025 (mg/l)/kg*200 kg*x1 7 mg/l (a) or x1 ((7 - 3) mg/l) / (5 mg/l) = 0.8 (dimensionless) So, in this case there are no units on the RHS of the constraint in reduced form, but keep in mind that the physical meaning here is that a unit increase of 0.1 on this constraint corresponds to an increase in the regulatory constraint of 0.5 mg/l, i.e., 3 mg/l + 0.025 (mg/l)/kg*200 kg*x1 7.5 mg/l or x1 ((7.5 - 3) mg/l) / (5 mg/l) = 0.9 (dimensionless) (b) Alternatively, find this new regulatory requirement (7.5 mg/l) by back-calculation using (b) --------------------------------------------------------------------------------------------------------------------10 (b) Constraint #2: x1 + x2 1.6 Now change constraint #1 back to its original form and vary constraint #2: Increase the RHS by a(n arbitrary) unit => x1 + x2 1.7 (increase by 0.1) New solution: x1 = 0.8, x2 = 0.9; z = 2x1 + x2 = 2.5 Now calculate the value of the objective function resulting from a unit increase in this constraint: Shadow price y2 = z/b2 = (2.5 - 2.4)/(1.7 - 1.6) = 1.0 This implies a Tk. 0.1* increase in total cost for every 0.1 increase in the RHS of constraint #2 (in its reduced form). Physical Meaning: Recall the original constraint #2: 2 mg/l + 0.0125 (mg/l)/kg*200 kg*x1+ 0.025 (mg/l)/kg*100 kg*x2 6 mg/l or x1 + x2 ((6 - 2) mg/l) / (2.5 mg/l) = 1.6 (dimensionless) A new RHS of 1.7 corresponds to increasing the regulatory requirement from 6 mg/l to 6.25 mg/l: x1 + x2 ((6.25 - 2) mg/l) / (2.5 mg/l) = 1.7 11 (c) Constraint #3: x1 0.95 Now change constraint #2 back to its original form and vary constraint #3: Decrease the RHS by a(n arbitrary) unit => x1 0.94 (decrease by 0.01) ∞ (actually 1.0) New solution: x1 = x2 = 0.8; z = 2.4 (Same as the original solution) Now calculate the value of the objective function resulting from a unit decrease in this constraint: Shadow price y3 = z/b3 = (2.4 - 2.4)/(0.01) = 0 This implies that there will be no change in cost for a unit decrease in the RHS of constraint #3. This makes sense because the treatment required by the solution to the problem (0.95 for x1 and x2) does not affect the optimal solution. => When a constraint does not affect the optimal solution, its shadow price is zero. 12 (d) Constraint #4: x2 0.95 Now change constraint #3 back to its original form and vary constraint #4: Decrease the RHS by a(n arbitrary) unit => x2 0.94 (decrease by 0.01) ∞ (actually 1.0) New solution: x1 = x2 = 0.8; z = 2.4 (Same as the original solution) Now calculate the value of the objective function resulting from a unit decrease in this constraint: Shadow price y4 = z/b4 = (2.4 - 2.4)/(0.01) = 0 Again, this implies that there will be no change in cost for a unit decrease in the RHS of constraint #4. 13 (2) Finding the solution to the dual problem (less intuitive, more systematic) Specify the active portion of the original problem as the “primal”: minimize z = 2 x1 + x2 subject to x1 0.8 x1 + x2 1.6 - x1 -0.95 - x2 -0.95 Shadow Price y1 y2 y3 y4 [Note: General form for a minimization problem is with all constraints] The “dual” to this problem is then written as: maximize z = 0.8 y1 +1.6 y2 -0.95 y3 -0.95 y4 ( max z = ∑bi yi ) subject to y1 + y2 - y3 2 y2 - y4 1 (coefficient of x1) (coefficient of x2) Note: The decision variables of the dual correspond to the shadow prices (corresponding to the constraints) of the primal. There are two constraints in the ‘dual’ for two decision variables in the ‘primal’. For a minimization problem, constraints are in ‘≥’ form in the ‘primal’, and in ‘≤’ form in the ‘dual’. The coefficients in the objective function of the dual are the RHS values (bi) of the constraints of the primal. The RHS values of the dual constraints are the objective coefficients of the primal. The coefficients on the decision variables in constraint line n in the dual correspond to the coefficients on the decision variable n in the primal. Solution of the dual problem gives the shadow prices of the primal (decision variables y1, y2, etc., in the dual). Recalling that the primal shadow prices y3 = y4 = 0 were previously found (i.e., changes to the RHS of constraints #3 and #4 do not affect the RHS of the optimal solution), the dual can be reduced to a two-variable problem that can be solved graphically: maximize z = 0.8 y1 + 1.6 y2 subject to y1 + y2 2 y2 1 14 The optimal value of the objective function is the same for the dual and the primal: y1 = 1.0 y2 = 1.0 z = 0.8y1 + 1.6y2 = 2.4 where y1 and y2 are the shadow prices on constraint #1 and #2 of the original problem. So, we see that the shadow prices are systematically found by solving the dual of the optimization problem. The optimal values of the decision variables of the dual are the shadow prices associated with the constraints of the primal. Note that the shadow prices of nonbinding constraints are always zero – change in the RHS of such constraints has no impact on the optimal value of the objective function. 15 Homework 1 The Water Management Association (WMA) of a cooperative irrigation project wants to optimize the use of its groundwater and surface water supplies. Assume that the cost to pump and deliver groundwater to the irrigation region is Tk. 30 per acre-foot, and that the cost of surface water importation and delivery from outside the region is Tk. 60 per acre-foot. The WMA has agreed to pay for at least 50 acre-feet of water, but will use (pay for) more water if the local government allocates it. Assume also that the local government can provide no more than 40 acre-feet of groundwater and 70 acre-feet of surface water to the region. In addition, the local government cannot deliver a ratio of surface water to groundwater greater than 7/8 at any one time due to physical constraints of the system. a. Determine the least-cost combination of surface water and groundwater supplies that the WMA would like to avail. (Write down the decision variables, the objective function, and the constraints; then solve graphically. Verify your results by LINDO) b. Write down the ‘Primal’ and ‘Dual’, and determine the shadow prices on all constraints including the non-negativity constraints. Discuss the economic implications of the shadow prices. What is the actual ‘physical’ meaning of a zero shadow price in this case? 16 Beyond optimality: Information provided by an LP solution 2. Sensitivity analysis a. Changes in the coefficients of the objective function Over what range can a particular objective coefficient vary without changing the optimal solution? (e.g. the range of cost coefficient for which the optimal solution remains the same) In our example, as long as the slope of the objective function (z = 2x1 + x2) is greater than the slope of constraint #1 (x1 0.8) but less than the slope of constraint #2 (x1+x2 1.6), the optimal solution will remain the same. objective function (1) Coefficient on x1 Denote the coefficient on x1 by c1 z = c1x1 + x2 or x2 = z - c1x1 (compare with straight line y = mx + c) where -c1 is the slope of the objective function => 1 < c1 < is the allowable range on c1 (-1 is the slope of constraint #2 and is the slope of constraint #1; see figure) 17 The current value of c1 is 2.0 (slope = -2.0). Allowable increase in c1 => to infinity; allowable decrease in c1 => to 1. i.e., as long as the slope of the objective function is greater than constraint #1, the optimal solution is x1= x2 = 0.8 (the values of the decision variables do not change). What happens if c1 < 1? The optimal solution will shift to the lower right corner of the solution space and the optimal values of x1 and x2 will change. (see figure) Note: If the objective function coincides exactly with a constraint, the solution is nonunique, i.e., z remains the same but there are infinite number of combinations of x1 and x2 that will satisfy the objective function. (2) Coefficient on x2 Denote the coefficient on x2 by c2 z = 2x1 + c2x2 or x2 = z/c2 - (2x1 /c2) = z/c2 - (2/c2)x1 where (-2/c2) is the slope of the objective function => 1 < 2/c2 < is the allowable range on c2 or 0 < c2 < 2 [1/1 > c2/2 > 1/ ; 1/ = 0] (-1 is the slope of constraint #2 and is the slope of constraint #1) The current value of c2 is 1.0 (slope = -1.0). Allowable increase in c2 => to 2.0 ; allowable decrease in c2 => to 0. b. Changes in the RHS of the constraints We want to answer the question: Over what range can the RHS of a constraint change without changing the shadow prices associated with that constraint? [Note: values of the decision variables may change.] Answer: The range over which the shadow prices remain unchanged is the range over which the optimal solution is defined by the binding constraints. Back to our example: (1) By how much can we increase or decrease the RHS of constraint #1 (x1 0.80) such that we still get a shadow price of y1 = 1.0? (a) Increase x1 to 0.95 (binding constraint) 18 x2 = 1.6 - 0.95 = 0.65 (from constraint #2) z = 2x1 + x2 = 2(0.95) + 0.65 = 2.55 y1 = z/b1 = (2.55 - 2.4)/ (0.95 - 0.8) = 0.15/0.15 = 1.0 (b) Decrease x1 to 0.65 for x2 = 0.95 (binding constraint) z = 2x1 + x2 = 2(0.65) + 0.95 = 2.25 y1 = z/b1 = (2.25 - 2.4)/(0.8 – 0.65) = 0.15/0.15 = 1.0 => the RHS range for constraint #1 is 0.15 increase and 0.15 decrease (2) By how much can we increase or decrease the RHS of constraint #2 (x1 + x2 1.6) such that we still get a shadow price of y2 = 1.0? (a) Increase the RHS of constraint #2 until it intersects x2 = 0.95 x1 = 0.8 (stays the same) x2 = 0.95 (increase to the next binding constraint) x1 + x2 = 0.8 + 0.95 = 1.75 z = 2x1 + x2 = 2(0.80) + 0.95 = 2.55 y2 = z/b2 = (2.55 - 2.4)/(1.75 - 1.6) = 0.15/0.15 = 1.0 (b) Decrease the RHS of constraint #2 until it intersects x2 = 0.30 x1 = 0.80 (stays the same) x2 = 0.30 (binding constraint) 19 x1 + x2 = 0.8 + 0.3 = 1.10 z = 2x1 + x2 = 2(0.80) + 0.30 = 1.9 y2 = z/b2 = (1.9 - 2.4)/(1.1 - 1.6) = 0.5/0.5 = 1.0 => the RHS range for constraint #2 is 0.15 increase and 0.50 decrease (3) By how much can we increase or decrease the RHS of constraint #3 (x1 0.95) such that we still get a shadow price of y3 = 0? Allowable increase: (theoretically, but in actuality the ceiling must be 1.0 since x1 cannot be greater than 1.0 (100 % removal) Allowable decrease: 0.15 (intersect the binding constraint x1 = 0.80) x1 = x2 = 0.8 z = 2.4 y3 = z/b3 = (2.4 - 2.4)/(0.95 - 0.80) = 0 20 (4) By how much can we increase or decrease the RHS of constraint #4 (x2 0.95) such that we still get a shadow price of y4 = 0? Allowable increase: (theoretically, but in actuality the ceiling must be 1.0 since x2 cannot be greater than 1.0 (100 % removal) Allowable decrease: 0.15 (intersect the binding constraint x2 = 0.80) x1 = x2 = 0.8 z = 2.4 y3 = z/b4 = (2.4 - 2.4)/(0.95 - 0.80) = 0 3. Solutions other than optimal unique ones a. Infeasible solutions X2 Z Multiple regions of feasible solutions X1 b. Unbounded solutions X2 Z Min. Z has a solution Max. Z is unbounded X1 21 Homework 2 Write down the formulation of the ‘dual’ for the following problem: minimize z = 30 x1 + 60 x2 subject to x1 + x2 50 7 x1 – 8 x2 0 x1 40 x2 70 x1 0 x2 0 Be sure to write the constraints of the primal in standard form for a minimization problem in order to obtain the correct signs of the coefficients for the dual. a. Solve the dual on LINDO for shadow prices of the constraints of the original problem. b. Check the ‘Sensitivity’ of: (i) Changing the coefficients of the objective function (ii) Changing the RHS of the constraints Attach all supporting printouts of LINDO for full credit. 22