Chapter 4-Linear Programming-Sensitivity Analysis and Duality

You might also like

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

THE SIMPLEX

METHOD
SENSITIVITY
ANALYSIS
ASSOC. PROF. HO THANH PHONG
OBJECTIVES
AFTER COMPLETING THIS CHAPTER, STUDENTS
WILL BE ABLE TO:

• Understand meaning of Sensitivity Analysis and


Duality
• Perform sensitivity analysis
• Establish dual – primal problems

Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 2


Sensitivity Analysis in LP and Duality

• Changes in the objective function coefficients


• Changes in Right-hand-side values – Shadow Price
• Changes in the constraint coefficients
• Addition of a new constraint
• Addition of a new decision variable

Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 3


CONSIDER THE FOLLOWING EXAMPLE:

Maximize Z = 50 X1 + 120 X2
Subject to:
2 X1 + 4 X2  80 60
3 X1 + X2  60
X1, X2  0

• Optimal solution at point A


• X1 = 0; X2 = 20; Profit = 2400
A 20
• Basic variables: X2=20 , S2 = 40 50 X1 + 120 X2 =2400

• Non-basic: X1= S1=0.

20 40 50

Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 4


SIMPLEX TABLEAU
1st Cj 50 120 0 0 RHS
tableau
Solution X1 X2 S1 S2
0 S1 2 4 1 0 80
0 S2 3 1 0 1 60
Zj 0 0 0 0 0
Cj - Zj 50 120 0 0

Cj 50 120 0 0 RHS
Final
Solution X1 X2 S1 S2
tableau
120 X2 1/2 1 1/4 0 20
0 S2 5/2 0 -1/4 1 40
Zj 60 120 30 0 2400
Cj - Zj -10 0 -30 0

Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 5


1. Changes in the objective function coefficients
Final simplex table:

Cj 50 120 0 0 RHS

Solution X1 X2 S1 S2
120 X2 1/2 1 1/4 0 20
0 S2 5/2 0 -1/4 1 40
Zj 60 120 30 0 2400
Cj - Zj -10 0 -30 0

a. Change coefficients of Nonbasic:


For nonbasic, Zj values are > 0 ➔ Cj ≤ Zj (In Maxmization ➔ if
(Cj – Zj) >0 variable may become basic).

➔ - ∞ ≤ Cj (for X1) ≤ 60; - ∞ ≤ Cj (for S1) ≤ 30

6
b. Change coefficients of basic variables: changes in coefficients of basic
variables will affect to all variables. We use (120 + ∆) for X2 and rework the
simplex tableau.
Cj Basic 50 120+∆ 0 0 RHS-
Vars. X1 X2 S1 S2 Quantity
120+∆ X2 1/2 1 1/4 0 20
0 S2 5/2 0 - 1/4 1 40
Zj 60+1/2∆ 120+∆ 30+1/4∆ 0 2400+20∆
Cj – Zj -10-1/2∆ 0 -30-1/4∆ 0

The optimality will be unchanged if and only if Cj – Zj ≤ 0.


• With X1: -10-1/2∆ ≤ 0 ↔ ∆ ≥ -20.
• With S1: -30-1/4∆ ≤ 0 ↔ ∆ ≥ -120.
• Combine both conditions, we use the condition ∆ ≥ -20 ➔ X1 will not enter
the basic while coefficient of X2 maintains: (120+∆) ≥ 120 –20 = 100
Or 100 ≤ Cj (X2) ≤ infinity
7
Using software to obtain optimal solutions and range of coefficients as follows:
- For X1: −∞ ≤ 𝐶1 ≤ 60
- For X2: 100 ≤ 𝐶2 ≤ ∞

8
2. SHADOW PRICE & REDUCED COST
• Shadow Price:
The shadow price is the change in objective function value from increasing
of one unit of a scare resource. Where we can find shadow price? Look at
the negative values at (Cj – Zj) row of slack variables, these values are
called shadow prices or duals.

Cj Basic 50 120 0 0 RHS-


Vars. X1 X2 S1 S2 Quantity
120 X2 1/2 1 1/4 0 20
0 S2 5/2 0 - 1/4 1 40
Zj 60 120 30 0 2400
Cj – Zj -10 0 -30 0
Obj. function value will increase
30 when increasing one unit of
resource associated with S1
Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 9
Reduced Cost
If we look at the nonbasic real variable (X1), we have (-10), 10 is so called
reduced cost. The reduced costs are the values those we can reduce in
coefficients of objective function so that the associated variable become
basic variables. Look at the final tableau:

Cj Basic 50 120 0 0 RHS


Vars. X1 X2 S1 S2

120 X2 1/2 1 1/4 0 20


0 S2 5/2 0 - 1/4 1 40
Zj 60 120 30 0 2400
Cj – Zj -10 0 -30 0

10 is reduced cost

Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 10


2. CHANGES IN THE RHS
• RHS ranging: the process which determining number of resources
needed to add or to reduce so that we still have the same shadow
price.
• Take Quantity divide to corresponding columns in the final tableau,
get:
• For S1: The smallest positive ratio is 80. This is
how many hours of resource 1 can be
reduced without changing the current
Quantity S1 Ratio solution. Hence, we can decrease RHS
as much as 80, make minimum RHS
20 1/4 80 will be (80-80) = 0.
40 - 1/4 - 160
The smallest negative ratio is -160. This
is how many hours of resource 1 can be
added without changing the current
solution. Maximum value of RHS will
be 80-(-160) =240
So, range of RHS of resource 1: (0, 240)
Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 11
– For S2: With the same manner, we get smallest
Quantity S2 Ratio positive ratio is 40. Hence, we can
decrease RHS as much as 40, make
minimum RHS will be (60-40) = 20.
20 0 ∞
Maximum value of RHS will be ∞.
40 1 40
So, range of RHS of resource 2: (20, ∞)
3. Computer output for ranging
Maximize Profit = $50 X1 + $120 X2
Subject to:
2 X1 + 4 X2  80
3 X1 + X2  60
X1, X2  0
Variable Value Reduced Cost Original Val Lower Bound Upper Bound
X1 0. 10 50. -Infinity 60.
X2 20. 0 120. 100. Infinity

