Contents  |  ‹ Previous  |  Next ›  |  Download EPUB  |  PDF

Chapter 10
Sensitivity Analysis

Learning Outcomes

Try it out visually!

Sensitivity Analysis Walkthrough: shadow prices, allowable ranges, and reduced costs derived step by step.

Duality and Sensitivity Explorer: change the data and watch the optimal solution and shadow prices respond.

Your bakery’s production plan is set, and the profit works out to $23. Then the phone rings twice. A neighboring shop offers to rent you one more hour of oven time; a supplier offers a deal on extra flour. Should you take either offer, and what is the most you would pay? Sensitivity analysis answers before you spend a dime: the extra hour would raise your profit by exactly $1, while the extra flour is worth nothing to you at all: you already have three units you aren’t using.

Every resource in a linear program has a price tag like this, telling you what one more unit of it is worth to your bottom line, and every such price tag comes with an expiration: it is only valid until the data move far enough that the optimal plan itself changes. Solving a linear program answers one question about one set of numbers. In practice the numbers (objective coefficients, resource limits) are estimates: prices move, machines break, a supplier delivers more flour than promised. Sensitivity analysis asks how the optimal solution and the optimal value respond when the data change, and how far the data can move before the answer changes structurally. All of this, including both claims in the story above, can be read from the final simplex dictionary, which is why optimization software such as Excel Solver reports it alongside the solution.

We return to the linear program solved by dictionaries in Chapter 7 and by tableaus in Chapter 9,

max z = 2x + 3y  s.t.  x + y 9 (hours) 2x + y 16(flour) x + 2y 14(sugar) x,y 0,

so that every range we compute here can be checked against the dictionaries and tableaus computed there. After applying the simplex method, we obtain the following optimal dictionary:

max z = 23 s1 s3  s.t.  x = 4 2s1 + s3, y = 5 + s1 s3, s2 = 3 + 3s1 s3, x,y,s1,s2,s3 0.

The current basis is B = {x,y,s2}, with nonbasic variables N = {s1,s3}.

The optimal solution is:

(x,y,s2,s1,s3) = (4,5,3,0,0)withz = 23.

Before any algebra, build intuition by dragging the right-hand sides and the objective slope in the Desmos sensitivity explorer (backup interactive explorer) and watching when the optimal vertex jumps to a different corner of the feasible region.

10.1 What can change, and what happens

Three kinds of data appear in a linear program: the objective coefficients c, the right-hand sides b, and the constraint matrix A. Before computing exact ranges, it is worth understanding qualitatively how each one enters the final dictionary.

10.1.1 Changing an objective coefficient ci

The objective row of the revised dictionary is

z = cBA B1b + (c Nc BA B1A N)xN,

where the coefficients of xN, namely cNcBAB1AN, are the reduced costs. A change in ci lands in one of two places. If i is a basic variable, then ci sits inside cB, so it moves the constant term cBAB1b: the optimal value changes linearly in ci for as long as the basis stays optimal. If i is a nonbasic variable, then ci appears only in its own reduced cost: the current solution and objective value do not move at all until the change is large enough to flip the sign of that reduced cost, at which point variable i wants to enter the basis and the current dictionary is no longer optimal.

10.1.2 Changing a right-hand side bi

The basic solution is xB = AB1b, so a change in b moves the basic variables directly. Small changes rescale xB while keeping it nonnegative, and the objective value z = cBAB1b moves linearly along with it. A large enough change drives some basic variable negative: the dictionary becomes infeasible, and restoring feasibility requires a pivot to a different basis (or reveals that the problem has become infeasible altogether).

10.1.3 Changing a constraint coefficient aij

Geometrically, changing aij tilts the corresponding constraint, reshaping the feasible region. Algebraically, the effect depends on which column is touched. If column j is nonbasic, then AB1 is untouched; only the reduced cost of variable j changes, and the current solution survives unless that reduced cost changes sign. If column j is basic, the change alters AB itself, and since the entire dictionary is built from AB1, even a small change can move the basic solution, every reduced cost, and the optimal value all at once.

10.1.4 Summary

