sensitivity analysis and duality of lp problems

29
Sensitivity analysis and Duality of LP problems Ha Thi Xuan Chi, PhD 1

Upload: sara-tran

Post on 16-Feb-2016

89 views

Category:

Documents


4 download

DESCRIPTION

Sensitivity Analysis and Duality of LP Problems

TRANSCRIPT

Page 1: Sensitivity Analysis and Duality of LP Problems

Sensitivity analysis and Duality of LP problems

Ha Thi Xuan Chi, PhD

1

Page 2: Sensitivity Analysis and Duality of LP Problems

2

Changes in the objective function coefficients Changes in Right-hand-side values (RHS) Changes in the constraint coefficients Addition of a new constraint Addition of a new decision variableOften involves a series of what-if question

Sensitivity Analysis in LP

Types of Sensitivity Analysis

How do changes in an LP’s parameters (objective function coefficients, right-hand sides, and technological coefficients) change the optimal solution?

Page 3: Sensitivity Analysis and Duality of LP Problems

NOTATIONS

3

S*=B-1 A*= B-1. A=S*.Ay* =cB B-1

z* =cB B-1 A = y*.Az*-c =cB B-1 A-c= y*.A-cZ* = cB B-1 b= y*.bb* = B-1 b=S*.b

Basic variable

Z Coefficient of: RHSOriginal variable

Slackvariable

Z 1 cB .B-1 .A - c=

z*-c

cB .B-1

=y* cB .B-1 .b

=Z*

xB 0 B-1 .A=A*

B-1

=S*B-1 .b=b*

Page 4: Sensitivity Analysis and Duality of LP Problems

4

Consider the following example:

Maximize Profit = $50 X1 + $120 X2

Subject to:2 X1 + 4 X2 803 X1 + X2 60

X1, X2 0• Optimal solution at point A• Profit = 2400• Basic variables: X2=20 , S2 = 40• Non-basic: X1= S1=0. A

20 40 50

60

50 X1 + 120 X2 =240020

Page 5: Sensitivity Analysis and Duality of LP Problems

Changing in the objective function coefficients, c

5

Page 6: Sensitivity Analysis and Duality of LP Problems

Changing in the objective function coefficients, c (cont.)

6

Page 7: Sensitivity Analysis and Duality of LP Problems

7

Changing in the objective function coefficients, c (cont.)Final simplex table:

a. Change coefficients of Nonbasic variables: x1

50 120 0 0Cj Basic Eq. Z X1 X2 S1 S2 RHS

Z (0) 1 10 0 30 0 2400120 X2 (1) 0 0.5 1 0.25 0 20

0 S2 (2) 0 2.5 0 -0.25 1 40

1

1 1 1 1 1 1

1

1

1

1

* * ( )

230 0

0

*. 503

11

00

60

z

c

cc

c z c c

y A c

c

c

The optimal does not change if 1 60c

Page 8: Sensitivity Analysis and Duality of LP Problems

8

b. Changing in coefficient of the basic variable

Page 9: Sensitivity Analysis and Duality of LP Problems

9

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

• With X1: 0.5 × C2 + 0 × 2.5 – 50 ≥ 0 => C2 ≥ 100.

• With S1: 0.25 × C2+ 0 × (-0.25) – 0 ≥ 0 => C2 ≥ 0.

• Combine both conditions, we have 100 ≤ C2

50 C(X2) 0 0Basic Eq. Z X1 X2 S1 S2 RHS

Z (0) 1 10 0 30 0 2400C(X2) X2 (1) 0 0.5 1 0.25  0 20

0 S2 (2) 0 2.5 0 -0.25 1 40

Changing in coefficient of the basic variable

Page 10: Sensitivity Analysis and Duality of LP Problems

10

50 C(X2) 0 0Basic Eq. Z X1 X2 S1 S2 RHS

Z (0) 1 10 0 30 0 2400C(X2) X2 (1) 0 0.5 1 0.25 0 20

0 S2 (2) 0 2.5 0 -0.25 1 40Consider the optimal simplex tableau

2 2 2

2

2 2 2

2

2 2

Row 0 : 10 0 30 0

Change 120 to 120

New row 0 : 10 0- 30 0

