Back to the on-screen lesson ·

Sensitivity analysis

Shadow prices with their ranges, what a zero price means, and which inputs the answer actually depends on.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to read a sensitivity report: use a shadow price with its validity range to decide whether more of a resource is worth buying, say why the price changes at the end of that range, and read a zero price as the finding that a constraint is not binding. You will also be able to use objective coefficient ranges to say which uncertain inputs deserve better measurement, and to recognise a degenerate solution where the reported price is not unique.

2. What you already have

Multipliers as prices, from lessons 11 and 12: the rate at which the optimum improves per unit of loosened constraint. This lesson is what to do with them, and the single most useful thing in the course for somebody who has to act on a model's answer.

3. The answer is a point; the report is a derivative

The optimum answers one question — what to do. A sensitivity report answers the questions people actually ask next: what if we had more?, what if that cost estimate is wrong?, what is worth negotiating?

Shadow price. The multiplier on a constraint is the rate at which the optimal value improves per unit of right-hand side. A binding constraint with price $3$ means one more unit is worth about $3$.

The validity range. The price is a derivative, and it holds only while the same constraints are binding. As the right-hand side moves, the optimal vertex slides along an edge; at some point another constraint becomes tight and the vertex turns a corner, and the rate changes. So a sensitivity report always gives a range as well as a number, and using a price outside its range is the commonest way this analysis is misused.

A zero price is a finding. A non-binding constraint has price zero: there is slack, so more of it buys nothing. In a model with forty constraints, typically a handful have non-zero prices — and that short list is the whole of what can be acted on. The zeros say where money is not worth spending, which is as useful.

Objective coefficient ranges. The other half of a report: how far a cost or profit coefficient can move before the optimal plan itself changes. A coefficient known only roughly, but whose range is wide, is not worth measuring better. One whose range is narrow is where a measurement error becomes a wrong decision.

Another way: picture

The feasible polygon with one constraint line sliding outwards. The optimal corner travels along an edge as it slides, and the objective improves at a steady rate — the shadow price. When the corner reaches the end of that edge, another constraint takes over and the rate changes. The length of the edge is the validity range.

Another way: steps

To read a sensitivity report:

  1. List the constraints with non-zero prices. That is the bottleneck list, and it is short.
  2. For each, compare the price with what a unit actually costs to obtain. A price above the cost is money on the table.
  3. Check the validity range before acting — a price is only good for so many units.
  4. Look at the objective coefficient ranges. Narrow ranges mark the inputs worth measuring better.
  5. Report the zeros too. "These six constraints are not binding" is an actionable sentence.

4. A price with a range, used correctly

A workshop's machine-hour constraint has shadow price $3$ and a validity range of $6$ extra hours. Overtime costs $2$ per hour.

Within the range: each hour is worth $3$ and costs $2$, so it nets $1$. Buying all $6$ nets $6$.

Past the range: at $+6$ another constraint becomes binding — perhaps finishing capacity — and the price drops, possibly to zero. Buying a seventh hour may net nothing at all.

So the recommendation is precise: buy six hours of overtime, not more, and re-solve before buying any beyond that. Note that the optimum by itself supports none of this. The price and its range are what turn an answer into advice.

5. Where this goes wrong

Extrapolating past the range. "The price is $3$, so $100$ more hours is worth $300$" — almost certainly false, and the error is unbounded.

Reading a zero as a failure. It is a measurement: this constraint is not binding. Acting on it means not spending money here.

Using prices from a degenerate solution. When more constraints are tight than there are variables, the price is not unique and different solvers report different valid values. A report that changes when the solver does is a sign of this.

Applying prices to an integer program. LP duality does not carry over: there is no shadow price in the same sense, and the numbers a solver reports for a relaxation are about the relaxation.

6. A shadow price is a rate, and rates expire

The number looks like a value — "this constraint is worth 3" — and gets quoted as one, detached from its range. It is a derivative, and a derivative of a piecewise-linear function at that: it is exactly right over an interval and exactly wrong past the end of it, with no gradual degradation to warn you. The discipline is to quote the range with the number every single time, in the same sentence, so that nobody can carry the price away on its own. A report that says "worth 3, for up to 6 more units" cannot be misused in the way that "worth 3" routinely is.

7. Which input deserves better data

  1. A routing model has uncertain fuel cost, uncertain driver wage and uncertain demand. All three were estimated roughly.

    Three uncertain inputs.

  2. The report gives the fuel coefficient a range of $\pm 40\%$ before the optimal routing changes, the wage $\pm 60\%$, and demand $\pm 3\%$.

    Three very different ranges.

  3. So fuel and wages can be wrong by a lot without changing what to do, and demand cannot. Effort goes to the demand forecast. This is frequently the most valuable output of a study — not the plan, but the finding that two thirds of the data-gathering was not decision-relevant.

    The report redirects the effort.

8. A degenerate price

  1. At the optimum, three constraints are tight in a two-variable problem: more binding constraints than variables.

    Degeneracy.

  2. Several different multiplier vectors satisfy the KKT conditions there, so "the" shadow price is not well defined — the solver reports one of them, and another solver may report a different one.

    The price is not unique.

  3. The practical test is to perturb the right-hand side slightly and re-solve: the actual change in the optimal value is the thing that was wanted, and it is well defined even when the multiplier is not. When a price looks surprising, this is the check to run before acting on it.

    Re-solve rather than trusting the number.

9. Your turn: act on this report

  1. Labour hours: price $8$, valid to $+10$ hours. Material: price $0$. Machine time: price $2$, valid to $+40$ hours. Overtime labour costs $6$ an hour; machine time costs $5$ an hour to rent.

    Compare each price with its cost.

  2. Labour: worth $8$, costs $6$, nets $2$ per hour for up to $10$ hours — a gain of $20$. Buy it. Machine time: worth $2$, costs $5$ — a loss of $3$ an hour. Do not.

  3. Your turn: work this step out. Its working is at the end of the packet.

    Material: price zero, so it is not binding and buying more is worthless — and it is worth asking whether some could be released. Notice the shape of the answer: one thing to buy, with a quantity; one thing not to; and one thing to stop worrying about. That is what a decision-maker can use, and none of it is visible in the optimum alone.

10. Guided practice

A binding constraint has shadow price $3$, valid for up to $6$ extra units. What does adding $4$ units buy?

Answer:

11. Guided practice

The shadow price is $5$ and $2$ extra units can be bought at $1$ each. What is the net gain?

Answer:

12. Practice

Why does the shadow price $5$ stop applying beyond $5$ extra units?

13. Practice

A sensitivity report gives a shadow price of zero for a warehouse capacity constraint. What should be done?

14. Practice

A binding constraint has shadow price $5$, valid for up to $5$ extra units. What does adding $2$ units buy?

Answer:

15. Somewhere new

A model has $7$ uncertain cost parameters. Sensitivity shows the answer changes only with one of them. Where should effort go?

16. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

17. Test question

The shadow price is $8$ and $3$ extra units can be bought at $3$ each. What is the net gain?

Answer:

18. What you can do now

You can act on a sensitivity report, respect a validity range, and say which inputs matter. Next: when the data is not merely uncertain but random.

Working for the steps left to you

9. Your turn: act on this report, step 3