Wagner-Whitin Algorithm

Decision Sciences
Introduced by
Harvey M. Wagner and Thomson M. Whitin
Year
1958
Type
algorithm
Family
Optimization

What does it do?

The Wagner-Whitin algorithm, introduced by Harvey M. Wagner and Thomson M. Whitin in 1958, is a dynamic programming method for the dynamic economic lot-size problem.

It chooses how much to produce in each period of a finite horizon for a single item whose demand is known and varies over time. The method minimizes the total cost of production setups and inventory holding while meeting demand in every period. The original model is uncapacitated, so capacity-constrained variants need other formulations.

The intuition behind the method

Each production run carries a fixed setup cost, and carrying stock from one period to the next carries a holding cost. It is therefore often cheaper to produce one large batch that covers several future periods than to produce in every period. The best batch size depends on future demand, which makes the decision hard to make period by period. The algorithm works forward through the periods and, for each one, records the cheapest way to meet all demand up to that point. Each candidate final run is compared with the cheapest plans already found for earlier periods, so the optimal overall plan is built from smaller optimal sub-plans.

History

Wagner and Whitin published the forward dynamic programming algorithm for the dynamic version of the economic lot-size model in Management Science in 1958. The paper allowed demand for a single item, holding charges and setup costs to vary over N periods, and sought a minimum-cost inventory plan that satisfies known demand in every period. It also showed that disjoint planning horizons are possible, so full-horizon data are not always needed at once. The zero-inventory property is usually associated with the method in the wider literature.

When to use it

Use the Wagner-Whitin algorithm for a single item whose demand in each period of a finite horizon is known in advance. It applies when producing in a period incurs a setup cost and holding stock incurs a cost that may vary from period to period. It suits planning problems where production capacity does not bind, so each period's requirement can be met from any production run. Choose it when an exact benchmark is needed, for example to judge how close a heuristic plan comes to the optimum. Do not use it when demand is uncertain, when several items compete for shared resources, or when production or storage capacity limits are binding, because the original model has none of these features. Mixed integer programming formulations and heuristic lot-sizing rules are the usual alternatives in those cases.

Limitations and considerations

  • The original model is uncapacitated and cannot represent production or storage capacity limits; capacitated lot-sizing requires different formulations, such as mixed integer programming.
  • Demand is assumed to be known and deterministic, so demand uncertainty cannot be represented directly.
  • The model covers a single item. Multi-item problems with shared resources need extensions such as mixed integer programming or Lagrangian relaxation.
  • The plan is only as reliable as the setup and holding cost estimates that feed the recursion, and small errors in those inputs can change which periods are chosen for production.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Gives a provably optimal production plan for the uncapacitated single-item model with known, time-varying demand, setup costs and holding costs.
  • Uses dynamic programming, so the number of candidate plans it compares grows polynomially rather than exponentially with the horizon length.
  • Accepts setup and holding costs that differ from period to period without changing the method.
  • The 1958 paper shows that the horizon can be split into disjoint planning horizons, so data for all periods do not have to be used at once.
  • Provides an exact benchmark against which heuristic lot-sizing rules can be judged.

Applications

  • Single-item production planning where setup costs make batching worthwhile and demand in each period is known from firm orders or a reliable forecast.
  • Inventory replenishment planning for an item whose requirements vary over a finite, known horizon.
  • Benchmarking: computing the optimal uncapacitated plan to measure how far a heuristic or a capacitated plan lies from it.
  • Teaching and analysis of the trade-off between setup cost and holding cost in lot-size decisions.

How it works

How it works

1

Set up a cost table with one entry per period of the horizon, where each entry will hold the least total cost of meeting demand up to that period. Demand, setup cost and holding cost for every period must be entered first, because every later step uses them. The entry for the empty plan before the first period is set to zero.

2

Moving forward through the periods, evaluate each possible production run that would start at an earlier period and cover demand through the current period. The cost of such a run is the cheapest cost already recorded before its start, plus its setup cost, plus the holding cost of carrying its covered demand forward. Store the cheapest option for each period. Only run start points where the previous run's demand is fully used need to be considered, which is the zero-inventory property.

3

When the cheapest cost for the final period is known, record which start point produced that minimum. Move back to that start point and repeat until the first period is reached. The periods where runs begin are the production periods, and each run's quantity equals the total demand it covers. This yields the optimal schedule as well as its cost.

Common pitfalls

  • Omitting setup costs from the model removes the incentive to batch production, which produces a plan with too many production runs.
  • Entering holding costs in a time unit that does not match the period length misstates the trade-off between setup and holding and can change the optimal batching.
  • Applying the uncapacitated recursion to a problem where capacity binds, which can produce a plan that cannot be executed.
  • Treating the single-item recursion as if it accounted for shared resources between items, which it does not.

Frequently asked questions

What is the zero-inventory property and why is it important?

It states that some optimal plan exists in which a production run is made only in a period where the stock carried in from the previous period is zero. Production is never needed to build up stock for a period that is already covered. This restriction reduces the set of candidate production plans the algorithm must compare, which keeps the search efficient. The property is usually associated with the algorithm in the wider literature, although the original 1958 abstract does not state it explicitly.

How does the algorithm handle multiple products competing for production resources?

The basic Wagner-Whitin algorithm solves single-item problems. Multi-item problems with shared production resources are usually formulated as mixed integer programs, which can be solved with branch-and-bound methods, Lagrangian relaxation or heuristics.

Can the algorithm handle demand uncertainty?

No. The algorithm requires deterministic demand. For uncertain demand, use stochastic dynamic programming, safety stock policies, or robust planning methods.

What is the time complexity of the Wagner-Whitin algorithm?

The worst-case running time is commonly stated as O(T²), where T is the number of periods, which is polynomial in the horizon length. Actual run time depends on the implementation and the problem data.

Related methods

Sources

  1. Wagner, H. M., & Whitin, T. M. (1958). Dynamic version of the economic lot size model. Management Science, 5(1), 89-96.

    Open DOI reference
  2. Pochet, Y., & Wolsey, L. A. (2006). Production Planning by Mixed Integer Programming. Springer.

    Open publication reference