Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

EM 602 MANAGEMENT

SCIENCE

Lecture 3:
Sensitivity Analysis and Duality

Sensitivity Analysis
An LP Sensitivity Analysis is concerned with how changes in an LP’s
parameters affect the LP’s optimal solution.

𝑐 ←𝑐   𝛥𝑐

𝑏 ←𝑏   𝛥𝑏 What effect do the change in


x2 parameters have on Z*,x*,y*?
𝑎 ←𝑎    𝛥𝑎
Variation in Cj

x*
g1
g2

x1
2

1
Sensitivity Analysis – Graphical Interpretation

Example: The Giapetto problem from Winston

Max. Z = 3X1 + 2X2

S.T. 2X1 + 1X2  100 (Finishing constraint)


1X1 + 1X2  80 (Carpentry constraint)
1X1 + 0X2  40 (Demand constraint)
X1  0; X2  0
Where:
X1 : number of soldiers produced per week;
X2 : number of trains produced per week.

Optimal solution: Z* = 180, and X1 = 20 and X2 = 60

X2 LP Sensitivity Analysis
Graphical Interpretation
X 1  40
(Giapetto Example)

Max. Z = 3X1 + 2X2


100
s.t.
80
C 2X1 + 1X2  100 (Finishing constraint)
A 1X1 + 1X2  80 (Carpentry constraint)
60
1X1 + 0X2  40 (Demand constraint)
40
X1  0 ; X2  0
20 B

20 40 60 80 100
X1
X 1  X 2  80
2 X 1  X 2  100 : Z* = 180, and X1 = 20 and X2 = 60
Z  3X1  2X 2
4

2
LP Sensitivity Analysis
Giapetto Example (Continued)
Max Z = 3X1 + 2X2 + 0S1 + 0S2 + 0S3

2X1 + 1X2 + 1S1 = 100


1X1 + 1X2 +1S2 = 80
1X1 + 0X2 + 1S3 = 40
X1 , X2 , S1, S2 , S3  0

(1) Objective Function Coefficient Analysis


If c1 is the contribution to profit by each solider, for what values of c1 does the
current basis remain optimal?

Now c1 = 3 – correct?

3𝑋 𝑍 3
3𝑋 2𝑋 𝑍 ⇒ 𝑋 𝑆𝑙𝑜𝑝𝑒
2 2 2
5

LP Sensitivity Analysis
Giapetto Example (Continued)
X2
Giapetto Problem
100

finishing constraint
Slope = -2

A Feasible Region
80

demand constraint

Isoprofit line z = 120


60

B Slope = -3/2

D
40

carpentry constraint
Slope = -1
20

20 40 50 60 80 X1
6

3
LP Sensitivity Analysis
Giapetto Example (Continued)

Consider a generic case with the formula:


c1 X 1 Z
X2   
2 2
Then, the optimal solution remains the same as long as the slope of the
objective function is below –1 and above –2.
c1
2    1 or 2  c1  4
2

Where –2 is the slope of the binding constraint 2 X 1  X 2  100 and -1 is the


slope of line X 1  X 2  80

2X1 + 1X2  100 (Finishing constraint)


1X1 + 1X2  80 (Carpentry constraint)
1X1 + 0X2  40 (Demand constraint)
LP Sensitivity Analysis Graphical Interpretation
X2
(Giapetto Example)

(2) RHS Analysis


X 1  40
For what changes of b1 will the current optimal
solution change?

100 Point Y: 2*40 + 40= 120


80
Z
A
Point Z: 0 + 80 = 80
60

Y
40

20

20 40 60 80 100

X1
X 1  X 2  80
2 X 1  X 2  100

Z  3X1  2X 2 8

4
LP Sensitivity Analysis Graphical Interpretation
X2
(Giapetto Example)

(2) RHS Analysis


X 1  40
For what changes of b1 will the current optimal
solution change?

100 For 80 < b1 < 120, the optimal solution remains (the
80 intersection point of) the binding constraints of
A 2X1 + X2 = 100 and X1 + X2 = 80
60

a) To make the current basis remain optimal


