Learn
Lesson · Dynamic Programming and Sequential Decisions · Ordering over time

Silver-Meal and Least Unit Cost

Both rules build the plan left to right: start an interval, keep extending it while an average falls, stop when the average turns up, start again. They differ only in which average they watch — cost per period, or cost per unit — and that is enough to make them disagree with each other as well as with the exact answer. Neither dominates the other, and the instance that shows it has one of them paying 24 too much with three orders and the other 30 too much with two.

Silver-Meal extend while the average cost per PERIOD is falling least unit cost extend while the average cost per UNIT is falling both stop at the first turn upwards, and neither can see past it demand 17 25 73 113 89, K = 116, h = 1: exact 462 Silver-Meal 486, three orders, 24 too much least unit cost 492, two orders, 30 too much demand 10 62 12 130 154 129, K = 54, h = 2: exact 294, SM 294, LUC 600
Two averages, two stopping points, and what each one costs

Core ideas

What this lesson establishes

Three ideas: what the rules do, why they can be wrong, and how to price the wrongness without trusting either rule's own bookkeeping.

1

Both rules are myopic in the same way, and greedy in different ways

Each starts an interval at the first uncovered period and extends it one period at a time, watching a running average. While the average falls, extending looks worthwhile; at the first increase the rule closes the interval and starts a new one at the next period. Neither ever revisits a decision, so a plan is built in one left-to-right sweep, and the whole question is which average is being watched.

2

Per period and per unit are different questions

Silver-Meal divides the interval's total cost by the number of periods it covers; least unit cost divides it by the quantity ordered. When demand is rising sharply, adding a period adds a lot of quantity, so the per-unit average keeps falling long after the per-period average has turned up — which is exactly why least unit cost places fewer, longer orders on the instances here, and why the two rules disagree rather than one being a rough version of the other.

3

A heuristic's own cost figure is not evidence

Each rule reports a total as it goes. That total is produced by the same code that chose the plan, so it cannot testify to it. The lab prices each plan again from the demand, the setup charge and the holding rate — the same function that prices the exact plan — so the comparison is between three plans measured with one instrument, which is the only kind of comparison worth making.

The material

Two rules, traced, and then priced against the exact answer

What each rule does step by step, the instance where one of them is lucky, and the instance where both of them are not.

Definition · Silver-Meal and least unit cost

Both rules build a plan by intervals. Starting at the first uncovered period t, consider covering t through t+k for k = 0, 1, 2, .... The interval's cost is K + h × its holding, and the rule compares a running average as k grows.

Silver-Meal uses the average per period, (K + h × holding) / (k+1). Least unit cost uses the average per unit, (K + h × holding) / (quantity covered). Each extends while its average strictly falls and closes the interval at the first value that does not, then starts again at the next uncovered period.

Two things follow immediately. Both rules always terminate, because every interval covers at least one period. And both are exact on the first interval only in the sense that they stop where their own average stops — neither has any notion of what happens after the interval it is currently building, so neither can trade a worse interval now for a much better one later. That is the failure mode, and it is structural rather than a matter of tuning.

The instance where both of them miss

demand 17 25 73 113 89 K = 116 h = 1 EXACT (the recursion of the previous page) orders at 1, 3, 4 covering 1-2, 3, 4-5 cost 141 + 116 + 205 = 462 SILVER-MEAL, average per PERIOD from 1: 116/1 = 116 141/2 = 70.5 287/3 = 95.66.. turned up, span 2 from 3: 116/1 = 116 229/2 = 114.5 407/3 = 135.66.. turned up, span 2 from 5: 116/1 = 116 last period, span 1 plan 1-2, 3-4, 5 cost 141 + 229 + 116 = 486 three orders LEAST UNIT COST, average per UNIT from 1: 116/17 = 6.82 141/42 = 3.357 287/115 = 2.496 626/228 = 2.745 turned up, span 3 from 4: 116/113 = 1.026 205/202 = 1.014 ran out, span 2 plan 1-3, 4-5 cost 287 + 205 = 492 two orders exact 462 Silver-Meal 486 (+24) least unit cost 492 (+30)

