lect07 sensitivity

22
Lecture 7: Sensitivity Analysis Reading: Chapter 9 1

Upload: 1man1book

Post on 25-Dec-2015

262 views

Category:

Documents


26 download

DESCRIPTION

l

TRANSCRIPT

Page 1: Lect07 Sensitivity

Lecture 7:

Sensitivity Analysis

Reading: Chapter 9

1

Page 2: Lect07 Sensitivity

Sensitivity Analysis:Answering the “What If” Questions

After you have solved a given LP and found an optimalsolution:

1. What is the effect of a change in one or more param-eters on the optimal tableau? current solution?

2. If the solution is no longer optimal, what needs tobe done in order to find a new optimal solution?

3. What happens when we add a new variable? a newconstraint?

4. What if we want to test changes in parameters overa range of possible parameter values?

2

Page 3: Lect07 Sensitivity

Problem Parameters and the OptimalTableau

Suppose we start with a canonical max form tableau

z x1 x2 . . . xn s1 s2 . . . sm rhs0 a11 a12 . . . a1n 1 0 . . . 0 b10 a21 a22 . . . a2n 0 1 . . . 0 b2... ... ... ... ... . . . ...0 am1 am2 . . . amn 0 0 . . . 1 bm1 −c1 −c2 . . . −cn 0 0 . . . 0 0

and we pivot (using whatever method) to optimal tableau

basis z x1 x2 . . . xn s1 s2 . . . sm rhsxB1 0 a∗11 a∗12 . . . a∗1n s∗11 s∗12 . . . s∗1m b∗1xB2 0 a∗21 a∗22 . . . a∗2n s∗21 s∗22 . . . s∗2m b∗2... ... ... ... ... ... ... ... ...

xBm 0 a∗m1 a∗m2 . . . a∗mn s∗m1 s∗m2 . . . s∗mm b∗mz 1 −c∗1 −c∗2 . . . −c∗n y∗1 y∗2 . . . y∗m z∗0

with b∗ ≥ 0 and c∗ ≥ 0. We start by identifying thebasis matrix B = [A·B1, . . . , A·Bm], the basic costs cB =[cB1, . . . , cBm], the inverse matrix S∗ = B−1, and thedual variables y∗ = cBS

∗.

3

Page 4: Lect07 Sensitivity

Example: Woody’s Problem

Initial tableau

z x1 x2 x3 s1 s2 s3 rhs0 8 12 16 1 0 0 1200 0 15 20 0 1 0 600 3 6 9 0 0 1 481 −35 −60 −75 0 0 0 0

Optimal tableau

basis z x1 x2 x3 s1 s2 s3 rhss2 0 0 0 −10 15/4 1 −10 30x2 0 0 1 2 −1/4 0 2/3 2x1 0 1 0 −1 1/2 0 −1 12z 1 0 0 10 5/2 0 5 540

We can read off from the the slack columns

S∗ =

15/4 1 −10−1/4 0 2/31/2 0 −1

y∗ = ( 5/2, 0, 5 )

and note that

cB = ( c5, c2, c1 ) = ( 0, 60, 35 )

4

Page 5: Lect07 Sensitivity

The Key Equations

Recall the matrix equations describing the final tableauderived in Lecture 4:

b∗ = S∗b (1)

A∗ = S∗A (2)

c∗ = c− cBS∗A

= c− y∗A (3)

= c− cBA∗ (3′)

z∗0 = cBS∗b

= y∗b (4)

= cBb∗ (4′)

In formulae:

(1) b∗i = s∗i1b1 + s∗i2b2 + . . . + s∗imbm i = 1, . . . ,m

(2) a∗ij = s∗i1a1j + s∗i2a2j + . . . + s∗imamj i = 1, . . . ,m, j = 1, . . . , n

(3) c∗j = cj − y∗1a1j − y∗2a2j − . . .− y∗mamj j = 1, . . . , n

(3′) = cj − cB1a∗1j − cB2a

∗2j − . . .− cBma

∗mj j = 1, . . . , n

(4) z∗0 = y∗1b1 + y∗2b2 + . . . + y∗mbm

(4′) = cB1b∗1 + cB2b

∗2 + . . . + cBmb

∗m

5

Page 6: Lect07 Sensitivity

Dual Variables as Shadow Prices

The dual variables serve an important role as a mecha-nism for pricing the parameters of the LP. In particular,

The dual variable for the ith constraint repre-sents the shadow price for that constraint,and is the amount the objective function valuewill increase per unit increase of bi. That is,y∗i = ∂z/∂bi.