40
b) How a change in the RHS changes the decision
20
variable
20 40 60 80 100
X1
X 1  X 2  80
2 X 1  X 2  100

Z  3X1  2X 2
9

LP Sensitivity Analysis
Giapetto Example (Continued)
Exercise 1: Let b1: # of available finishing hours and current b1 = 100.
If b1 = 100 + , while –20 <  < 20 (because 80 < b1 < 120), the optimal solution still binding
by the same constraints:
2X1 + X2 = 100 +  and X1 + X2 = 80  X1 = 20 +  and X2 = 60 - 
Increasing 1 finishing hour  increases the production of 1 solider and decreases the
production of 1 train

Exercise 2: Let b2: # of available carpentry hours and current b2 = 80.


If b2 = 80 + , while –20 <  < 20 because 60 < b2 < 100, the optimal solution still binding by
the same constraints:
2X1 + X2 = 100 and X1 + X2 = 80 +   X1 = 20 -  and X2 = 60 + 2
Increasing 1 carpentry hour  decreases the production of 1 solider and increases the
production of 2 trains
10

10

5
LP Sensitivity Analysis
Giapetto Example (Continued)
(3) Shadow Prices

Exercise 1:
a) Assume there are (100 + ) hours available
b) The LP optimal solution is (20 + , 60 - )
c) The optimal obj. function is Z = 3X1 + 2X2 = 3(20 + ) + 2(60 - ) = 180 + 
d) Binding constraints are [2X1 + X2 = 100 + ] and [X1 + X2 = 80]
e) Intersect point is (X1 = 20 + , X2 = 60 - )
f) 1 unit increase of finishing hour will increase Z value by $1.

Therefore, the shadow price of the 2X1 + X2 = 100 is $1

11

11

LP Sensitivity Analysis
Giapetto Example (Continued)
(3) Shadow Prices

Exercise 2:
a) Assume there are 40 +  in third constraint, that is X1 = 40 + 
b) Since the optimal value remain the same => Shadow Price = 0
c) Whenever the slack (excess) variable > 0, there is no shadow price.

2X1 + X2 + S1 = 100
X1 + X2 + S2 = 80
X1 + S3 = 40
Optimum = (20,60)
S3 = 20, S1 = S2 = 0

12

12

6
LP Sensitivity Analysis (continued)
(3)New opt. Z-value = Old opt. Z-value + (Constraint i-th shadow price) bi

(4)For example b1 = 1


The old optimal Z  3 X 1  2 X 2  3( 20 )  2( 60 )  180
Constraint 1’s shadow price =1, if b1 = 1
New optimal Z-value = 180 + (1)(1) = 181
(for maximization problems)

(5)If for minimization problem


New opt. Z-value = Old opt. Z-value – (Constraint i th shadow price) bi

13

13

Sensitivity Analysis

𝑐 ←𝑐   𝛥𝑐

𝑏 ←𝑏   𝛥𝑏 What effect do the change in


x2 parameters have on Z*,x*,y*?
𝑎 ←𝑎    𝛥𝑎
Variation in Cj

x*
g1
g2

x1
14

14

7
Sensitivity Analysis (Continued)
𝑍∗ 𝑐 ∗
𝑍∗ 𝑐 𝑥∗ 𝑐 𝑥∗ ⇒ 𝑥∗ 𝑥
𝑐 𝑐
𝑐
𝑤ℎ𝑒𝑟𝑒 ≡ 𝑠𝑙𝑜𝑝𝑒 𝑜𝑓 𝑖𝑠𝑜 𝑐𝑜𝑠𝑡 𝑝𝑟𝑜𝑓𝑖𝑡 𝑙𝑖𝑛𝑒
𝑐
𝑏 𝑎
𝑔 𝑎 𝑥 𝑎 𝑥 𝑏 ⇒ 𝑥∗ 𝑥∗
𝑎 𝑎
𝑏 𝑎
𝑔 𝑎 𝑥 𝑎 𝑥 𝑏 ⇒ 𝑥∗ 𝑥∗
𝑎 𝑎