Change Basic solution Objective value Basis change when…
ci (objective) unchanged moves if i basic a reduced cost changes sign
bi (RHS) always moves moves linearly a basic variable hits 0
aij (matrix) moves if j basic via reduced costs feasibility or optimality breaks
Table 10.1: Effect of each type of data change on the basic solution and the objective value.

In the remainder of the chapter we make these statements quantitative for the running example: for each parameter we compute the exact range of values over which the current basis B = {x,y,s2} remains optimal, and how z moves inside that range. We treat the right-hand sides first, then the objective coefficients, then redo both computations in matrix notation.

10.2 Ranging the right-hand side

In standard form, a linear program is written as Ax = b,x 0. We perturb one entry of b at a time, holding the objective coefficients and constraint matrix fixed, and answer three questions:

1.
For which changes in the RHS does the current basis remain optimal?
2.
How does the optimal solution vary with these changes?
3.
How does the objective value change?

Each case follows the same three moves: perturb the standard form, adapt the final dictionary, and read off the range.

10.2.1 Perturbing b2: A Basic Slack Variable

The second constraint (corresponding to slack variable s2) originally has RHS value b2 = 16. We now perturb this to 16 + Δ, where Δ , and investigate the effect.

Perturbed Standard Form (RHS of Constraint 2)

max 2x + 3y  s.t.  x + y + s1 = 9 (hours) 2x + y + s2 = 16 + Δ(flour) x + 2y + s3 = 14 (sugar) x,y,s1,s2,s3 0

To isolate the effect of Δ, define a new variable:

s2 := s2 + Δ s 2 = s 2 Δ.

Substituting into the system yields:

max 2x + 3y  s.t.  x + y + s1 = 9 2x + y + s2 = 16 + Δ 2x + y + s2 = 16 x + 2y + s3 = 14 x,y,s1,s2,s 3 0

 Adapt the final dictionary.  Since the structure of the problem remains the same in terms of the new variable s2, we can substitute into the final dictionary:

max z = 23 s1 s3  s.t.  x = 4 2s1 + s3 y = 5 + s1 s3 s2 = 3 + 3s 1 s3 s2 Δ = 3 + 3s1 s3 x,y,s1,s2,s 3 0

Only the row of s2 is affected: s2 = (3 + Δ) + 3s1 s3.

 Read off the range.  To remain optimal, the dictionary must still satisfy feasibility: all basic variables must remain nonnegative when s1 = s3 = 0. Only s2 depends on Δ, so:

s2 = 3+Δ 0Δ 3 b2 13.

Since s2 is a slack variable, the objective value z = 23 does not move at all inside this range. Beyond it, s2 < 0 and the current dictionary becomes infeasible, triggering a new pivot in the simplex method.

10.2.2 Perturbing b1: A Nonbasic Slack Variable

The first constraint corresponds to slack variable s1, which is currently nonbasic and set to 0 in the optimal solution. Its original right-hand side is b1 = 9. We now perturb it to 9 + Δ, where Δ , and examine how this affects the dictionary.

Perturbed Standard Form (RHS of Constraint 1)

max 2x + 3y  s.t.  x + y + s1 = 9 + Δ(hours) 2x + y + s2 = 16 (flour) x + 2y + s3 = 14 (sugar) x,y,s1,s2,s3 0

To isolate the effect of Δ, define a new variable:

s1 := s1Δ s 1 = s 1 + Δ.

Substituting into the system yields:

x + y + s1 = 9 + Δ x + y + (s1Δ) = 9 + Δ x + y + s1 = 9

So the perturbed system is equivalent to the original, but now expressed in terms of s1.

 Adapt the final dictionary.  We substitute s1 = s1Δ into the optimal dictionary:

max z = 23 s1 s3 = 23 (s1Δ) s 3 = (23 + Δ) s1 s 3 x = 4 2s1 + s3 = 4 2(s1Δ) + s 3 = (4 + 2Δ) 2s1 + s 3 y = 5 + s1 s3 = 5 + (s1Δ) s 3 = (5 Δ) + s1 s 3 s2 = 3 + 3s1 s3 = 3 + 3(s1Δ) s 3 = (3 3Δ) + 3s1 s 3

 Read off the range.  To ensure the basis remains feasible, set s1 = s3 = 0 and check that the basic variables remain nonnegative:

x = 4 + 2Δ,y = 5 Δ,s2 = 3 3Δ.

Feasibility conditions:

x 0 Δ 2 y 0 Δ 5 s2 0 Δ 1

Thus, all conditions are satisfied when:

2 Δ 1 7 b1 10.

Within this range, the objective value changes linearly as z = 23 + Δ. Outside this range, one or more basic variables becomes negative, and the current solution becomes infeasible, prompting a new pivot in the simplex method.

10.2.3 Perturbing b3: Another Nonbasic Slack Variable

The third constraint corresponds to slack variable s3, which is currently nonbasic and equal to 0 in the optimal solution. Its original right-hand side is b3 = 14. We now perturb it to 14 + Δ, where Δ , and examine how this affects the dictionary.

Perturbed Standard Form (RHS of Constraint 3)

max 2x + 3y  s.t.  x + y + s1 = 9 (hours) 2x + y + s2 = 16 (flour) x + 2y + s3 = 14 + Δ(sugar) x,y,s1,s2,s3 0

To isolate the effect of Δ, define a new variable:

s3 := s3Δ s 3 = s 3 + Δ.

Substituting into the system yields:

x + 2y + (s3Δ) = 14 + Δ x + 2y + s 3 = 14.

So the perturbed system returns to the original structure but in terms of s3.

 Adapt the final dictionary.  Substitute s3 = s3Δ into the optimal dictionary:

max z = 23 s1 s3 = 23 s1 (s3Δ) = (23 + Δ) s 1 s3 x = 4 2s1 + s3 = 4 2s1 + (s3Δ) = (4 Δ) 2s 1 + s3 y = 5 + s1 s3 = 5 + s1 (s3Δ) = (5 + Δ) + s 1 s3 s2 = 3 + 3s1 s3 = 3 + 3s1 (s3Δ) = (3 + Δ) + 3s 1 s3

 Read off the range.  Now test feasibility at the basic solution s1 = s3 = 0:

x = 4 Δ,y = 5 + Δ,s2 = 3 + Δ.

Feasibility requires:

x 0 Δ 4 s2 0 Δ 3

Thus, the allowable range for Δ is:

3 Δ 4 11 b3 18.

Within this range, the objective value changes linearly as z = 23 + Δ. Outside this range, x < 0 or s2 < 0, and the dictionary becomes infeasible.

Recipe: RHS Ranging in the Dictionary

Perturb Replace bi by bi + Δ and absorb Δ into the constraint’s slack variable: si = si + Δ restores the original right-hand side.

Substitute Rewrite the optimal dictionary in terms of si; only the constant column changes, each constant shifting by a multiple of Δ.

Impose feasibility Require every basic variable 0 at xN = 0; each row gives one linear inequality in Δ.

Read the range Intersect the inequalities. Inside the range, z changes linearly in Δ; at an endpoint a basic variable hits 0, and any further change triggers a pivot.

Remark. Shadow Prices The rate at which z changes with bi is called the shadow price of constraint i. For the binding constraints we found z = 23 + Δ: an extra hour or an extra unit of sugar is worth exactly 1 in objective value, as long as Δ stays within its allowable range. For the non-binding flour constraint ( s2 = 3 > 0), the objective did not move at all: its shadow price is 0. This settles both phone calls from the start of the chapter: pay up to $1 for the extra oven hour (and no more than $1 total for up to one extra hour, since the price expires at b1 = 10), and politely decline the flour. Shadow prices are the central objects of the next chapter, where they reappear as the variables of the dual linear program (Chapter 11).

Learning Checkpoint 10.2.1

The optimal dictionary gives z = 23 + Δ when b1 = 9 + Δ. What is the shadow price of constraint 1, and over what range of b1 is that price valid? What happens to the shadow price at b1 = 10?

10.3 Ranging the objective coefficients

We now examine how changes to the objective function coefficients affect the optimality of the current basis. In the original problem, the objective is:

max 2x + 3y.

We now perturb these coefficients to:

max (2 + δ1)x + (3 + δ2)y,

where δ1,δ2 . Recall the final dictionary:

z = 23 s1 s3 x = 4 2s1 + s3 y = 5 + s1 s3 s2 = 3 + 3s1 s3,

