5.093 Optimization Methods Lecture 7: Sensitivity Analysis
Motivation. Questions z = min s.t. c x Ax = b Slide How does z depend globally on c? on b? How does z change locally if either b, c, A change? How does z change if we add new constraints, introduce new variables? Importance: Insight about LO and practical relevance 2 Outline. Global sensitivity analysis Slide 2 2. Local sensitivity analysis (a) Changes in b (b) Changes in c (c) A new variable is added (d) A new constraint is added (e) Changes in A 3. Detailed example 3 Global sensitivity analysis 3. Dependence on c G(c) = min s.t. c x Ax = b i G(c) = min i=,...,n c x is a concave function of c 3.2 Dependence on b Primal F(b) = min c x s.t. Ax = b Dual F(b) = max i=,...,n (p i ) b is a convex function of b F(b) = max p b s.t. p A c Slide 3 Slide 4
( c + q d) ' ( x 3 ) ( c + q d) '( x 2) ( c + q d) ' ( x )... 4 ( c + q d) ' ( x ) x optimal x 2 optimal x 3 optimal x 4 optimal q f ( q ) ( p ) '( b * + q d) ( p 2 ) '( b * + q d) ( p 3 ) '( b * + q d) q q 2 q 2
4 Local sensitivity analysis z = min s.t. c x Ax = b What does it mean that a basis B is optimal? Slide 5. Feasibility conditions: B b 0 2. Optimality conditions: c c B B A 0 Suppose that there is a change in either b or c for example Slide 6 How do we find whether B is still optimal? Need to check whether the feasibility and optimality conditions are satis fied 5 Local sensitivity analysis 5. Changes in b b i becomes b i + Δ, i.e. (P) min c x (P ) min c x s.t. Ax = b s.t. Ax = b + Δe i Slide 7 B optimal basis for (P) Is B optimal for (P )? Need to check: Slide 8. Feasibility: B (b + Δe i ) 0 2. Optimality: c c B B A 0 Observations:. Changes in b affect feasibility 2. Optimality conditions are not affected B (b + Δe i ) 0 β ij = [B ] ij b j = [B b] j Thus, (B b) j + Δ(B e i ) j 0 b j + Δβ ji 0 Slide 9 3
( ) ( ) b j b j max Δ min β ji >0 β ji β ji <0 β ji Slide 0 Δ Δ Δ Within this range Current basis B is optimal z = c B B (b + Δe i ) = c B B b + Δp i What if Δ = Δ? What if Δ > Δ? Current solution is infeasible, but satisfies optimality conditions use dual simplex method 5.2 Changes in c c j c j + Δ Is current basis B optimal? Need to check: Slide. Feasibility: B b 0, unaffected 2. Optimality: c c B B A 0, affected There are two cases: x j basic x j nonbasic 5.2. x j nonbasic c B unaffected (c j + Δ) c B B A j 0 c j + Δ 0 Solution optimal if Δ c j What if Δ = c j? What if Δ < c j? Slide 2 4
5.2.2 x j basic Slide 3 c B ĉ B = c B + Δe j Then, [c ĉ B B A] i 0 c i [c B + Δe j ] B A i 0 [B A] ji = a ji ci ci c i Δa ji 0 max Δ min a ji <0 a ji What if Δ is outside this range? use primal simplex 5.3 A new variable is added a ji >0 a ji min c x min c x + c n+ x n+ s.t. Ax = b s.t. Ax + A n+ x n+ = b Slide 4 In the new problem is x n+ = 0 or x n+ > 0? (i.e., is the new activity profitable?) Slide 5 Current basis B. Is solution x = B b, x n+ = 0 optimal? Feasibility conditions are satisfied Optimality conditions: c n+ c B B A n+ 0 c n+ p A n+ 0? If yes, solution x = B b, x n+ = 0 optimal Otherwise, use primal simplex 5.4 A new constraint is added min c x min c x s.t. Ax = b s.t. Ax = b a m+ x = b m+ If current solution feasible, it is optimal; otherwise, apply dual simplex Slide 6 5
5.5 Changes in A Suppose a ij a ij + Δ Slide 7 Assume A j does not belong in the basis Feasibility conditions: B b 0, unaffected Optimality conditions: c l c B B A l 0, l = j, unaffected Optimality condition: c j p (A j + Δe i ) 0 c j Δp i 0 What if A j is basic? BT, Exer. 5.3 6 Example 6. A Furniture company A furniture company makes desks, tables, chairs Slide 8 The production requires wood, finishing labor, carpentry labor Profit 60 Wood (ft) 8 Finish hrs. 4 Carpentry hrs. 2 Desk Table (ft) Chair Avail. 30 6 2.5 20.5 0.5-48 20 8 6.2 Formulation Decision variables: x = # desks, x 2 = # tables, x 3 = # chairs Slide 9 max 60x + 30x 2 + 20x 3 s.t. 8x + 6x 2 + x 3 4x + 2x 2 +.5x 3 2x +.5x 2 + 0.5x 3 x, x 2, x 3 48 20 8 0 6.3 Simplex tableaus Initial tableau: s = s 2 = s 2 = 0 48 20 8 s s 2 s 3 0 0 0 x -60 8 4 2 x 2-30 6 2.5 x 3-20.5 0.5 Slide 20 6
Final tableau: s = x 3 = x = s s 2 s 3 x x 2 x 3 280 0 0 0 0 5 0 24 2-8 0-2 0 8 0 2-4 0-2 2 0-0.5.5.25 0 6.4 Information in tableaus What is B? 8 B = 0.5 4 0 0.5 2 What is B? 2 8 B = 0 2 4 0 0.5.5 What is the optimal solution? What is the optimal solution value? Is it a bit surprising? What is the optimal dual solution? What is the shadow price of the wood constraint? What is the shadow price of the finishing hours constraint? What is the reduced cost for x 2? 6.5 Shadow prices Why the dual price of the finishing hours constraint is 0? Slide 2 Slide 22 Slide 23 Suppose that finishing hours become 2 (from 20). Currently only desks (x ) and chairs (x 3 ) are produced Finishing and carpentry hours constraints are tight Does this change leaves current basis optimal? New Previous 8x + x 3 + s = 48 s = 26 24 New solution: 4x +.5x 3 = 2 x =.5 2 2x + 0.5x 3 = 8 x 3 = 0 8 Solution change: z z = (60.5 + 20 0) (60 2 + 20 8) = 0 Slide 24 Slide 25 7
Suppose you can hire h of finishing overtime at $7. Would you do it? Another check 2 8 c B B = (0, 20, 60) 0 2 4 = 0 0.5.5 (0, 0, 0) 6.6 Reduced costs What does it mean that the reduced cost for x 2 is 5? Slide 26 Suppose you are forced to produce x 2 = ( table) How much will the profit decrease? 8x + x 3 + s + 6 = 48 s = 26 4x +.5x 3 + 2 = 20 x = 0.75 2x + 0.5x 3 +.5 = 8 x 3 = 0 z z = (60 0.75 + 20 0) (60 2 + 20 8 + 30 ) = 35 + 30 = 5 Slide 27 Another way to calculate the same thing: If x 2 = Direct profit from table +30 Decrease wood by -6 6 0 = 0 Decrease finishing hours by -2 2 0 = 20 Decrease carpentry hours by -.5.5 0 = 5 Total Effect 5 Suppose profit from tables increases from $30 to $34. Should it be produced? At $35? At $36? 6.7 Cost ranges Suppose profit from desks becomes 60 + Δ. For what values of Δ does current basis remain optimal? Optimality conditions: c j c B B A j 0 [ 2 ] 8 p = c B B = [0, 20, (60 + Δ)] 0 2 4 0 0.5.5 s, x 3, x are basic Reduced costs of non-basic variables = [0, 0 0.5Δ, 0 +.5Δ] Slide 28 Slide 29 8
6 c 2 = c 2 p A 2 = 30 + [0, 0 0.5Δ, 0 +.5Δ] 2 = 5 +.25Δ.5 c s2 = 0 0.5Δ c s3 = 0 +.5Δ Current basis optimal: 5 +.25Δ 0 0 0.5Δ 0 4 Δ 20 0 +.5Δ 0 56 c 80 solution remains optimal. If c < 56, or c > 80 current basis is not optimal. Suppose c = 00(Δ = 40) What would you do? 6.8 Rhs ranges Slide 30 Suppose finishing hours change by Δ becoming (20 + Δ) What happens? 48 2 8 48 B 20 + Δ = 0 2 4 20 + Δ 8 0 0.5.5 8 24 + 2Δ = 8 + 2Δ 0 2 0.5Δ 4 Δ 4 current basis optimal Slide 3 Note that even if current basis is optimal, optimal solution variables change: s = 24 + 2Δ x 3 = 8 + 2Δ x = 2 0.5Δ z = 60(2 0.5Δ) + 20(8 + 2Δ) = 280 + 0Δ Suppose Δ = 0 then s 44 x 3 = 25 inf. (Use dual simplex) x 3 6.9 New activity Suppose the company has the opportunity to produce stools Profit $5; requires ft of wood, finishing hour, carpentry hour Should the company produce stools? Slide 32 Slide 33 max 60x +30x 2 +20x 3 +5x 4 8x +6x 2 +x 3 +x 4 +s = 48 4x +2x 2 +.5x 3 +x 4 +s 2 = 20 2x +.5x 2 +0.5x 3 +x 4 +s 3 = 8 x i 0 9
( ) c 4 c B B A 4 = 5 (0, 0, 0) = 5 0 Current basis still optimal. Do not produce stools 0
MIT OpenCourseWare http://ocw.mit.edu 5.093J / 6.255J Optimization Methods Fall 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.