𝑎 𝑐 𝑎
𝑁𝑜𝑡𝑒: 𝑡𝑜 𝑘𝑒𝑒𝑝 𝑥 ∗ 𝑜𝑝𝑡𝑖𝑚𝑎𝑙, 𝑡ℎ𝑒 𝑓𝑜𝑙𝑙𝑜𝑤𝑖𝑛𝑔 𝑚𝑢𝑠𝑡 ℎ𝑜𝑙𝑑:
𝑎 𝑐 𝑎

𝑎 𝑐 ∆𝑐 𝑎 𝑎 𝑎
⇒ ⇒ 𝑐 𝑐 ∆𝑐 𝑐 𝑐 , 𝑓𝑜𝑟 𝑐 0
𝑎 𝑐 𝑎 𝑎 𝑎
15

15

Sensitivity Analysis – Non-basic Variables

𝑧 𝑐 0 𝑎 𝑦 𝑐

𝑐 ←𝑐 ∆𝑐 ⇒ 𝑎 𝑦 𝑐 ∆𝑐 0

or:

∞ ∆𝑐 𝑎 𝑦 𝑐 𝑧 𝑐 𝑐

∞ ∆𝑐 𝑟𝑒𝑑𝑢𝑐𝑒𝑑 𝑐𝑜𝑠𝑡 𝑗

With multiple optima, zj – cj = 0, and thus, no increase is possible!


16

16

8
Sensitivity Analysis – Basic Variables
𝑐 𝑧 𝑐 0

𝑐 𝑧 𝑐 ∆𝑐

𝑎 𝑦 𝑐 ∆𝑐 0 for xr to remain basic.

Currently in the tableau, there is only one row (the basic variable row) with: 𝑎 1

Thus, the kth row must be multiplied by Δcr and added to the top row to maintain 𝑐 0

This will not affect other basic variables, but it will affect the non-basics!

𝑐
𝑐 𝑐 ∆𝑐 𝑎 0 𝑜𝑟 ∆𝑐 , 𝑎 0
𝑎
𝑐
, 𝑎 0
𝑎

𝑐 𝑐 Bounds within which the basis


max 𝑎 0 ∆𝑐 min 𝑎 0
𝑎 𝑎 remains the same !
17

17

Example: the Final Tableau of Wyndor


Variable Value X1 X2 S1 S2 S3
Z 36 0 0 0 3/2 1
S1 2 0 0 1 1/3 -1/3
X2 6 0 1 0 1/2 0
X1 2 1 0 0 -1/3 1/3

 Reduced Cost
 Top row of Tableau x1 + s1 = 4 +Δ
 Denotes the amount by which x1 = 2  no change in obj. function.
the objective function Z Reduced cost of 𝑠 𝑜𝑟 𝑐 0
would change if Xj were
forced into basis 2x2 + s2 = 12 + Δ. e.g., Δ = 1
 Shadow Prices Reduced cost of 𝑠 𝑜𝑟 𝑐 3/2
 “Special” reduced cost  Z = 36 + 3/2
 The rate at which the objective
function Z changes with Reduced cost of slack, surplus or
respect to a change in RHS of artificial variables = shadow prices
a constraint. 18

18

9
Tableau Example (Continued)
Variable Value X1 X2 S1 S2 S3
Z 36 0 0 0 3/2 1
S1 2 0 0 1 1/3 -1/3 Final Tableau
X2 6 0 1 0 1/2 0
X1 2 1 0 0 -1/3 1/3

∆𝑐 : 𝑥 is basic 𝑘 3 𝑎 , 1 ∆𝑏 : 𝑛 𝑘 5 𝑆

𝑐 1 𝑏 2
max 𝑎 0 max 3 max 𝑎, 0 max 6
𝑎 1 𝑎, 1
3 3

3 𝑏 2
𝑐 2 9 min 𝑎, 0 min 6
min 𝑎 0 min 4.5 𝑎, 1
𝑎 1 2 3
3

⇒ 3 ∆𝑐 4.5 ⇒ 0 ∆𝑐 7.5 ⇒ 6 ∆𝑏 6 ⇒ 12 ∆𝑏 24
19