Example: SupposeWoody has the opportunity to buyadditional amounts of either mahogany or pine at$2 per linear foot. Which (if any) of these opportu-nities should he take advantage of?

Answer: The shadow price of pine is 5/2, which meansthat each additional unit of pine obtained will resultin an increase of the in Woody’s profits by $2.50.Thus buying pine at $2 per linear foot results in aprofit of $.50 for each additional linear foot pur-chased. Mahogany has $0 shadow price (why?).Thus there is no change in the objective per ad-ditional units of pine, and so there is no price at-tractive enough to convince Woody to buy moremahogany.

6

Page 7: Lect07 Sensitivity

Changes in a Resource

Suppose we want to change the values of one or more bkvalues.

Effect on the optimal tableau: bk only appears inEquations (1) and (4), i.e. only the right-hand-side column (b∗ and z∗0) is affected

Effect on the current solution: All basic solutionvalues, as well as the objective function value, maychange. Dual solution remains the same (al-though its objective function value may change).

Effect on feasibility: Primal solution may be-come infeasible. Dual solution remains dualfeasible.

Reoptimization method: Dual Simplex Method.

7

Page 8: Lect07 Sensitivity

Example

Suppose Woody wants to change the amount of pine heuses each day, that is, he is changing b1 — currently120 — to an amount b1 +∆ = 120 + ∆.

New tableau and solution values:

xB∗ =

s2x2x1

=

b1b2b3

=

15/4 1 −10−1/4 0 2/31/2 0 −1

120 + ∆

6048

=

30 + 15/4∆2 − 1/4∆12 + 1/2∆

z0 = ( 5/2, 0, 5 )

120 + ∆

6048

= 540 + 5/2∆

In particular, for every four linear feet of pineWoodybuys, he will make two more chairs and one lesstable (and still no desks), with an additional profitof $10. There is a limit here, however; if, say, Woodybuys 12 more linear feet of pine the RHS values willbe 75, -1, and 18 (and z∗0 = 570). In this case,we would have to reoptimize by performing a dualsimplex pivot in Row 2, in particular, with x4replacing x2 in the basis.

8

Page 9: Lect07 Sensitivity

Changes in Nonbasic Cost Coefficients

Suppose that we want to change the costs ck for one ormore variables that are nonbasic in the optimaltableau.

Effect on the optimal tableau: ck only appearsin the Equation (3) and only for j = k, i.e. onlythe entry c∗k is affected.

Effect on the current solution: Primal and dualsolution values and objective function value remainthe same.

Effect on feasibility: Primal solution remains fea-sible, but dual solution may become infeasible.

Reoptimization method: Primal Simplex Method

9

Page 10: Lect07 Sensitivity

Example

Suppose that Woody wants to change the price for desksso that the current value of c3 = 75 changes to anamount 75 + ∆.

New value of c∗3:

c3 = (75 + ∆)− ( 5/2, 0, 5 )

16209

= −10 + ∆

Reduced costs and ranging for optimality:The reduced cost of any nonbasic variable in the op-timal tableau represents the minimum increaseallowed for the profit of that variable before it entersthe basis. (For a min problem, this represents theminimum decrease in that cost.) Any less thanthat increase will not affect the optimal solution foreither the primal or dual problem.

In our example, if the profits for desks stays below75+∆ = $85 — then there will be no change in theoptimal solution values for the problem. If profitsfor desks exceed $85 then a pivot would be called forin column 3, with desks (x3) replacing chairs (x2)in the basis.

10

Page 11: Lect07 Sensitivity

Changes in Basic Cost Coefficients

Suppose we want to analyze a change in the cost ck ofa basic variable in the optimal tableau.

Effect on the optimal tableau: ck appears in Equa-tion (3′) and (4′), and affects the entire objectivefunction row (z∗0 and all c∗j)

Effect on the current solution: Primal solutionremains the same (although its objective functionmay change) and dual solution valuesmay change.

Effect on feasibility: Primal solution remains fea-sible, dual solution may become infeasible.

Reoptimization method: primal simplex method

11

Page 12: Lect07 Sensitivity

Example

Suppose that Woody wants to analyze a change in theprice of chairs from its current value of c1 = 35 toan amount 35 + ∆.

(Negative of the) new tableau values: Using (3′),(4′) with cB∗ = (c5, c2, c1) = (0, 60, 35 + ∆) we get

c = ( 35 + ∆, 60, 75, 0, 0, 0 )

