Professional Documents
Culture Documents
based on:
Bradley, Hax, and Magnanti; Applied
Mathematical Programming, Addison-Wesley,
1977
Chapter 3, sections 3.1, 3.2, 3.3, 3.4 and 3.5
(FEUP | DEGI)
Operations Research
1 / 35
Sensitivity Analysis
We have already been introduced to sensitivity analysis via the geometry of a simple example.
We saw that the values of the decision variables and those of the slack and surplus variables
remain unchanged even though some coefficients in the objective function are varied.
We also saw that varying the righthand-side value for a particular constraint alters the optimal
value of the objective function in a way that allows us to impute a per-unit value, or shadow
price, to that constraint. These shadow prices and the shadow prices on the implicit nonnegativity
constraints, called reduced costs, remain unchanged even though some of the righthand-side
values are varied.
Since there is always some uncertainty in the data, it is useful to know over what range and under
what conditions the components of a particular solution remain unchanged.
Further, the sensitivity of a solution to changes in the data gives us insight into possible
technological improvements in the process being modeled. For instance, it might be that the
available resources are not balanced properly and the primary issue is not to resolve the most
effective allocation of these resources, but to investigate what additional resources should be
acquired to eliminate possible bottlenecks. Sensitivity analysis provides an invaluable tool for
addressing such issues.
(FEUP | DEGI)
Operations Research
2 / 35
Sensitivity Analysis
Learning Objectives
Define shadow price of a constraint.
Calculate shadow prices using only the initial and final simplex tableaux.
Define reduced cost of a decision variable (activity).
Calculate reduced costs using only the initial and final simplex tableaux.
Price out an activity.
Calculate the reduced cost of a variable using the shadow prices and the problem data.
Calculate shadow prices using the problem data and the optimal basis.
Determine how much the objective function coefficients can vary without changing the values of the
decision variables in the optimal solution.
Determine which variables will enter and leave the basis when the new cost coefficient reaches either of
the extreme values of the range.
Determine how much the right-hand-side values can vary such that the variables that constitute the basis
remain the same.
Determine which variables will enter and leave the basis when the new right-hand-side reaches either of
the extreme values of the range.
Identify alternative optimal solutions when they exist.
Identify alternative optimal shadow prices when they exist.
Analyze Solver (Microsoft Excel) sensitivity report and identify there shadow prices, reduced costs, and
variation ranges for objective coefficients and right-hand-sides.
(FEUP | DEGI)
Operations Research
3 / 35
(FEUP | DEGI)
Operations Research
4 / 35
Objective:
max
Subject to:
50xVP
+30xA
+50xF 2000
6xVP
+5xA
+6xF 300
3xVP
+5xA
+5xF 200
xVP ,
xA ,
xF 0
(FEUP | DEGI)
Operations Research
5 / 35
Production Planning at BA
Producing Favaios Bottles
s1
s2
s3
Z
s1
s2
xA
Z
xVP
s2
xA
Z
xVP
50
6
3
50
xA
30
5
5
60
xF
50
6
5
20
s1
1
0
0
0
s2
0
1
0
0
xVP
xA
xF
s1
s2
s3
32
3
0
0
1
0
20
1
1
40
1
0
0
0
0
1
0
0
6
1
xA
0
0
1
0
xF
s1
1
32
3
32
3
160
7
16
s2
0
1
0
0
3
5
14
xVP
1
0
0
0
(FEUP | DEGI)
5
8
78
5
8
48 34
s3
0
0
1
0
1
5
12
s3
3
16
7
16
5
16
9 83
2000
300
200
0
800
100
40
2400
25
25
25
2750
Operations Research
6 / 35
We wish to analyze the effect on the optimal solution of changing various elements of the
problem data without re-solving the linear program or having to remember any of the
intermediate tableaux generated in solving the problem by the simplex method.
The type of results that can be derived in this way are conservative, in the sense that they
provide sensitivity analysis for changes in the problem data small enough so that the same
decision variables remain basic, but not for larger changes in the data.
(FEUP | DEGI)
Operations Research
7 / 35
Shadow Prices
Reduced Costs
(FEUP | DEGI)
Operations Research
8 / 35
Production Planning at BA
Producing Favaios Bottles
xVP
1
xA
0
xF
s1
xVP
5
8
1
32
s2
0
s3
3
16
25
s2
78
3
32
7
16
25
xA
5
8
3
160
5
16
25
48 34
7
16
9 38
2750
+30xA
+5xA
+50xF
+5xF
xF
(FEUP | DEGI)
=
=
=
2000
200
0
Operations Research
9 / 35
Shadow Price
Definition
The shadow price associated with a particular constraint is the
change in the optimal value of the objective function per unit
increase in the righthand-side value of that constraint, all other
problem data remaining unchanged.
(FEUP | DEGI)
Operations Research
10 / 35
Production Planning at BA
Producing Favaios Bottles Shadow Prices
What will be the increase of the profit per unit increase in the oven time?
50xVP
3xVP
+30xA
+5xA
50xVP
3xVP
+30xA
+5xA
50xVP
18xVP
+50xF
+5xF
xF
=
=
=
2001
200
0
xF
=
=
=
2001
200
0
xF
=
=
=
2001
1200
0
+30xA
+30xA
xVP
xA
xF
(FEUP | DEGI)
=
=
=
1
25 32
24 157
160
0
1
, 24 157
, 0)
(xVP , xA , xF ) = (25 32
160
1
7
Z = 50 25 32
+ 60 24 157
+ 20 0 = 2750 16
160
7
2750 =
Profit increase: 2750 16
7
16
xVP
xA
xF
s1
s2
s3
xVP
5
8
1
32
3
16
25
s2
7
8
3
32
7
16
25
3
160
5
16
25
7
16
9 3
8
2750
xA
5
8
48 3
4
Operations Research
11 / 35
Production Planning at BA
Producing Favaios Bottles Shadow Prices
What will be the increase of the profit per unit increase in the decoration capacity?
50xVP
3xVP
50xVP
3xVP
50xVP
18xVP
+30xA
+5xA
+50xF
+5xF
xF
=
=
=
2000
201
0
xF
=
=
=
2000
201
0
xF
=
=
=
2000
1206
0
+30xA
+5xA
+30xA
+30xA
xVP
xA
xF
(FEUP | DEGI)
5
, 25 16
, 0)
(xVP , xA , xF ) = (24 13
16
13
Z = 50 24 16
+ 60
5
16
+ 20 0 = 2759 38
xA
xF
s1
s2
s3
5
8
1
32
3
16
25
3
32
7
16
25
s2
7
8
24 13
16
xA
5
8
3
160
5
16
25
83
25 240
48 3
4
7
16
9 3
8
2750
Operations Research
12 / 35
(FEUP | DEGI)
Operations Research
13 / 35
Reduced Cost
Definition
The reduced cost associated with the nonnegativity constraint for
each variable is the shadow price of that constraint (i.e., the
corresponding change in the objective function per unit increase in
the lower bound of the variable).
(FEUP | DEGI)
Operations Research
14 / 35
Production Planning at BA
Producing Favaios Bottles Reduced costs
What will be the reduction of the profit if we must produce at least one batch of favaios bottles?
50xVP
3xVP
+30xA
+5xA
50xVP
3xVP
+30xA
+5xA
50xVP
3xVP
+30xA
+5xA
+50xF
+5xF
xF
=
=
=
2000
200
1
+50
+5
xF
=
=
=
2000
200
1
xF
=
=
=
1950
195
1
xVP
xA
xF
(FEUP | DEGI)
=
=
=
195/8
195/8
1
195
, 1)
8
195
+ 20
8
,
(xVP , xA , xF ) = ( 195
8
Z = 50
195
8
+ 60
1 = 2701, 25
Profit reduction:
2750 2701, 25 = 48, 75 = 48 43
xVP
xA
xF
s1
s2
s3
xVP
5
8
1
32
3
16
25
s2
7
8
3
32
7
16
25
3
160
5
16
25
7
16
9 3
8
2750
xA
5
8
48 3
4
Operations Research
15 / 35
Production Planning at BA
Producing Favaios Bottles Reduced costs
What will be the reduction of the profit if we must produce at least one batch of favaios bottles?
s1
s2
s3
Z
xVP
50
6
3
50
xA
30
5
5
60
xF
50
6
5
20
s1
1
0
0
0
s2
0
1
0
0
s3
0
0
1
0
xA
0
xF
s1
5
8
1
32
s2
0
s3
xVP
xVP
1
3
16
25
3
32
7
16
25
5
16
25
9 38
2750
s2
78
xA
5
8
3
160
48 43
7
16
(FEUP | DEGI)
2000
300
200
0
Operations Research
16 / 35
General Discussion
Fundamental relationship between shadow prices, reduced
costs, and the problem data. I
s1
1
..
.
0
0
...
...
...
...
xn
a1n
..
.
amn
cn
...
...
sm
0
..
.
1
0
cn
c n+1
=
y1
...
...
...
c n+m
=
ym
s1
..
.
sm
Z
x1
a11
..
.
am1
c1
(FEUP | DEGI)
...
...
Operations Research
b1
..
.
bm
0
Shadow
price
y1
..
.
ym
z 0
17 / 35
General Discussion
Fundamental relationship between shadow prices, reduced
costs, and the problem data. II
At each iteration of the simplex method, the objective function is transformed by subtracting
from it a multiple of the row in which the pivot was performed.
Consequently, the final form of the objective function could be obtained by subtracting multiples
of the original constraints from the original objective function.
Consider first the final objective coefficients associated with the original basic variables: s1 , . . .,
sm . Let 1 , . . ., m be the multiples of each row that are subtracted from the original objective
function to obtain its final form. Since si appears only in the ith constraint and has a +1
coefficient we should have c n+i = 0 1i = i = yi . Thus the shadow prices are the
multiples i .
Since these multiples can be used to obtain every objective
coefficient in the final form, the
P
reduced cost c j of variable xj is given by c j = cj P
m
i=1 aij yi (j = 1 . . . n).
Since c j = 0 for the m basic variables: 0 = cj m
i=1 aij yi (for j basic). This is a system of m
equations in m unknowns that uniquely determines the P
values of the shadow
Pm prices yi .
The current value of the objective function is z 0 = m
i=1 bi yi , z 0 =
i=1 bi yi
(FEUP | DEGI)
Operations Research
18 / 35
(FEUP | DEGI)
Operations Research
19 / 35
Production Planning at BA
Producing Favaios Bottles
Variation in the objective coefficient of xF
Suppose that we increase the objective function coefficient of xF in the original problem
formulation by cF :
In applying the simplex method, multiples of the rows were subtracted from the objective function
to yield the final system of equations. Therefore, the objective function in the final tableau will
remain unchanged except for the addition of cF xF .
s1
s2
s3
Z
xVP
50
6
3
50
xA
30
5
5
60
xF
50
6
5
20 + cF
s1
1
0
0
0
s2
0
1
0
0
s3
0
0
1
0
2000
300
200
0
xVP
1
xA
0
xF
xVP
5
8
s1
1
32
s2
0
s3
3
16
25
3
32
7
16
25
5
16
25
9 38
2750
s2
78
xA
5
8
3
160
+ cF
7
16
48 43
(FEUP | DEGI)
Operations Research
20 / 35
Production Planning at BA
Producing Favaios Bottles
Variation in the objective coefficient of xVP
s1
s2
s3
Z
xVP
xVP
50
6
3
50
+cVP
xA
30
5
5
60
xF
50
6
5
20
s1
1
0
0
0
s2
0
1
0
0
s3
0
0
1
0
xVP
1
xA
0
xF
5
8
s1
1
32
s2
0
s3
3
16
25
3
32
7
16
25
5
16
25
2750
s2
7
8
xA
5
8
3
160
7
16
2000
300
200
0
cVP
48 3
4
9 3
8
xVP
xVP
1
xA
0
xF
5
8
s1
1
32
s2
0
s3
3
16
25
s2
7
8
3
32
7
16
25
3
160
5
16
25
7
16
1 cVP
32
9 3
8
+ 3 cVP
16
2750
xA
5
8
48 3
4
5 cVP
8
(FEUP | DEGI)
25cVP
Operations Research
21 / 35
General Discussion
Ranges of the cost coefficients in the optimal solution.
s1
1
.
.
.
0
0
...
...
...
...
xn
a1n
.
.
.
amn
cn
cn
c n+1
s1
.
.
.
sm
Z
x1
a11
.
.
.
am1
c1
...
...
...
...
sm
0
.
.
.
1
0
b1
.
.
.
bm
0
...
c n+m
z 0
Shadow
price
y1
.
.
.
ym
If xj is a non-basic variable at the final tableau with objective function coefficient cj that was
changed to cjnew = cj + cj , then the current solution remains unchanged so long as the new reduced
P
cost c new
remains nonnegative, that is, c new
= cj + cj m
j
j
i=1 aij yi = c j + cj 0.
The range on the variation of the objective-function coefficient of a nonbasic variable is then given by:
< cj < c j ; ( < cj + cj = cjnew < cj c j ).
If xr is a basic variable at the final tableau
P with objective function coefficient cr that was changed to
crnew = cr + cr , then c new
= cr + cr m
r
i=1 aij yi = c r + cr .
Since xr is a basic variable, c r = 0. So, to recover a canonical form with c new
= 0, we subtract cr
r
times the rth constraint in the final tableau from the final form of the objective function, obtaining new
reduced costs for all nonbasic variables: c new
= c j arj cr , where arj is the coefficient of variable xj in
j
the rth constraint in the final tableau.
For all basic variables c new
= 0 and the current basis remains optimal if c new
0.
j
j
The range on the variation of the objective-function coefficient is:
nc
o
nc
o
Maxj a j | arj > 0 cr Minj a j | arj < 0
rj
(FEUP | DEGI)
rj
Operations Research
22 / 35
(FEUP | DEGI)
Operations Research
23 / 35
Production Planning at BA
Producing Favaios Bottles
Variations on the righthand-side values
Varying the righthand-side value of a constraint that is non-binding in the optimal solution:
the warehouse constraint.
s1
s20
s3
Z
xVP
50
6
3
50
xA
30
5
5
60
xF
50
6
5
20
s1
1
0
0
0
s20
0
1
0
0
s3
0
0
1
0
xVP
1
xA
0
xF
s1
xVP
5
8
1
32
s20
0
s3
3
16
25 + 0 b2
s20
87
3
32
7
16
25 + 1 b2
xA
5
8
3
160
5
16
25 + 0 b2
48 43
7
16
9 38
(FEUP | DEGI)
2000
300 + b2
200
0
2750
Operations Research
24 / 35
Production Planning at BA
Producing Favaios Bottles
Variations on the righthand-side values
Varying the righthand-side value of a constraint that is binding in the optimal solution:
the decoration constraint.
s1
s2
s30
Z
xVP
50
6
3
50
xA
30
5
5
60
xF
50
6
5
20
s1
1
0
0
0
s2
0
1
0
0
s30
0
0
1
0
xVP
xVP
1
xA
0
xF
5
8
s1
1
32
s2
0
s30
3
16
25 3 b3
16
s2
7
8
3
32
7
16
25 7 b3
16
xA
5
8
3
160
5
16
25 + 5 b3
16
48 3
4
(FEUP | DEGI)
7
16
9 3
8
2000
300
200 + b3
0
2750 9 3 b3
8
Operations Research
200 +
2516
7
b3 80
b3new 200 80
25 / 35
xVP
1
xA
0
xF
xVP
5
8
s1
1
32
s2
0
s3
3
16
25
3
b3
16
s2
1 58
3
32
7
16
25
7
b3
16
xA
5
8
3
160
5
16
25 +
5
b3
16
48 43
7
16
9 38
2750 9 38 b3
The final tableau for b3new = 120 (b3 = 80) will be:
xVP
1
xA
0
xF
xVP
5
8
s1
1
32
s2
0
s3
3
16
40
s2
87
3
32
7
16
60
xA
5
8
3
160
5
16
48 43
7
16
9 38
2480
(FEUP | DEGI)
Operations Research
26 / 35
Coefficient
Coefficient
Coefficient
Coefficient
for
for
for
for
xVP
1
xA
0
xF
xVP
5
8
s1
1
32
s2
0
s3
3
16
40
s2
78
3
32
7
16
60
xA
5
8
3
160
5
16
0
t
48 34
t 58
7
16
3
+t 160
9 38
5
t 16
2480
t 0
XA : t 0 t 0
XF : 48 43 t 58 0 t 288
5
3
7
+ t 160
0 t 70
s1 : 16
3
3
5
s3 : 9 8 t 16 0 t 30
0t
70
3
Operations Research
27 / 35
General Discussion
Variations in the Righthand-Side values. I
...
...
sk
0
.
.
.
1
.
.
.
0
0
sk
1k
.
.
.
kk
.
.
.
mk
c n+k
s1
.
.
.
sk
.
.
.
sm
Z
x1
a11
.
.
.
ak1
.
.
.
am1
c1
...
...
...
...
...
xn
a1n
.
.
.
akn
.
.
.
amn
cn
s1
1
.
.
.
0
.
.
.
0
0
...
...
...
...
...
...
...
...
...
...
...
...
...
sm
0
.
.
.
0
.
.
.
1
0
sm
1m
.
.
.
km
.
.
.
mm
c n+m
b1
.
.
.
bk
.
.
.
bm
0
b1
.
.
.
bk
.
.
.
bm
z 0
As this is a canonical form, aij and ij in the final tableau will be structured so that one basic variable is
isolated in each constraint.
(FEUP | DEGI)
Operations Research
28 / 35
General Discussion
Variations in the Righthand-Side values. II
We can change the coefficient bk in the kth righthand-side by bk with all the other data held fixed, simply by
substituting sk by sk0 = sk + bk in the initial tableau.
x1
a11
.
.
.
ak1
.
.
.
am1
c1
s1
.
.
.
sk0
.
.
.
sm
Z
...
...
...
...
...
xn
a1n
.
.
.
akn
.
.
.
amn
cn
...
...
...
...
sk0
0
.
.
.
1
.
.
.
0
0
+ bk )
s1 . . .
11 . . .
.
.
.
k1 . . .
.
.
.
m1 . . .
c n+1 . . .
sk0
1k
.
.
.
kk
.
.
.
mk
c n+k
...
...
s1
1
.
.
.
0
.
.
.
0
0
...
...
...
...
...
...
...
...
...
sm
0
.
.
.
0
.
.
.
1
0
sm
1m
.
.
.
km
.
.
.
mm
c n+m
b1
.
.
.
bk + bk
.
.
.
bm
0
b 1 + 1k bk
.
.
.
b k + kk bk
.
.
.
b m + mk bk
z 0 + c n+k bk
(FEUP | DEGI)
ik
Operations Research
29 / 35
General Discussion
Variations in the Righthand-Side values. III
When bk reaches either its upper or lower bound any further increase (or decrease) in its value
makes one of the updated righthand sides negative.
Consider that bk is such that b r + rk bk < 0.
The basic variable in row r leaves the basis, and we must pivot in row r of the final tableau to find
the variable to be introduced in its place.
Since pivoting subtracts a multiple t of the pivot row from the objective equation, the new
objective equation has coefficients c j tarj (j = 1, 2, . . . , n).
For the basis to be optimal, each of these coefficients must be nonpositive. Since c j = 0 for the
basic variable being dropped and since its coefficient in constraint r is arj = 1, we must have
t 0.
For any t 0, the updated coefficient c j tarj for any other variable remains 0 if arj 0.
Consequently we need only to consider arj < 0, and t is given by:
t = Minj
nc
arj
o
| arj < 0
The index u giving this minimum has c u taru = 0, and the corresponding variable xu can
become the new basic variable in row r by pivoting on aru .
Note that the pivot is made on a negative coefficient.
(FEUP | DEGI)
Operations Research
30 / 35
If one or more of the reduced costs are zero, there may exist
alternative optimal solutions.
(FEUP | DEGI)
Operations Research
31 / 35
If one or more of these values are zero, then there may exist
alternative optimal shadow prices.
(FEUP | DEGI)
Operations Research
32 / 35
xVP
xA
xF
s1
s2
s3
xVP
5
8
1
32
3
16
40
s2
78
3
32
7
16
60
xA
5
8
3
160
5
16
48 34
7
16
9 38
2480
Since the righthand-side value in row 3 is zero, it is possible to take xA (basic variable in row 3)
out of the basis as long as there is a variable to introduce into the basis.
The candidates to be introduced
the basis are xF , s1 and s3 , the one that corresponds to:
7 into
nc
o
16
s1 will enter the basis.
Minj a j | arj < 0 = Min
3
rj
(FEUP | DEGI)
160
Operations Research
33 / 35
Coefficient
Coefficient
Coefficient
Coefficient
for
for
for
for
xVP
1
xA
0
xF
s1
xVP
5
8
1
32
s2
0
s3
3
16
40
s2
78
3
32
7
16
60
xA
5
8
3
160
5
16
0
t
48 34
t 58
7
16
3
+t 160
9 38
5
t 16
2480
t 0
XA : t 0 t 0
XF : 48 43 t 58 0 t 288
5
7
3
s1 : 16
+ t 160
0 t 70
3
3
5
s3 : 9 8 t 16 0 t 30
0t
(FEUP | DEGI)
70
3
Operations Research
34 / 35
Since the coefficient of s1 is most constraining on t, s1 will enter the basis and the new tableau
will be the following1 :
xVP
1
xA
xF
xVP
5
3
3
2
s1
0
s2
0
s3
17
24
40
s2
9
8
60
s1
160
3
100
3
50
3
70
3
190
3
50
3
2480
In this example we have for the same optimal solution alternative shadow prices.
The optimal solution is (xvp , xA , xF , s1 , s2 , s3 ) = (40, 0, 0, 0, 60, 0) and the shadow prices are:
(yO1 , yW 1 , yD1 ) = (48 43 , 0, 9 38 ) and (yO2 , yW 2 , yD2 ) = (0, 0, 50
)
3
1
In order to obtain the alternative shadow prices there would be no need to built the whole tableau, the line of
the objective function would be sufficient as you may see.
(FEUP | DEGI)
Operations Research
35 / 35