A plant makes one product over four periods. Demand is 20, 35, 30 and 25 units; making one unit costs 9, 8, 7 and 6 as the periods go on; at most 60 units can be made in a period; carrying a unit into the next period costs 1; and there are 5 units in the store before the first period begins.
Definition · Balance constraintFor each period t, with Pₜ made, Dₜ demanded and Iₜ left in the store at the end, the balance constraint is Iₜ = Iₜ₋₁ + Pₜ − Dₜ, where I₀ is the opening stock. Rearranged for a solver, with the data on the right, it is Pₜ + Iₜ₋₁ − Iₜ = Dₜ.
With Iₜ ≥ 0 for every t, the family of equations says exactly that demand is met in the period it occurs, out of stock that exists by then. Allowing Iₜ to go negative is a modelling decision with a name — a backorder — and it has to be made deliberately.
period 1 period 2 period 3 period 4
demand 20 35 30 25
cost to make one 9 8 7 6
opening stock 5, capacity 60 a period, 1 to carry a unit onward
minimise 9P₁ + 8P₂ + 7P₃ + 6P₄ + I₁ + I₂ + I₃ + I₄
P₁ − I₁ = 15 20 demanded, 5 already in the store
P₂ + I₁ − I₂ = 35
P₃ + I₂ − I₃ = 30
P₄ + I₃ − I₄ = 25
P₁, …, P₄ ≤ 60
every P and every I ≥ 0
The cheapest plan makes 15, 35, 30 and 25 and carries nothing at any point, at a cost of 775. That is worth reading rather than accepting: making a unit gets cheaper every period and carrying one costs money, so there is no reason to build stock and every reason to make each unit as late as the balance rows allow — which is the period it is sold in.
Example · When the store earns its keepCut the capacity to 30 a period and raise the second period's demand to 40. Now the second period cannot make what it sells, so the plan makes 25 in the first period, carries 10 units forward, and makes 30, 30 and 25 after that, at a cost of 835. The first inventory variable is 10, and it is the only thing in the model that could have made the second period feasible at all.
The aggregate row, and the plan it prefers
The tempting simplification is one row instead of four: total production at least total demand. With 110 units demanded and 5 in the store that is P₁ + P₂ + P₃ + P₄ ≥ 105, and the inventory variables disappear along with the balance equations.
It solves, and it is cheaper: 675 against 775. The plan it prefers makes nothing at all in the first two periods and then 45 and 60 in the last two, because production is cheapest at the end and nothing in the model any longer says when a unit has to exist. Run that plan through the periods and 15 units of demand go unmet in the first period and 35 in the second: fifty units of demand unserved, by a plan the objective calls better.
This is the sharpest example on the course of a model being exactly wrong. Nothing is infeasible, no arithmetic is off, and the reported cost is a real number about a plan nobody would run. The aggregate row is a true statement about the plan; it is simply a much weaker one than the four rows it replaced, and the cost cannot show what was lost.
The same weakening is available inside the balance rows themselves. Drop I₂ ≥ 0 and the second period's row is satisfied by I₂ = −35 with nothing made, which reads as thirty-five units promised and not delivered. If backorders are what the situation allows, that is a variable to introduce and price on purpose; if they are not, the sign restriction is the row that says so.