Neither rule dominates. Silver-Meal is 24 over with three orders; least unit cost is 30 over with two. They do not merely differ in how much they lose, they differ in what kind of plan they produce, and no amount of preferring one of them in advance is justified by this instance — or, as the next paragraph shows, by the other one.

The instance where one of them is exactly right

Take the six-period demand of “Wagner-Whitin and the Order Intervals”: 10, 62, 12, 130, 154, 129 with a setup of 54 and a holding rate of 2. Silver-Meal produces precisely the exact plan — five orders, with periods 2 and 3 covered together — and costs 294, which is the optimum. Least unit cost produces four orders and costs 600, more than twice the optimum.

Example · Why least unit cost goes so badly wrong there

Starting at period 1 it compares 116/17-style ratios: 54/10 = 5.4, then 178/72 ≈ 2.47, then 226/84 ≈ 2.69. So it covers periods 1 and 2 together and stops. Starting again at period 3 it sees 54/12 = 4.5 and then 314/142 ≈ 2.21, so it covers periods 3 and 4 together — which means carrying 130 units for a period at 2 each.

That single decision costs 260 in holding to save one setup charge of 54. The per-unit average is falling the whole time, because the 130 units in the denominator swamp the 260 in the numerator; the average is a ratio and the rule is watching the ratio rather than the money.

So on one instance Silver-Meal is exact and least unit cost is more than double; on another Silver-Meal is 24 over and least unit cost 30 over. Two instances is not a study, and this page does not claim one. What it claims is narrower and is measured: neither rule dominates the other, and the honest way to use either is to price its output against the recursion whenever you can afford to.

The instance where everything agrees

Flat demand of 30 for six periods, a setup of 80 and a holding rate of 1: both rules and the recursion produce the same three-order plan costing 330. That is the case a textbook reaches for when it wants to show a heuristic in a good light, and it is exactly the case that cannot distinguish the rules from each other or from the exact answer. A flat instance is where a heuristic looks best, which is why it is not the test.

The lab plots the cost of each plan against the number of orders it places, which makes one thing visible that a table does not: the exact plan is not always the one with the most orders or the fewest. On the five-period instance the optimum has three orders, one heuristic has three and is still wrong, and the other has two. The order count is not the thing being optimised and reading the plot as though it were is a mistake worth making once, on the page, with the numbers in front of you.

What none of this settles is whether the exact plan is worth having. The recursion needs the whole horizon in advance and the heuristics need only the next few periods, so on a rolling forecast the comparison is not between 462 and 486 at all — it is between two different problems. That is a judgement about the situation rather than about the arithmetic, and it is the reason both rules are still in use.

Interactive

Two rules of thumb, against the exact answer

Silver-Meal and least-unit-cost watch different averages and stop in different places

Two rules of thumb, against the exact answera heuristic that stops when the average turns up can stop in the wrong place
the exact planSilver-Mealleast unit costwhat the rule left on the table

Method

Tracing a rule honestly

Four steps. The fourth is the one that turns a demonstration into a measurement.

1

Write the running total for each candidate interval, not just the average

K plus h times the holding, for covering one period, two periods, three. The average is that total divided by something, and keeping the total in view stops you from losing track of what the ratio is a ratio of.

2

Divide by the right denominator, and be able to say which

Periods for Silver-Meal, units for least unit cost. Writing both columns side by side once is worth more than remembering which is which, because the point of the lesson is that the choice of denominator changes the plan.

3

Stop at the first value that is not smaller, and start again

Not the smallest over the whole horizon — the first turn upwards. That is what makes these rules cheap and what makes them wrong; a rule that searched for the global minimum of the average would be doing more work than the recursion.

4

Price the finished plan from the demand, not from the rule's own running total