Constraint Dual Value Slack/Surplus Original Val Lower Bound Upper Bound
Constraint 1 30 0 80 0. 240.
Constraint 2 0 40 60 20. Infinity
12
The Duality in LP
• Every LP problem, called primal problem, has associated with it
another LP problem called the dual problem.
• The relationship between the dual and the primal prove to be
extremely useful in a variety of ways. Originally,

Primal (Dual) Dual (Primal)

Maximization Profit Minimization Opportunity Cost


Constraints type ≤ Constraints type ≥
Constraints: resources Constraints: Product profits
Max. Profit = $50 X1 + $120 X2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2  80 ( U1) 2 U1 + 3 U2 ≥ 50 ( X1)

3 X1 + X2  60 ( U2) 4 U1 + 1 U2 ≥ 120 ( X2)


X1, X2  0 U1, U2  0

13
The Duality in LP (contd.)
• Steps to form a Dual:
• If the primal is maximization, the dual is a minimization, and vice versa
• The RHS values of the primal (dual) constraints become the dual’s (primal’s)
objective function coefficients.
• The transpose of the primal constraint coefficients become the dual constraint
coefficients.
• Constraints inequality signs are reversed.
• Example:

Primal Standard primal Dual


Max Z = 5x1 + 12 x2 + 4x3 Max Z = 5x1 + 12 x2 + 4x3 + 0x4 Min Y = 10 U1+8U2
St. St. St.
x1 + 2x2 + x3 ≤ 10 x1 + 2x2 + x3 + x4 = 10 (U1) 1U1 + 2U2 ≥ 5
2x1 – 1x2 + 3x3 = 8 2x1 – 1x2 + 3x3 + 0x4 = 8 (U2) 2U1 - 1U2 ≥ 12
x1,x2, x3 ≥ 0 x1, x2, x3, x4 ≥ 0 1U1 + 3U2 ≥ 4
U1 ≥0
U2 unrestricted

14
Solving Dual problem
Primal (Dual) Dual (Primal)
Max. Profit = $50 X1 + $120 X2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2  80 2 U1 + 3 U2 ≥ 50
3 X1 + X2  60 4 U1 + 1 U2 ≥ 120
X1 ≥0 U1 ≥0
X2 ≥ 0 U2 ≥ 0

- Absolute values of number in the (Cj-Zj) row under slack variables are the solutions of the
dual (Ui’s). These are shadow prices.
- Optimal value of objective functions of both problems are equal. Always we have Obj. value
of max. Problem ≤ Obj. value of min. Problem.

-Important property: Coefficient in (Cj – Zj) of variable j in one problem = RHS – LHS of
constraint jth in another problem at any iteration.

15
Solving Dual problem
Primal (Dual) Dual (Primal)
Max. Profit = 50 X1 + 120 X2+0 S1+0 S2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2 + S1 = 80 2 U1 + 3 U2 ≥ 50
3 X1 + X2 + S2 = 60 4 U1 + 1 U2 ≥ 120
X1 ≥0 U1 ≥ 0
X2 ≥ 0 U2 ≥ 0
Primal solution 1st iteration Primal 2nd iteration solution (optimal)

Cj 50 120 0 0 Cj 50 120 0 0

Solution X1 X2 S1 S2 Quantity Solution X1 X2 S1 S2 Quantity

0 S1 2 4 1 0 80 120 X2 1/2 1 1/4 0 20


0 S2 3 1 0 1 60 0 S2 5/2 0 -1/4 1 40
Zj 0 0 0 0 0 Zj 60 120 30 0 2400
Cj-Zj 50 120 0 0 Cj-Zj -10 0 -30 0

X1=0; X2= 0; S1= 80; S2 = 60 X1=0; X2= 20; S1=0; S2 = 40

At S1 column: (Cj-Zj) 0 = 0 – U1 (3rd dual constraint) ➔ At S1 column: -30 = 0 – U1 ➔ U1 = 30.


U1 = 0. Similarly, U2 = 0 At S2 column: U2 = 0; 16
Primal (Dual) Dual (Primal)
Max. Profit = $50 X1 + $120 X2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2  80 2 U1 + 3 U2 ≥ 50
3 X1 + X2  60 4 U1 + 1 U2 ≥ 120
X1 ≥0 U1 ≥0
X2 ≥ 0 U2 ≥ 0

Primal optimal solution Dual optimal solution


Cj Solutio X1 X2 S1 S2 Quan-tity Cj Solutio U1 U2 S1 S2 A1 A2 Quan-
n n tity
120 X2 1/2 1 1/4 0 20 80 U1 1 1/4 0 -1/4 0 1/2 30
0 S2 5/2 0 -1/4 1 40 0 S1 0 -5/2 1 -1/2 -1 ½ 10
Zj 60 120 30 0 2400 Zj 80 20 0 -20 0 40 2400
Cj-Zj -10 0 -30 0 Cj-Zj 0 40 0 20 M M-40
X1=0; X2= 20; S1=0; S2 = 40 U1= 30; U2= 0; S1= 10; S2= 0

17

You might also like