For x to stay a basic z *-c must be equal to 0.Gaussian elimination:Row 0: 10 0- 30 0

Row 1: 0.5

c c c

c

c

c c

2 2

2 2

0.25 0 =

10 0.5 0 0.25 30 0

c c

c c

2 22 2

2 2

10 0.5 0 2020 100

0.25 30 0 120c c

c cc c

The optimal does not change if

Changing in coefficient of the basic variable

Page 11: Sensitivity Analysis and Duality of LP Problems

11

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 solution. Hence, we can decrease RHS as much as 80, make minimum RHS will be (80-80) = 0.

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)

S1 RHS Ratio

1/4 20 80

- 1/4 40 - 160

Changing the right hand side, bi

Page 12: Sensitivity Analysis and Duality of LP Problems

12

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 positive values at Z-row of slack variables, these values are called shadow prices or duals. 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:

Changing the right hand side, bi (cont.)

Obj. function value will increase30 when increasing one unit ofresource associated with S1

50 120 0 0Basic Eq. Z X1 X2 S1 S2 RHS

Z (0) 1 10 0 30 0 2400120 X2 (1) 0 0.5 1 0.25 0  20

0 S2 (2) 0 2.5 0 -0.25 1 40

Page 13: Sensitivity Analysis and Duality of LP Problems

13

Changing the right hand side, bi(cont.)

Page 14: Sensitivity Analysis and Duality of LP Problems

The only revision in the model is the changes in RHS. RHS of final row 0: z*= y*b RHS at final rows 1,...,m = S*b

14

Basic Eq. Z X1 X2 S1 S2 RHSZ (0) 1 10 0 30 0 2400

C(X2) X2 (1) 0 0.5 1 0.25 0 200 S2 (2) 0 2.5 0 -0.25 1 40

1 11 1 1

2 2

1 1 1 1

1 11

2 1

* 20 0.25 0( )

* 40 0.25 1if change to

* 20 0.2520 0.25 0* 40 0.25 1 40 0.250

b bB b B b B b b

b bb b b b

b bbb b

Changing the right hand side, bi (cont.)

Page 15: Sensitivity Analysis and Duality of LP Problems

Changing the right hand side, bi (cont.)

15

1 11

2 1

1 1

1 1

1

1

1

* 20 0.2520 0.25 0* 40 0.25 1 40 0.250

20 0.25 0 8040 0.25 0 160

80 16080 80 80 160 80

0 120 240

b bbb b

b bb b

bb

b

10 240b

Page 16: Sensitivity Analysis and Duality of LP Problems

The duality in LP

16

Two of the most important topics in linear programming are sensitivity analysis and duality.

Every linear programming problem has associated with it another linear programming problem called the dual.

Page 17: Sensitivity Analysis and Duality of LP Problems

17

1

1

W=

to :

, for 1, 2,...,

0, for 1, 2,...,

m

j ji

m

ij ii

i

Minimize b y

subject

a y c j n

and y i m

1

1

Z=

to :

, for 1, 2,...,

0, for 1, 2,...,

n

j jj

n

ij jj

j

Maximize c x

subject

a x b i m

and x j n

Primal problem Dual problem

Page 18: Sensitivity Analysis and Duality of LP Problems

18

W= to :

0

Maximize ybsubjectyA cand y

Z= to :

0

Maximize cxsubjectAx band x

Primal problem Dual problem

Page 19: Sensitivity Analysis and Duality of LP Problems

WYNDOR GLASS CO. PROBLEM

19

Glass products : windows and glass doors. Plant 1: Aluminum frames and hardware : Product 1 Plant 2: Wood frame: Product 2 Plant 3: The glass and assembles the products: Product

1 & 2. Product 1: An 8-foot glass door with aluminum framing Product 2: A 4x6 foot double-hung wood-framed window WYNDOR GLASS CO problem: Determine what the

production rates should be for the two products in order to maximize their total profit

Page 20: Sensitivity Analysis and Duality of LP Problems

WYNDOR GLASS CO Data

Tuesday, September 09, 2014

20

Page 21: Sensitivity Analysis and Duality of LP Problems

21

Maximize Z = 3x1 + 5x2Subject to x1 ≤ 4 2x2 ≤ 123x1 + 2x2 ≤ 18 x1 ≥ 0 x2 ≥ 0.