− ( 0, 60, 35 + ∆ )

0 0 −10 15/4 1 −100 1 2 −1/4 0 2/31 0 −1 1/2 0 −1

= ( 0, 0, −10 + ∆, −5/2− 1/2∆, 0, −5 + ∆ )

z0 = ( 0, 60, 35 + ∆ )

30212

= 540 + 12∆.

Thus if c1 increases by ∆ = 5 the optimal solu-tion value would not change, although its objectivefunction now becomes 600, and the dual solutionbecomes y = (5, 0, 0). If profits decrease by, say,∆ = 10, though, then c4 becomes 5 (correspond-ing tableau value is −5) and so x4 enters the basis,replacing x5.

12

Page 13: Lect07 Sensitivity

Changes in Nonbasic Production Coefficients

Suppose we want to analyze a change in the value aklof a nonbasic variable in the optimal tableau.

Effect on the optimal tableau: akl appears in Equa-tions (2) and (3), and affects all values in Col-umn l (and nothing else).

Effect on the current solution: Primal and dualsolution values and objective function value remainthe same.

Effect on feasibility: Primal solution remains fea-sible, but dual solution may become infeasible.

Reoptimization method: Primal Simplex Method

13

Page 14: Lect07 Sensitivity

Example

Suppose that Woody wants to decrease the number ofcarpenter-hours spent on making desks from its cur-rent value of a33 = 9 to value a33 −∆ = 9−∆, tosee when it becomes profitable to make desks.

New tableau values:a13a23a33

=

15/4 1 −10−1/4 0 2/31/2 0 −1

1620

9−∆

=

−10 + 10∆

2 − 2/3∆−1 + ∆

c3 = 75− ( 5/2, 0, 5 )

1620

9−∆

= −10 + 5∆

Value at which Woody would start makingdesks: Since the only change in the objective rowoccurs at c3, then the tableau — and hence currentsolution — will remain optimal as long as−c3 = 10− 5∆ remains nonnegative.

In this case we need 10−5∆ < 0, i.e. ∆ > 2 (a33 < 7)before it becomes preferable to pivot on Column 3,that is, make desks. We would then make primalsimplex method pivot to reoptimize.

14

Page 15: Lect07 Sensitivity

Adding a Variable

Suppose Woody wants to consider producing executivedesks, with each executive desk requiring 12 linear feet ofpine, 30 linear feet of mahogany, and 15 carpenter-hours,with a profit of $175.

Effect on the optimal tableau: A new column (usingx4 = number of executive desks) is added, using Equa-tions (2) and (3), as if the Revised Simplex Methodwere being applied. Remaining values remain un-changed.

Effect on the current solution: Solution value and ob-jective function value remain the same.

New tableau values:a14a24a34

=

15/4 1 −10−1/4 0 2/31/2 0 −1

123015

=

−75

7−9

c4 = 175− ( 5/2, 0, 5 )

123015

= 70

−c4 = −70, so Woody should produce executive desks.

Reoptimization Method: Primal Simplex Method.In this case the first pivot would be in Row 2, that is,Woody would replace table production with executivedesk production.

15

Page 16: Lect07 Sensitivity

Changes in Basic Production Coefficients

Suppose we want to analyze a change in the value aklof a basic variable xl = xBr in the optimal tableau.

Effect on the optimal tableau: Again, akl appearsin Equations (2) and (3), and affects values in Col-umn l. Unfortunately, Column l is a basic col-umn, and hence the resulting tableau may stopbeing basic.

Remedy: After substituting in the new column val-ues, we pivot on the (r, l)th entry. The tableauthen becomes basic again, but all tableau en-tries can change. Tableau can become primalinfeasible, dual infeasible, or both.

Method of reoptimization: Depends upon tableaustatus. If the tableau happens to remain primalfeasible apply thePhase II Simplex Method;if the tableau happens to remain dual feasible ap-ply the Dual Simplex Method. If it becomesboth primal and dual infeasible, then we would haveto apply some Phase I method.

16

Page 17: Lect07 Sensitivity

Example

Suppose that Woody wants to analyze a changein the amount of carpenter-hours spent on makingchairs (a31) from 3 to 2. Then the values in Column1 become

a11a21a31

=

15/4 1 −10−1/4 0 2/31/2 0 −1

802

=

10

−2/32

c1 = 35− ( 5/2, 0, 5 )

802

= 5

We replace Column 1 by the above values, and thenpivot on entry (3, 1), to get new tableau