19

Sensitivity Analysis

20

20

10
LP Duality Theory
 Recall our Wyndor Problem:

Max. Z = 3x1 + 5x2


s.t. 1x1 ≤4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
xj ≥ 0 (j = 1, 2)

21

21

Theory of LP Duality
Optimal Conditions:
𝑍 𝑐 0 𝑗 1,2, … , 𝑛 𝑍 𝑐𝑥
𝑦 0 𝑖 1,2, … , 𝑚

𝑠. 𝑡. 𝑎 𝑥 𝑏 𝑖 1,2, … , 𝑚 𝑦
Thus, we could say we want:

𝑍 𝑦 𝑏𝑦 𝑥 0 𝑗 1,2, … , 𝑛

𝑠. 𝑡. 𝑎 𝑦 𝑐 𝑗 1,2, … , 𝑛

𝑦 0 𝑖 1,2, … , 𝑚
22

22

11
Theory of LP Duality (continued)
 The only feasible solutions are those which satisfy the optimality
conditions of the PRIMAL;
 Minimizing y0 is moving toward feasibility.
 “Don’t overvalue resources”
 DUAL:

𝑚𝑖𝑛𝑖𝑚𝑖𝑧𝑒 𝑦 𝑏𝑦

𝑠. 𝑡. 𝑎 𝑦 𝑐 𝑗 1,2, … , 𝑛

𝑦 0 𝑖 1,2, … , 𝑚
23

23

Economic Interpretation of a Dual LP


y0 = b1 y1 + b2 y2 +………+ bm ym
bi ≡ unit of resource i
yi ≡ contribution of profit per unit of resource i
yi = 0 when slack (i.e., does not use up all of the resource)
bi yi ≡ contribution to profit

𝑎 𝑦 𝑐 ≡ current contribution to profit of the mix of resources that


would be consumed if one unit of activity j were used (j = 1,
2, ... , n)

Dual: Minimize “Implicit Worth” Primal ↔ Dual 


Subject to proper “external” pricing Quantity ↔ Price
24

24

12
Economic Interpretation of a Dual LP
(continued)

𝑎 𝑦 𝑐, if 𝑥 0 j 1,2, … , n

𝑦 0, if 𝑥 0 𝑖 1,2, … , m

1. Whenever an activity j operates at a strictly positive level, 𝑥 0,


the marginal value of the resources it consumes must equal the
profit from the activity.

2. Marginal value of resource i is zero 𝑦 0 whenever the supply


of this resource is not exhausted by the activities 𝑥 0) .
25

25

LP Duality – Example 1
 Primal Problem:
Max. Z = 3x1 + 5x2
s.t. 1x1 ≤4 (y1)
2x2 ≤ 12 (y2)
3x1 + 2x2 ≤ 18 (y3)
xj ≥ 0 (j = 1, 2)

 Dual Problem:
Min. Y = 4y1 + 12y2 + 18y3
s.t. 1y1 + 0y2 + 3y3 ≥ 3 (t1)
0y1 + 2y2 + 2y3 ≥ 5 (t2)
yi ≥ 0 (i = 1, 2, 3)
26

26

13
Theory of LP Duality (continued)
 Note that the number of variables in a dual problem is
equal to the number of constraints in the primal problem.

 If in primal the number of constraints > the number of


variables, then use dual.

 Dual of a dual is ….. Primal !!!

27

27

Theory of LP Duality (continued)


 Dual Problem:
Min. Y = 4y1 + 12y2 + 18y3
s.t. 1y1 + 0y2 + 3y3 ≥ 3 (t1)
0y1 + 2y2 + 2y3 ≥ 5 (t2)
yi ≥ 0 (i = 1, 2, 3)

 Dual of the Dual Problem:


Max. DD = 3t1 + 5t2
s.t. 1t1 ≤4
2t2 ≤ 12 = The Primal !!!
3t1 + 2t2 ≤ 18
tj ≥ 0 (j = 1, 2)
28

28