Minimize W = 4y1 + 12y2 +18y3Subject to y1 +3y3 ≥ 3 2y2 +2y3 ≥ 5 y1 ≥ 0 y2 ≥ 0 y3 ≥0

Primal problem Dual problem

Page 22: Sensitivity Analysis and Duality of LP Problems

22

Table 5.1. Row 0 and corresponding dual solution for each iteration for theWyndor Glass Co. example

Page 23: Sensitivity Analysis and Duality of LP Problems

23

The Dual An alternate formulation of a linear programming

problem as either the original problem or its mirror image, the dual, which can be solved to obtain the optimal solution.

Its variables have a different economic interpretation than the original formulation of the linear programming problem (the primal).

It can be easily used to determine if the addition of another variable to a problem will change the optimal.

Page 24: Sensitivity Analysis and Duality of LP Problems

Dual The number of decision variables in the primal is equal

to the number of constraints in the dual. The number of decision variables in the dual is equal

to the number of constraints in the primal. Since it is computationally easier to solve problems

with less constraints in comparison to solving problems with less variables, the dual gives us the flexibility to choose which problem to solve.

24

Page 25: Sensitivity Analysis and Duality of LP Problems

25

The Duality in LP

Primal (Dual) Dual (Primal)

Maximization Profit Minimization Opportunity Cost

Constraints type ≤ Constraints type ≥

Constraints: resources Constraints: Product profits

Max. Profit = $50 X1 + $120 X2

Subject to:

Min. Opportunity Cost = 80 U1 + 60 U2

Subject to:

2 X1 + 4 X2 80 ( U1) 2 U1 + 3 U2 ≥ 50 ( X1)

3 X1 + X2 60 ( U2) X1, X2 0

4 U1 + 1 U2 ≥ 120 ( X2) U1, U2 0

Page 26: Sensitivity Analysis and Duality of LP Problems

26

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:

The Duality in LP (contd.)

Primal Standard primal DualMax Z = 5x1 + 12 x2 + 4x3

St. x1 + 2x2 + x3 ≤ 10

2x1 – 1x2 + 3x3 = 8

x1,x2, x3 ≥ 0

Max Z = 5x1 + 12 x2 + 4x3 + 0x4

St. x1 + 2x2 + x3 + x4 = 10 (U1)

2x1 – 1x2 + 3x3 + 0x4 = 8 (U2)

x1, x2, x3, x4 ≥ 0

Min Y = 10 U1+8U2

St. 1U1 + 2U2 ≥ 5

2U1 - 1U2 ≥ 12

1U1 + 3U2 ≥ 4

U1 ≥ 0

U2 unrestricted

Page 27: Sensitivity Analysis and Duality of LP Problems

27

Solving Dual problem

Primal optimal solution

Cj Solution

X1 X2 S1 S2 Quan-tity

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

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

Primal (Dual) Dual (Primal)

Max. Profit = $50 X1 + $120 X2

Subject to:

Min. Opportunity Cost = 80 U1 + 60 U2

Subject to:

2 X1 + 4 X2 80 2 U1 + 3 U2 ≥ 50

3 X1 + X2 60 4 U1 + 1 U2 ≥ 120

Dual optimal solution

Cj Solution

U1 U2 S1 S2 A1 A2 Quan-tity

80 U1 1 1/4 0 -1/4 0 1/2 30

0 S1 0 -5/2 1 -1/2 -1 ½ 10

Zj 80 20 0 -20 0 40 2400

Cj-Zj 0 40 0 20 M M-40

U1= 30; U2= 0; S1= 10; S2= 0

- Absolute values of number in the (Cj-Zj) row under slack variables are the solutions of the dual (U i’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.

Page 28: Sensitivity Analysis and Duality of LP Problems

28

Z -4x1 -3x2 = 0Z = 4x1 + 3x2

Thus, an increase of q units in x1 results in an increase of 4q units in the objective function or equivalently a decrease of -4q units

The implications of this observation can be summarised as follows:

If you maximize, look for non-basic variables with negative reduced costsIf you minimize, look for non-basic variables with positive reduced costs

Page 29: Sensitivity Analysis and Duality of LP Problems

29