learn-prescriptive-analytics-with-phoebe / Practitioner session 10 of 10
Learn Prescriptive Analytics with Phoebe · Practitioner session 10 of 10

The optimisation bench

Nine sessions took the problem apart a piece at a time. This one puts all of it in front of you with the ceilings exposed. Move one and everything recomputes: the continuous answer, the integer answer, what rounding would have cost you, which constraints bind, what each binding one is worth, and how far that worth holds before it stops being true. That last column is the one most tools never show, and it is the one that decides whether a purchase makes sense.

🔴 Hardest Anyone who will own a model like this Anyone who has to defend its plan 45 min
0-3 · Welcome 3-18 · Drive it 18-34 · Break the intuitions 34-45 · Write the brief and close
Part 0

Where this lands

Session 1 wrote the problem down. Sessions 2 and 3 showed where the answer lives and how simplex walks to it. Sessions 4 and 5 priced the constraints and made the integers bite. Session 6 covered the formulations that go wrong quietly. Sessions 7 and 8 put uncertainty on top, and session 9 is the record of this solver being wrong twice. Everything below runs from the same assets/opt-live.js, which passes its three hand-checked problems on load.

Live = worked through in the 45 minutes Self-study = the full depth, after class 🔍 Every diagram zooms

★ What you walk out with today. A feel for which ceilings move the answer and which do nothing, built by moving them yourself rather than being told. The habit of reading a shadow price together with the range it holds over, because the bench refuses to show one without the other. And a short written brief for a plan, in the form somebody else could actually check.

LiveWhat the bench recomputes on every press4 min▶

Solving the relaxation gives the continuous plan. Branch and bound gives the integer plan and reports how many nodes it took. Rounding the continuous answer down gives the plan somebody would have shipped instead, and the difference between that and the integer answer is what the shortcut costs.

For each constraint it reports the slack, whether it binds, what one more unit is worth, and then it walks the ceiling upward in hundredths until the shadow price stops predicting the actual gain. That last step is a measurement, not a formula, and it is why the range column can be trusted.

Part 1 · the bench

Drive it

15 min hands on

Three ceilings. Change one at a time and predict the direction before you press Solve. An input whose effect you cannot predict the sign of is one you do not yet understand, and that is worth finding out here rather than in a meeting.

LiveThe four runs worth doing first5 min▶
  • Leave everything at the base case. Continuous 4,666.90, integer 4,656.00 in 29 nodes, rounding down 4,596.00. Note the warning: rounding does not merely lose 60.00, it gives 30 Standard where the true optimum is 33.
  • Raise blending from 77 to 90. Nothing happens. It was not binding, its shadow price is 0, and the extra capacity is worth exactly nothing.
  • Raise milling from 131 to 131.4. The gain matches 33.7931 an hour almost exactly, because you are still inside the range.
  • Raise milling from 131 to 141. The integer objective goes to 4,864.00, a gain of 208.00 against the 337.93 that ten times the shadow price promised. It is well short, because the binding set changed on the way.
Self-studyTwo things worth breaking on purpose4 min▶

Set protein to 0. The mill can still make Standard, which needs only 0.1 a tonne, so the plan does not vanish, it shifts entirely onto the product you would not have guessed. Optimisation under a hard limit rarely degrades gracefully in the direction people expect.

Then set milling to something very small, like 5. Watch the integer plan collapse toward nothing while the solver still reports an optimum, because "optimal" is a statement about the problem you gave it and says nothing about whether the answer is a business.

Part 2 · what the bench is refusing to let you do

Three intuitions it breaks

8 min live

Each of these is a thing people say about optimisation that the measured output contradicts. They are worth naming because each one survives a long time in a room where nobody has the numbers.

What people say, and what the bench returns "Make more of the best margin" Show earns 71 a tonne and is in no optimal plan at all. Per milling hour: Dairy 36.00, Standard 34.55, Show 30.87. "Just round it, close enough" Rounding gives 4,596.00 against an integer optimum of 4,656.00. And it gives 30 Standard where the optimum is 33: wrong way. "Capacity is worth the price" Milling is worth 33.7931 an hour, but only to plus 0.46 hours. Ten hours looks like 337.93 and actually returns 206.44. All three intuitions are reasonable. All three are wrong here, and each one is wrong in a different way. The first ranks by the wrong unit, the second assumes the answer is continuous, and the third drops the range. None of these are solver failures. The solver answered correctly every time. What was wrong was the sentence somebody said about its answer.
🔍 Click to zoom - three reasonable sentences, three different ways of being wrong.
LiveWhy the range column exists at all4 min▶

A shadow price is a derivative. It tells you the rate of change at the point you are standing on, and like any derivative it stops describing the function once you have moved far enough. The distance you can move is the part almost no tool prints, and it is the part a purchase decision depends on entirely.