14
Duality Theory
Dual Y decreases
 Weak Duality:
n m

c x  b y
j 1
j
*
j
i 1
i
*
i  Z Y
Primal
Z increases
 Strong Duality:
 If the primal (dual) has a finite optimal solution, then so does the
dual, and these values are equal: Z = Y.

 Unboundness:
 If the primal (dual) has an unbounded solution, then the dual
(primal) is infeasible.
29

29

Generic LP Duality Statement


1. Primal Problem:
Max. Z = c1x1 + c2x2 + ……. + cnxn
s.t. a11x1 + a12x2 + ……. + a1nxn ≤ b1
a21x1 + a22x2 + ……. + a2nxn ≤ b2
………………

am1x1 + am2x2 + ……. + amnxn ≤ bm


xj ≥ 0 (j = 1, 2,….., n)
2. Dual Problem:
Min. Y = b1y1 + b2y2 + ……. + bmym
s.t. a11y1 + a21y2 + ……. + am1ym ≥ c1
a12y1 + a22y2 + ……. + am2ym ≥ c2
………………

a1ny1 + a2ny2 + ……. + amnym ≤ cn


yi ≥ 0 (i = 1, 2,….., m) 30

30

15
‘General Rules’ for Finding the Dual

Primal Dual

The ith constraint  The ith variable  0

The ith constraint  The ith variable  0

The ith constraint = 0 The ith variable : unrestricted

The jth variable  0 The jth constraint 

The jth variable  0 The jth constraint 

The jth variable : unrestricted The jth constraint =

31

31

‘General Rules’ for Finding the Dual (cont’d)


One Problem Other Problem
Constraint Variable
Objective function Right sides

Minimization Maximization

Variables
0  Constraints
0 
Unrestricted 
Constraints
 0
0
Variables

 Unrestricted

32

16
Primal – Dual Relationship (examples)
1. If primal objective is maximization, dual objective is minimization
2. Number of decision variables and constraints:
 # of dual decision variables = # of primal constraints.
 # of dual constraints = # of primal decision variables.

3. Coefficients of decision variables in dual objective function are right-hand-


sides of primal constraints.
Problem P Problem D
max F  3x1  5 x2 min G  41  122  183
s.t. x1 4 subject to
2 x2  12 1  33  3
3 x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0
   
Primal Problem Dual Problem

33

33

Primal – Dual Relationship (examples)


4. Coefficients of decision variables in primal objective function are right-
hand-sides of dual constraints.

Problem P Problem D
max F  3 x1  5 x2 min G  41  122  183
s.t. x1 4 subject to
2 x2  12 1  33  3
3 x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0


 
Primal Problem Dual Problem

34

34

17
Primal – Dual Relationship (examples)
5. Coefficients of one variable across multiple primal constraints are
coefficients of multiple variables in one dual constraint.
Problem P Problem D
max F  3x1  5 x2 min G  41  122  183
s.t. x1 4 subject to
2 x2  12 1  33  3
3x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0
  
Primal Problem Dual Problem

Problem P Problem D
max F  3x1  5 x2 min G  41  122  183
s.t. x1 4 subject to
2 x2  12 1  33  3
3x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0
  
Primal Problem Dual Problem
35

35

Primal – Dual Relationship (examples)


6. Coefficients of one variable across multiple dual constraints are coefficients
of multiple variables in one primal constraint.
Problem P Problem D
max F  3x1  5 x2 min G  41  122  183
s.t. x1 4 subject to
2 x2  12 1  33  3
3 x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0
  
Primal Problem Dual Problem

Problem D Problem P Problem D


Problem P
min G  41  122  183 max F  3 x1  5 x2 min G  41  122  183
max F  3 x1  5 x2
subject to s.t. x1 4 subject to
s.t. x1 4
2 x2  12 1  33  3 2 x2  12 1  33  3
3 x1  2 x2  18  22  23  5 3x1  2 x2  18  22  23  5
x1  0, x2  0 1  0, 2  0, 3  0 x1  0, x2  0 1  0, 2  0, 3  0
     