with basis B = {x,y,s2} and nonbasic variables N = {s1,s3}. Unlike an RHS change, a cost change never threatens feasibility (the solution stays where it is), but it can destroy optimality by making a reduced cost positive.

10.3.1 Perturbing c1: Objective Coefficient of x

 Adapt the final dictionary.  Let c1 = 2 + δ1. Since x is basic, we express the extra term δ1x in terms of the nonbasic variables using the dictionary row for x:

z = 23 + δ1 x = 23 + δ1(4 2s1 + s3) = (23 + 4δ1) + (2δ1)s1 + δ1s3.

Adding to the original dictionary z = 23 s1 s3, we obtain:

z = (23 + 4δ1) + (1 2δ1)s1 + (1 + δ1)s3.

 Read off the range.  To maintain optimality, the reduced costs of nonbasic variables s1 and s3 must remain 0. Thus:

1 2δ1 0 δ1 1 2, 1 + δ1 0 δ1 1.

So the allowable range for δ1 is:

1 2 δ1 1 1.5 c1 3.

Within this range, the objective value changes linearly as z = 23 + 4δ1.

10.3.2 Perturbing c2: Objective Coefficient of y

 Adapt the final dictionary.  Let c2 = 3 + δ2. Since y is also basic, the perturbed objective becomes:

z = 23 + δ2 y = 23 + δ2(5 + s1 s3) = (23 + 5δ2) + δ2s1 δ2s3.

Adding to the original dictionary z = 23 s1 s3, we obtain:

z = (23 + 5δ2) + (1 + δ2)s1 + (1 δ2)s3.

 Read off the range.  To maintain optimality:

1 + δ2 0 δ2 1, 1 δ2 0 δ2 1.

So the allowable range for δ2 is:

1 δ2 1 2 c2 4.

Within this range, the objective value changes linearly as z = 23 + 5δ2.

10.3.3 Summary

Perturbed coefficient Allowed range Effect on objective
c1 = 2 + δ1 1.5 c1 3 z = 23 + 4δ1
c2 = 3 + δ2 2 c2 4 z = 23 + 5δ2
Table 10.2: Allowed perturbation ranges and their effect on the objective value.

Outside these ranges, the reduced costs of nonbasic variables become positive, violating optimality. In such cases, the simplex method would require a new pivot.

Recipe: Objective-Coefficient Ranging in the Dictionary

Perturb Replace ci by ci + δ. If variable i is nonbasic, only its own reduced cost shifts by δ; skip to the last step.

Substitute If variable i is basic, express the extra term δxi in terms of the nonbasic variables using the dictionary row for xi, and add it to the objective row.

Impose optimality Require every reduced cost 0 (for a maximization problem); each nonbasic variable gives one linear inequality in δ.

Read the range Intersect the inequalities. Inside the range the solution does not move, and z changes linearly if i is basic (not at all if i is nonbasic).

Learning Checkpoint 10.3.1

Changing the objective coefficient of a nonbasic variable never changes the current optimal solution, but changing it enough can still change the optimal basis. Reconcile these two statements.

10.4 Sensitivity with Matrix Notation

The dictionary manipulations above can be organized with matrices, which is how software carries them out. Writing the running example in standard form,

max cx  s.t.  Axx + Is = b, x,s 0, whereAx = [ 1 1 2 1 1 2 ],x = [ x y ],s = [ s1 s2 s3 ] .

Let the basic variables be xB = [ x y s2 ] , and the non-basic variables be xN = [ s1 s3 ] . Then the dictionary can be written as:

xB = b A Nx N,

where:

b = [ 4 5 3 ],AN = [ 2 1 1 1 3 1 ].

Thus, explicitly:

[ x y s2 ] = [ 4 5 3 ] [ 2 1 1 1 3 1 ] [ s1 s3 ] .

or equivalently

[ x y s2 ] = [ 4 5 3 ]+s1 [ 2 1 3 ]+s3 [ 1 1 1 ].

The basis matrix is

AB = [ 1 1 0 2 1 1 1 2 0 ] and AB1 = [ 2 0 1 1 0 1 3 1 1 ].

Remark. Recovering AB1