The bench measures it by walking the ceiling up in hundredths and comparing the predicted gain with the real one, stopping at the first disagreement. That is slower than reading it off the tableau and it is harder to get subtly wrong, which after session 9 seemed like the right trade.

Self-studyWhat the bench still will not tell you3 min▶

It optimises one objective, stated in one unit, over constraints somebody chose to write down. It has no view on whether a constraint was measured or assumed, whether the margins are still current, or whether a plan of 33 and 63 is something the shift can actually run. A missing constraint does not appear as an error here; it appears as a confident plan that reality declines.

It also solves the average case. Session 7 put drawn demand on top of exactly this plan and found it sells out about a quarter of the time, which the bench above does not show and does not claim to.

Part 3 · build-along

Write the brief

11 min hands on

Six steps on the bench, ending in a short written brief that somebody who was not in the room could check.

Record the base case in one line

Plan, integer objective, and the two binding constraints. Three facts. If it takes more than a line you are including things the reader can look up.

Price the two binding constraints properly

Write each one as a rate and a range together: milling at 33.7931 to plus 0.46, protein at 8.2759 to plus 0.77. Never write the rate on its own, because the rate on its own is the thing that gets multiplied by ten.

Answer a purchase question

Somebody offers 10 milling hours at 25 an hour. Work out whether to take it using the bench rather than the shadow price, and note how different the two answers are.

Show the cost of the shortcut

Give the rounded plan and the integer plan side by side with both objectives, and state the direction error rather than only the 60.00.

Name what the plan assumes

List the inputs that were measured and the ones that were estimated. If the list of estimated ones is empty you have not looked hard enough at where the margins came from.

Write the four sentences

What the plan is, what it is optimal for, what each binding constraint is worth and over what range, and what you would want to know before acting on it. Four sentences, no spreadsheet attached.

The habit to keep. A shadow price and its range travel together, always. Quoting the rate alone is not a simplification, it is the specific error that turns a correct model into a bad purchase, and it is the easiest one to make because the rate is the number the tool prints.

Check yourself

Three questions

The bench reports blending hours with slack and a shadow price of 0. Your operations lead says blending is the busiest line in the mill. Who is right?

Busy and binding are different. Blending finishes with 0.2414 hours spare, so it can run hard all week and still not be the thing stopping you doing more. Neither person is wrong about what they can see.

Milling is worth 33.7931 an hour. Somebody offers 10 hours for 250. Do you take it?

The rate is real but local. Multiplying it by ten gives 337.93, while the continuous gain is 206.44 and the integer plan gains 208.00, so the deal that looked clearly good is clearly bad either way. The bench shows the integer figure because a plan has to be whole batches. This is the single most useful thing on the page.

Rounding the continuous plan down gives 4,596.00 against an integer optimum of 4,656.00. What is the more important part of that result?

The rounded plan is perfectly feasible, which is why it survives review. The dangerous part is the direction: a shortcut that loses a predictable sliver is manageable, and one that points you the wrong way is not.

After the course

Homework

An hour, on an allocation you actually recognise.

Write down one real allocation as three parts

What you choose, the one number you are trying to move, and the limits. Two or three variables is plenty. If you cannot name the objective in one unit, that is the finding.

Solve it, then price the binding constraints with their ranges

Walk each ceiling up until the predicted gain and the real gain separate. Report the pair, never the rate alone.

Check the solver against something that cannot share its mistake

Generate small random instances and compare against brute force over a box sized from the constraints. Session 9 is what happens when you skip this.

Covered today

What this session covers

✓Driving the whole problemThree ceilings, everything downstream recomputed on each press.
✓Shadow prices with their measured rangesMilling to plus 0.46, protein to plus 0.77, blending worth nothing.
✓The rounding trap, including its direction4,596.00 against 4,656.00, and 30 Standard where the optimum is 33.
✓Three intuitions the measurements contradictBest margin, close enough, and capacity is worth the price.
✓The four sentence briefPlan, what it is optimal for, prices with ranges, and what you would want to know.
◐Uncertainty on top of the planSession 7 measures it; the bench here solves the average case.
◐Checking a solver you did not writeSession 9, and the homework above.
○Choosing between prediction and prescriptionLeader session 5; this track assumes the choice is made.
Take this with you

Cheat sheet

A rate and its range travel together. 33.7931 an hour, to plus 0.46 hours.
Not binding means worth nothing. Blending has 0.2414 hours spare and a price of 0.
Busy is not binding. A line can run flat out and still not be the limit.
Rounding can point the wrong way. 30 Standard against a true optimum of 33.
Rank by the scarce unit. Per milling hour: Dairy 36.00, Standard 34.55, Show 30.87.
Optimal is about the stated problem. It says nothing about whether the problem was right.
The average case is one case. This plan sells out about a quarter of the time.
Cross-check any solver. Random instances against something that cannot share the mistake.