Primal Problem Dual Problem
Primal Problem Dual Problem

36

36

18
Complimentary Slackness
 If, in an optimal solution of an LP, the value of the dual
variable associated with a constraint is nonzero, then that
constraint must be satisfied with equality.
n
If yi  0 =>  aij x j  bi
j 1

 Further, if a constraint is satisfied with strict inequality, then


its corresponding dual variable must equal zero.
n
If  aij x j  bi  yi  0
j 1

37

37

‘General Rules’ for Finding the Dual

Primal (Max) Dual (Min)

The ith constraint  0 The ith variable  0

The ith constraint  0 The ith variable  0

The ith constraint = 0 The ith variable : unsigned

The jth variable  0 The jth constraint  0

The jth variable  0 The jth constraint  0

The jth variable : unsigned The jth constraint = 0

38

38

19
Solving Dual via Complimentary
Slackness
 Primal: Max Z = 3x1 + 5x2  Dual: Min Y = 4y1 + 12y2 + 18y3
s.t. 1x1 ≤4 (y1) s.t. 1y1 + 0y2 + 3y3 ≥ 3

2x2 ≤ 12 (y2) 0y1 + 2y2 + 2y3 ≥ 5


yi ≥ 0 (i = 1, 2, 3)
3x1 + 2x2 ≤ 18 (y3)
x1 ≥ 0; x2 ≥ 0
 Optimal Solution: x* = [x1*, x2*] = [2, 6]; Z* = 36
 y1* = 0 because 1(2) + 0(6) = 2 < 4 in Constraint 1 (the constraint is not
binding)
 So, the constraints of the dual problem are:
1y1 + 0y2 + 3y3 = 3
0y1 + 2y2 + 2y3 = 5
 Since y1 = 0, solving the above equations yields:
y* = [y1*, y2*, y3*] = [0, 3/2, 1]; Y* = 36
39

39

Finding Dual of a Complex LP


 Primal Problem:
Max. Z = 2x1 + 1x2 + 3x3 + 1x4
s.t. 1x1 + 1x2 + 1x3 + 1x4 ≤ 5 (y1)
–2x1 + 1x2 – 3x3 = 4 (y2)
1x1 – 1x3 + 1x4 ≥ 1 (y3)
x1, x3 ≥ 0; x2, x4 are unsigned

Turn the Primal into Dual using the general rules (shown
earlier in a table)!

40

40

20
Finding Dual of a Complex LP
 Dual Problem:
Min. W = 5y1 + 4y2 + 1y3
s.t. 1y1 – 2y2 + 1y3 ≥ 2
1y1 + 1y2 + 0y3 = 1
1y1 – 3y2 + 1y3 ≥ 3
1y1 + 0y2 + 1y3 = 1
y1 ≥ 0; y2 unsigned; y3 ≤ 0

Primal solution:
Decision Variables x = [0, 4, 0, 1] and Z* = 5
Shadow prices: y1 = 1.5, y2 = -0.5, y3 = -0.5
41

41

Complex Example – LINDO Solution


LP OPTIMUM FOUND AT STEP 2
OBJECTIVE FUNCTION VALUE
1) 5.000000
VARIABLE VALUE REDUCED COST
X1 0.000000 0.000000
X2 4.000000 0.000000
X3 0.000000 0.500000
X4 1.000000 0.000000
ROW SLACK/SURPLUS DUAL PRICES
2) 0.000000 1.500000
3) 0.000000 -0.500000
4) 0.000000 -0.500000
NO. ITERATIONS= 2
42

42

21
Complex Example – LINDO Solution
LP OPTIMUM FOUND AT STEP 2
OBJECTIVE FUNCTION VALUE
1) 5.000000
VARIABLE VALUE REDUCED COST
X1 0.000000 0.000000
X2 4.000000 0.000000
X3 0.000000 0.500000
X4 1.000000 0.000000
ROW SLACK/SURPLUS DUAL PRICES
2) 0.000000 1.500000
3) 0.000000 -0.500000
4) 0.000000 -0.500000
NO. ITERATIONS= 2
43

43

22

You might also like