A(x,s) = [ 1 0 2 0 1 0 1 1 0 1 0 0 3 1 1 ] [ x y s1 s2 s3 ] = [ 4 5 3 ]

Partitioning into basic variables x = (x,y) and slack variables s = (s1,s2,s3), we write:

Axx+Ass = bwhereAx = [ 1 0 0 1 0 0 ],As = [ 2 0 1 1 0 1 3 1 1 ],b = [ 4 5 3 ]

Hence, since the slack columns came from the identity matrix in the original A, we conclude:

As = AB1

10.4.1 Ranging b1 with the Basis Inverse

We modify the right-hand side of the first constraint and analyze its impact on feasibility:

b [ b1 16 14 ].

Step 1 — Update the basic solution.  Using the inverse basis matrix AB1, the basic solution is xB = AB1b:

AB1b = [ 2 0 1 1 0 1 3 1 1 ] [ b1 16 14 ] = [ 2b1 14 b1 + 14 3b1 + 30 ].

Step 2 — Impose feasibility.  Ensuring that all basic variables remain non-negative:

[ 2b1 14 b1 + 14 3b1 + 30 ] [ 0 0 0 ] [ b1 14 10 ] [ 7 b 1 b1 ] .

Step 3 — Read the range. 

7 b1 10

is the feasible range for b1 that preserves the optimal basis, matching the range 2 Δ 1 found with the dictionary in Section 10.2.

The figure below shows the constraint x + y b1 drawn for the three values b1 = 7,9,10.

Feasible region shaded blue with vertices (0,0), (0,7), (4,5), (7,2), (8,0); parallel red level lines x+y=7, x+y=9, and x+y=10 sweep across the region, with a green line 2x+y=16 and a brown line showing a modified constraint.

10.4.2 Ranging cx via Reduced Costs

To determine the range of values for cx (the coefficient of x in the objective function) such that the current basis remains optimal, we analyze the simplex optimality conditions.

Step 1 — Set up the reduced costs.  The objective function is initially:

z = 2x + 3y.

The cost vector for all variables is:

c = [ cx 3 0 0 0 ].

The cost vector corresponding to the basic variables x,y,s2 (i.e., the basis) is:

cB = [ cx 3 0 ].

The reduced cost for any non-basic variable j is given by:

c¯j = cj cBAB1A j.

The non-basic variables are s1 and s3. We need to ensure that their reduced costs remain non-positive.

Step 2 — Compute the reduced costs for s1 and s3.  The constraint matrix is:

A = [ 1 1 1 0 0 2 1 0 1 0 1 2 0 0 1 ].

Extracting the columns corresponding to s1 and s3:

As1 = [ 1 0 0 ],As3 = [ 0 0 1 ].

Using the inverse basis matrix:

AB1A s1 = [ 2 0 1 1 0 1 3 1 1 ] [ 1 0 0 ] = [ 2 1 3 ].
AB1A s3 = [ 2 0 1 1 0 1 3 1 1 ] [ 0 0 1 ] = [ 1 1 1 ].

Thus, the reduced costs are:

c¯s1 = 0 [ cx 3 0 ] [ 2 1 3 ] = 0(2cx3).
c¯s3 = 0 [ cx 3 0 ] [ 1 1 1 ] = 0(cx+3).

Step 3 — Read the range.  To retain optimality, we want c¯s1 and c¯s3 to be 0:

2cx + 3 0 cx 3 2 = 1.5,
cx 3 0 cx 3.

For the current basis to remain optimal, cx must satisfy:

1.5 cx 3 ,

matching the range found with the dictionary in Section 10.3.

Sensitivity analysis visualization showing how the optimal solution changes as objective function coefficients vary.

Figure 10.1: Feasible region in the x-y plane with several level curves of the objective z = c_x x + 3y drawn...

10.5 Sensitivity Reports in Software

When solving a problem in Excel, you can ask for a sensitivity analysis.

A Microsoft Excel Solver Results dialog box showing a successful optimization, with options to keep the solution or restore original values, and report type selections.

Figure 10.2: Screenshot of Excel’s Solver Results dialog with the option to generate a Sensitivity report...

This will generate a report that will show the following:

These are exactly the quantities computed by hand in Sections 10.2 and 10.3: the allowable increase/decrease columns are the ranges from the two recipe cards, and the shadow prices are the rates from the Shadow Prices remark.

For concreteness, the figures below show a worksheet set up for Solver and the sensitivity report it produces. Figure 10.3 shows the model layout — decision-variable cells, a SUMPRODUCT objective cell, and the constraint formulas — and Figure 10.4 shows the resulting report, with the allowable ranges, shadow prices, and binding status described above.

An Excel spreadsheet setup for a linear programming problem with decision variables in yellow cells. Constraints are defined with coefficients, totals, and right-hand side values.

Figure 10.3: An Excel worksheet laid out for Solver, with decision-variable cells, a SUMPRODUCT objective, and constraint formulas.

A Microsoft Excel Solver sensitivity analysis report showing Variable Cells and Constraints sections with columns for Final Value, Reduced Cost, and Shadow Price.

Figure 10.4: The Solver sensitivity report: variable cells (final value, reduced cost, objective coefficient, allowable increase/decrease) and constraints (final value, shadow price, RHS, allowable increase/decrease).

10.6 Exercises

Warm-ups

Exercise 10.1: Shadow Prices from the Final Dictionary

  Recall the final dictionary of the running example of this chapter:

z = 23 s1 s3 x = 4 2s1 + s3 y = 5 + s1 s3 s2 = 3 + 3s1 s3.

1.
Read off the shadow price of each of the three constraints (hours, flour, sugar) directly from the objective row.
2.
Which constraint is not binding at the optimum? How can you see this in the dictionary, and how is it reflected in that constraint’s shadow price?
3.
The bakery is offered one extra unit of sugar for $0.75. Should it accept? What is the most it should pay?

10.2]

Exercise 10.2: RHS Sensitivity Range

  Consider the following linear program and its optimal dictionary:

max 4x1 + 3x2  s.t.  x1 + x2 10 2x1 + x2 16 x1,x2 0

The optimal dictionary is:

z = 36 2s1 s2 x1 = 6 + s1 s2 x2 = 4 2s1 + s2

with basis B = {x1,x2} and nonbasic variables N = {s1,s2}.

Determine the range of values for b1 (the RHS of the first constraint) for which the current basis remains optimal.

10.2]

Core problems

Exercise 10.3: Objective Coefficient Sensitivity

  Using the same linear program and optimal dictionary as in Exercise 10.2, determine the range of values for the objective coefficient c1 (the coefficient of x1 in the objective function) such that the current basis remains optimal. How does the optimal objective value change as c1 varies within this range?

10.3]

Exercise 10.4: Full Sensitivity Workup

  A shop assembles two products with profits $5 and $6 per unit:

max 5x1 + 6x2  s.t.  x1 + 2x2 16(assembly hours) 3x1 + 2x2 24(machine hours) x1,x2 0

1.
Solve the LP (graphically or by the simplex method) and report the optimal solution and objective value.
2.
Compute the shadow price of each constraint.
3.
Find the allowable range of b1 and of b2 over which the current basis remains optimal, and state how z changes inside each range.
4.
Find the allowable range of c1 and of c2 over which the current basis remains optimal.
5.
Check your answers with software (for example scipy.optimize.linprog or Excel Solver).

10.2, §10.3, §10.4]

Exercise 10.5: Ranging a Basic and a Nonbasic Coefficient

  Consider the LP

max 5x1 + 2x2  s.t.  2x1 + x2 10 x1 + 3x2 15 x1,x2 0,

whose optimal solution is (x1,x2) = (5,0) with z = 25 and basis B = {x1,s2}.

1.
Verify that (5,0) is optimal by computing the reduced costs of the nonbasic variables x2 and s1.
2.
Find the range of the coefficient c2 of the nonbasic variable x2 for which the current basis remains optimal. How does z change as c2 moves inside this range?
3.
Find the range of the coefficient c1 of the basic variable x1 for which the current basis remains optimal. How does z change inside this range?
4.
Explain the structural difference between the two cases: why does one range have a single finite endpoint driven by one reduced cost, while the other involves every reduced cost?

10.3, §10.1]

Exercise 10.6: Sensitivity from the Basis Inverse

  Consider the LP:

max 5x1 + 4x2  s.t.  x1 + x2 + s1 = 6 3x1 + 2x2 + s2 = 15 x1,x2,s1,s2 0

The optimal basis is B = {x1,x2} with basis matrix and its inverse:

AB = [ 1 1 3 2 ],AB1 = [ 2 1 3 1 ].

1.
Compute xB = AB1b and verify this gives a feasible basic solution.
2.
For the RHS vector b = [ 6 15 ], find the range of b1 for which the current basis remains feasible.
3.
Compute the reduced costs of the nonbasic variables. For what range of c1 does the current basis remain optimal?

10.4]

Exercise 10.7: Reading a Sensitivity Report

  The following is a sensitivity report from Excel Solver for a maximization LP with two decision variables x1 and x2 and three constraints:

Variable Value Obj. Coeff. Allow. Increase Allow. Decrease
x1 8 6 2 3
x2 4 5 4 1
Table 10.3: Variable section of the Solver sensitivity report.

Constraint Shadow Price RHS Allow. Increase Allow. Decrease
1 2.5 20 4 6
2 0 30 5
3 1.0 12 3 2
Table 10.4: Constraint section of the Solver sensitivity report.

1.
What is the current optimal objective value?
2.
If the objective coefficient of x1 changes from 6 to 7.5, does the optimal basis change?
3.
Which constraint is non-binding? How can you tell from the report?
4.
If 2 additional units of the first resource become available (RHS increases from 20 to 22), what is the new approximate optimal objective value?

10.5]

Concepts and connections

Exercise 10.8: Shadow Price Interpretation

  A furniture workshop produces tables and chairs. The linear program is:

max 50x1 + 30x2(profit in dollars)  s.t.  4x1 + 2x2 40(wood in board-feet) 2x1 + 3x2 30(labor in hours) x1,x2 0

The optimal solution is x1 = 7.5, x2 = 5, with optimal profit z = 525. The dual solution is y1 = 11.25, y2 = 2.50.

1.
Interpret each shadow price in terms of the resources (wood and labor).
2.
If the workshop could acquire 2 additional board-feet of wood, by approximately how much would the optimal profit increase?
3.
Which resource is more valuable at the margin? Explain.

10.2]

Exercise 10.9: Why a Slack Constraint Has Price Zero

  Explain, in your own words, why a constraint that is not binding at the optimal solution must have shadow price 0. Give two arguments:

1.
A geometric or economic argument: what happens to the optimal solution when you add a little more of a resource you are not fully using?
2.
A dictionary argument: if the slack variable of constraint i is basic and positive in the final dictionary, why does perturbing bi by a small Δ leave the objective row unchanged? (The perturbation of b2 in §10.2 is a worked instance.)

10.2, §10.1]

Exercise 10.10: Why Ranges Exist at All

  Every quantity in a sensitivity report comes with an allowable range. Explain why.

1.
What single object stays fixed throughout a sensitivity computation, and what two kinds of conditions (one for RHS changes, one for cost changes) must it continue to satisfy?
2.
Why is the effect of a data change on z linear inside the range?
3.
What happens, in terms of the simplex method, the moment a perturbation crosses an endpoint of its range?

10.1, §10.2, §10.3]

Exercise 10.11: When the Shadow Price Prediction Breaks

  Consider the LP

max x1 + x2 s.t. x1 1,x2 1,x1 + x2 2,x1,x2 0,

whose optimal solution is (1,1) with z = 2. Note that all three constraints are tight there, but only two of them are needed to define the vertex: the optimal solution is degenerate.

1.
Show that increasing b3 from 2 to 3 does not change z, while decreasing b3 from 2 to 1 decreases z by 1.
2.
What, then, is “the” shadow price of the third constraint? Explain informally why a single number cannot describe both directions here.
3.
Why should you be cautious when reading the shadow price of a degenerate LP from a solver report?

10.2, §10.5]

Challenge problems

Exercise 10.12: Pushing Past the Range

  Construct a linear program with a constraint whose shadow price is some p > 0 such that increasing the right-hand side of that constraint by 1 increases the optimal value by exactly p, but increasing it by 5 increases the optimal value by strictly less than 5p. Explain what happens at the boundary of the allowable range that makes the prediction fail, and verify your construction by solving the perturbed LPs. (Hint: the running example of this chapter already contains such a constraint.)