Setup charges plus h times unit-periods, computed independently. Then subtract the exact cost to get the gap. A heuristic that reports its own cost is not a witness to it, and the whole comparison depends on one instrument measuring all three plans.

Averages, stopping points and what a gap means

Score 0 / 0

Two rules on two instances, priced with one instrument

The five-period instance where both rules miss, and the six-period one where Silver-Meal is exactly right. Every cost below is the plan priced from the demand rather than the number the rule reported.

INSTANCE A demand 17 25 73 113 89 K = 116 h = 1 exact orders at 1, 3, 4 141 + 116 + 205 = 462 Silver-Meal orders at 1, 3, 5 141 + 229 + 116 = 486 +24 least unit cost orders at 1, 4 287 + 205 = 492 +30 three orders is not the problem: the exact plan also places three. Silver-Meal covers 3-4 where the optimum covers 3 alone and 4-5 together. INSTANCE B demand 10 62 12 130 154 129 K = 54 h = 2 exact orders at 1, 2, 4, 5, 6 = 294 Silver-Meal orders at 1, 2, 4, 5, 6 = 294 +0 least unit cost orders at 1, 3, 5, 6 = 600 +306 least unit cost covers 3-4 together, carrying 130 units one period: holding 2 x 130 = 260, to save one setup charge of 54. INSTANCE C demand 30 30 30 30 30 30 K = 80 h = 1 exact 330 Silver-Meal 330 least unit cost 330 all three place three orders covering 1-2, 3-4, 5-6.

Instance C is the one to be suspicious of. Every rule agrees, every plan is tidy, and nothing has been tested: with demand flat there is no way for the two averages to disagree, so the instance cannot distinguish the rules even in principle. A demonstration built on it would be a demonstration of nothing.

For a rehearsal, take instance A and raise the setup charge with the slider until least unit cost becomes exact. Then keep going and watch whether it stays exact. The interesting part is that the gap is not monotone in the charge: a heuristic can be right, then wrong, then right again as a parameter moves, which is another way of saying its error is not an approximation.

The harder rehearsal: find a demand sequence on which least unit cost beats Silver-Meal. It exists — the per-unit average is the better guide when demand rises steeply and holding is cheap — and constructing one is the only way to be sure you believe “neither dominates” rather than having read it.

Common mistakes

1
Reading the gap as an approximation error that shrinks with careIt does not shrink and there is nothing to tune. Both rules stop at the first turn upwards by construction, so the plans they can produce form a restricted set, and the exact plan is often not in it. Raising or lowering a charge moves a heuristic from exact to badly wrong and back again, which is the signature of a different search rather than a noisy one.
2
Choosing between the rules once, in advanceThe measured fact on this page is that neither dominates. Silver-Meal is exact on one of the instances here and 24 over on another; least unit cost is 30 over on one and more than double on the other. Any general preference has to come from knowing something about the demand pattern, and if you know that much you can usually afford the recursion.
3
Comparing the number of orders instead of the costOn the five-period instance the exact plan and the Silver-Meal plan both place three orders and differ by 24, while the least-unit-cost plan places two and differs by 30. The order count is not the objective; it is a feature of the plan, and a plot of cost against order count is there to make that separation visible rather than to suggest a target.

Check your understanding

✓
Finish when you can trace both rules by hand on a five-period instance, price each plan independently, and say why neither rule dominates.

You should be able to write the running average for each candidate interval under both denominators, identify where each rule stops and why, price each finished plan from the demand rather than from the rule's own total, and reproduce the instance where both rules miss by different amounts with different numbers of orders.

Note: Everything so far has been deterministic: the arcs, the returns and the demands were known before anything was decided. The next lesson, “The Stochastic Recursion”, puts chance inside the transition, so a value becomes an expectation and the maximum sits outside it. The recursion itself barely changes. What changes is that the best action in a state can now depend on how many periods are left, which means a policy has a time index and the stationary case becomes the special one.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.