basis z x1 x2 x3 s1 s2 s3 rhss2 0 0 0 −5 5/4 1 −5 −30x2 0 0 1 5/3 −1/12 0 1/3 6x1 0 1 0 −1/2 1/4 0 −1/2 6z 1 0 0 15/2 15/4 0 5/2 570

In this case the tableau remains dual feasible, andso we apply the dual simplex method to reoptimize,pivoting on entry (1, 6). This again produces anoptimal tableau.

17

Page 18: Lect07 Sensitivity

Adding a Constraint

Suppose we want to add a constraint of the type

am+1,1x1 + am+1,2x2 + . . . + am+1,nxn ≤ bm+1

1. Enter the corresponding equality constraint (includ-ing the slack variable) into the current tableau as the(m + 1)st row.

2. Cost out the current basis by subtractingam+1,Bi

×(Row i) from Row (m + 1). Equivalently,use the formulae

Am+1,· = Am+1· − Am+1,BA∗

Sm+1,· = − Am+1,BS∗

bm+1 = bm+1 − Am+1,Bb∗

where Am+1,B = (Am+1,B1, . . . , Am+1,Bm).

3. If bm+1 < 0, continue to apply the Dual SimplexMethod to reoptimize.

18

Page 19: Lect07 Sensitivity

Example

Woody wants to limit himself to 10 pieces of furnitureeach day, that is, he wants to add the constraint

x1 + x2 + x3 ≤ 10

to his tableau. He can add this row directly to thetableau and cost out the basic variables, or use the for-mulae:

A4,· = A4· − (A45, A42, A41)A∗

= ( 1, 1, 1 )− ( 0, 1, 1 )

0 0 −100 1 21 0 −1

= ( 0, 0, 0 )

S4,· = −(A45, A42, A41)S∗

= −( 0, 1, 1 )

15/4 1 −10−1/4 0 2/31/2 0 −1

= ( −1/4, 0, 1/3 )

b4 = 10− ( 0, 1, 1 )

30212

= −4.

19

Page 20: Lect07 Sensitivity

This gives the following tableau:

basis z x1 x2 x3 s1 s2 s3 s4 rhss2 0 0 0 −10 15/4 1 −10 0 30x2 0 0 1 2 −1/4 0 2/3 0 2x1 0 1 0 −1 1/2 0 −1 0 12s4 0 0 0 0 −1/4 0 1/3 1 −4z 1 0 0 10 5/2 0 5 0 540

Two dual simplex pivots produce optimal tableau

basis z x1 x2 x3 s1 s2 s3 s4 rhsx3 0 0 0 1 0 −1/10 1/2 −3/2 3x2 0 0 1 0 0 1/5 −2/3 2 0x1 0 1 0 0 0 −1/10 1/6 1/2 7s1 0 0 0 0 1 0 −4/3 −4 16z 1 0 0 0 0 1 10/3 25 470

so that Woody should produce 7 chairs and 3 desks.

20

Page 21: Lect07 Sensitivity

Other Types of Inequalities

≥ constraints: Negate the constraint and treat it asa ≤ constraint.

Equality constraints: Add this constraint just asyou would a ≤ constraint, but without the slackvariable. Then do a dual simplex pivot on theadded row (ignore the sign of the RHS) to determinea basic variable for that tableau. Then continuewith the Dual Simplex Method.

Example: Suppose Woody wanted to make exactly10 pieces of furniture. The initial tableau will looklike

basis z x1 x2 x3 s1 s2 s3 rhss2 0 0 0 −10 15/4 1 −10 30x2 0 0 1 2 −1/4 0 2/3 2x1 0 1 0 −1 1/2 0 −1 12

? 0 0 0 0 −1/4 0 1/3 −4

z 1 0 0 10 5/2 0 5 540

Pivot on the s1 column to put s1 into the basis inRow 4. One more pivot gives the same optimaltableau and solution as in the ≤ case, only withoutthe s4 column.

21

Page 22: Lect07 Sensitivity

Summary of Sensitivity Analysis

parameter relevant parts of tableau method of

changed equation(s) affected reoptimization

bi (1) & (4) entire r.h.s. column dual simplex

nonbasic cj (3) a∗0j only primal simplex

basic cj (3′) & (4′) entire objective row primal simplex

nonbasic aij (2) & (3) entire jth column primal simplex

basic aij (2) & (3) all entries (depends upon

+ pivot type of tableau)

added column (2) & (3) new column primal simplex

added constraint cost out new row dual simplex

22