10.2, §10.1]

Selected Solutions

Solution

(Exercise 10.4)

1.
Both constraints are binding at the optimum: solving x1 + 2x2 = 16 and 3x1 + 2x2 = 24 gives (x1,x2) = (4,6) with z = 5(4) + 6(6) = 56.
2.
The basis is B = {x1,x2} with
AB = [ 1 2 3 2 ],AB1 = [ 1 2 1 2 3 4 1 4 ] ,

so the shadow prices are y = cBAB1 = [5,6]AB1 = [2,1]: an assembly hour is worth $2 and a machine hour $1.

3.
With b = (b1,24), feasibility of xB = AB1b = (b1 2 + 12,3b1 4 6) 0 gives 8 b1 24, with z = 56 + 2(b1 16) inside the range. With b = (16,b2), feasibility of (b2 2 8,12 b2 4 ) 0 gives 16 b2 48, with z = 56 + (b2 24).
4.
With cB = (c1,6) the dual prices are (c1 2 + 9 2,c1 2 3 2 ); both nonnegative exactly when 3 c1 9. With cB = (5,c2) the dual prices are (3c2 4 5 2,5 2 c2 4 ), giving 10 3 c2 10.
5.
Software confirms: at b1 = 8 the solution is (8,0) with z = 40 = 56 + 2(8), at b1 = 24 it is (0,12) with z = 72 = 56 + 2(8), and just outside these values the duals change, signaling a new basis.

Solution

(Exercise 10.6)

1.
xB = AB1b = [ 2 1 3 1 ] [ 6 15 ] = [ 3 3 ],

so (x1,x2) = (3,3) 0 is a feasible basic solution with objective value z = 5(3) + 4(3) = 27.

2.
Replacing b1 by a variable value,
xB(b1) = AB1 [ b1 15 ] = [ 2b1 + 15 3b1 15 ] 05 b1 7.5.
3.
The dual prices are y = cBAB1 = [5,4]AB1 = [2,1], so the reduced costs of the nonbasic slacks are c¯s1 = y1 = 2 and c¯s2 = y2 = 1; both are nonpositive, confirming optimality (equivalently, z = 27 2s1 s2). With c1 variable, y(c1) = [c1,4]AB1 = [2c1 + 12,c1 4], and the basis stays optimal while both components are nonnegative:
2c1 + 12 0 and c1 4 04 c1 6.

Solution

(Exercise 10.8) At the optimal solution (x1,x2) = (7.5,5) both constraints are binding: 4(7.5) + 2(5) = 40 and 2(7.5) + 3(5) = 30.

1.
The shadow price of wood is y1 = 11.25: one additional board-foot of wood increases the optimal profit by $11.25 (as long as the basis does not change). The shadow price of labor is y2 = 2.50: one additional hour of labor is worth $2.50 at the margin.
2.
Two additional board-feet increase profit by approximately 2 × 11.25 = $22.50, from $525 to $547.50. (This is exact here: the wood RHS can range from 20 to 60 before the basis changes, and 42 is well inside that range.)
3.
Wood is more valuable at the margin, since 11.25 > 2.50: a unit of wood buys more additional profit than a unit of labor.

Solution

(Exercise 10.12) The running example of this chapter works. Its hours constraint x + y 9 has shadow price p = 1, valid for 7 b1 10 (allowable increase 1). Increasing b1 by 1 to 10 raises the optimal value from 23 to 24, exactly p. Increasing b1 by 5 to 14 raises it only to 24, not to 23 + 5 = 28: solving the LP with b1 = 14 gives the optimum (x,y) = (6,4) determined by the flour and sugar constraints, and z = 2(6) + 3(4) = 24. At the range boundary b1 = 10 the basic variable s2 hits 0 and the basis changes; beyond it the hours constraint is no longer binding, so its shadow price drops to 0 and further increases in b1 buy nothing. In general, the optimal value is a piecewise-linear concave function of b1, and the shadow price is only its slope on the current piece.

© 2026 Robert Hildebrand and contributors · Licensed CC BY-SA 4.0 · Sources and attribution · Book home