Applications of ORGitHub
Lecture 5 · Logistics & Supply Chain

Inventory Management

How much to order and when: the EOQ trade-off, the newsvendor critical ratio, and safety stock under uncertain demand.

A shop sells a product that it buys from a supplier. If it orders too often it pays the fixed cost of placing and receiving an order again and again; if it orders too much at once it ties up cash and shelf space in stock that sits waiting to be sold. If demand is uncertain there is a second trade-off: too little stock means lost sales and unhappy customers, too much means leftovers that must be marked down or thrown away. How much should it order, and when?

These are the questions of inventory theory. Its models are among the oldest in OR and among the most widely deployed: every retailer, manufacturer and hospital pharmacy runs some version of the policies in this lecture, often inside an ERP system that computes them automatically. We look at two foundational models — the economic order quantity for steady, known demand, and the newsvendor for a single period of uncertain demand — and then at the policies that combine the two ideas.

The decision

An inventory policy answers two questions: how much to order, and when to order it. The relevant costs are:

  • an ordering cost KK per order, independent of its size (administration, transport, set-up of a production run);
  • a purchase cost cc per unit;
  • a holding cost hh per unit per unit of time, covering the cost of capital, storage, insurance and obsolescence — often expressed as a percentage of cc per year;
  • a shortage cost for demand that cannot be met from stock, either as a lost sale or as a backorder filled later.

Which costs matter depends on the setting. With steady demand, the trade-off is between ordering and holding costs. With uncertain demand, it is between holding (or overage) and shortage costs.

The economic order quantity

Assume demand occurs at a constant, known rate of DD units per year, replenishment is instantaneous, and no shortages are allowed. Then it is clearly optimal to order only when stock reaches zero, and to order the same quantity QQ each time. Inventory follows a sawtooth: it jumps to QQ, falls linearly to zero over a cycle of length Q/DQ/D, and jumps back up.

The decision variable is the order quantity Q>0Q \gt 0. Over a year,

  • the number of orders is D/QD/Q, so ordering costs KD/QK D / Q;
  • the average inventory is Q/2Q/2, so holding costs hQ/2h Q / 2;
  • purchasing costs cDcD, which does not depend on QQ and can be ignored.

The annual cost to minimize is therefore

C(Q)=KDQ+hQ2.C(Q) = \frac{K D}{Q} + \frac{h Q}{2} .

The first term decreases in QQ and the second increases. CC is convex on Q>0Q \gt 0, so setting the derivative to zero gives the minimum:

C′(Q)=−KDQ2+h2=0.C'(Q) = -\frac{K D}{Q^2} + \frac{h}{2} = 0 .
(Economic order quantity)

The cost-minimizing order quantity and the resulting annual cost are

Q∗=2KDh,C(Q∗)=2KDh.Q^* = \sqrt{\frac{2 K D}{h}}, \qquad C(Q^*) = \sqrt{2 K D h} .

At Q∗Q^* the annual ordering cost and the annual holding cost are equal, each 122KDh\tfrac{1}{2}\sqrt{2KDh}.

This is the EOQ formula, usually attributed to Harris (1913). Its most useful property is robustness. Dividing C(Q)C(Q) by C(Q∗)C(Q^*) gives

C(Q)C(Q∗)=12(QQ∗+Q∗Q),\frac{C(Q)}{C(Q^*)} = \frac{1}{2}\left( \frac{Q}{Q^*} + \frac{Q^*}{Q} \right),

which is very flat near Q/Q∗=1Q/Q^* = 1. Ordering 25% more than optimal raises cost by only 2.5%. Equally, errors in the inputs are damped by the square root: if KK is overestimated by a factor of two, Q∗Q^* is too large by a factor of 2≈1.41\sqrt{2} \approx 1.41, and cost rises by about 6%. This is why EOQ works well in practice even though its assumptions rarely hold exactly.

(EOQ)

A shop sells D=1200D = 1200 units a year. Each order costs K=100K = 100 to place, and holding one unit for a year costs h=6h = 6. Then

Q∗=2⋅1200⋅1006=40 000=200,Q^* = \sqrt{\frac{2 \cdot 1200 \cdot 100}{6}} = \sqrt{40\,000} = 200,

so the shop places 1200/200=61200 / 200 = 6 orders a year, one every two months. The annual cost is

C(200)=100⋅1200200+6⋅2002=600+600=1200=2⋅1200⋅100⋅6.C(200) = \frac{100 \cdot 1200}{200} + \frac{6 \cdot 200}{2} = 600 + 600 = 1200 = \sqrt{2 \cdot 1200 \cdot 100 \cdot 6} .

The cost curve is flat around the optimum:

Order quantity QQ150200250300400
Annual cost C(Q)C(Q)12501200123013001500
Relative to optimum+4.2%—+2.5%+8.3%+25%

If the supplier only delivers in cases of 250, the penalty is 3030 a year.

Lead times. If an order takes a known time LL to arrive, nothing changes except timing: place the order when the stock on hand equals the demand during the lead time, r=DLr = DL. This reorder point becomes important once demand is uncertain.

The newsvendor model

Now consider a single selling period with uncertain demand. A newsvendor buys papers in the morning at cost cc each, sells them at price pp, and can return unsold copies at the end of the day for a salvage value vv, with v<c<pv \lt c \lt p. Demand XX is a random variable with distribution function FF. The decision is the order quantity QQ, made before demand is known. The same structure fits fashion goods, perishable food, seasonal products, and capacity decisions in general.

Two costs drive the decision:

  • the underage cost cu=p−cc_u = p - c, the profit lost on each unit of demand that goes unmet;
  • the overage cost co=c−vc_o = c - v, the loss on each unit bought but not sold.

The expected cost of mismatch is

G(Q)=co E[(Q−X)+]+cu E[(X−Q)+],G(Q) = c_o\, \mathbb{E}\big[(Q - X)^+\big] + c_u\, \mathbb{E}\big[(X - Q)^+\big],

where a+=max⁡{a,0}a^+ = \max\{a, 0\}, and maximizing expected profit is equivalent to minimizing GG.

Marginal analysis. Increase QQ by one small unit. With probability F(Q)F(Q) demand falls short of QQ, the extra unit is left over, and we lose coc_o. With probability 1−F(Q)1 - F(Q) demand exceeds QQ, the extra unit is sold, and we save cuc_u. Formally,

G′(Q)=co F(Q)−cu(1−F(Q)).G'(Q) = c_o\, F(Q) - c_u \big(1 - F(Q)\big) .

This is increasing in QQ, so GG is convex, and the optimum is where the derivative vanishes.

(Critical ratio)

For continuous demand, the expected-profit-maximizing order quantity satisfies

F(Q∗)=cucu+co.F(Q^*) = \frac{c_u}{c_u + c_o} .

The right-hand side is the critical ratio, and Q∗Q^* is the corresponding quantile of the demand distribution. For discrete demand, Q∗Q^* is the smallest QQ with F(Q)≥cu/(cu+co)F(Q) \ge c_u / (c_u + c_o).

The critical ratio is the optimal probability of not running out. When underage is costly relative to overage (high margin, high salvage value), it is close to 11 and we stock well above expected demand; when overage dominates, we stock below it. Ordering the mean demand is optimal only when cu=coc_u = c_o and the distribution is symmetric.

For normal demand with mean μ\mu and standard deviation σ\sigma, Q∗=μ+zσQ^* = \mu + z \sigma, where z=Φ−1(cu/(cu+co))z = \Phi^{-1}\big(c_u / (c_u + c_o)\big) and Φ\Phi is the standard normal distribution function. The expected shortage at any Q=μ+zσQ = \mu + z\sigma is σ L(z)\sigma\, \mathcal{L}(z), where

L(z)=φ(z)−z (1−Φ(z))\mathcal{L}(z) = \varphi(z) - z\,\big(1 - \Phi(z)\big)

is the standard normal loss function and φ\varphi is the standard normal density. Expected leftovers are then Q−μ+σ L(z)Q - \mu + \sigma\, \mathcal{L}(z).

(Newsvendor with normal demand)

A bakery sells a speciality cake for p=10p = 10, which costs c=4c = 4 to make; unsold cakes go to a food outlet for v=1v = 1. Daily demand is approximately normal with μ=500\mu = 500 and σ=100\sigma = 100. Then

cu=10−4=6,co=4−1=3,cucu+co=69=23.c_u = 10 - 4 = 6, \qquad c_o = 4 - 1 = 3, \qquad \frac{c_u}{c_u + c_o} = \frac{6}{9} = \frac{2}{3} .

The 2/32/3 quantile of the standard normal distribution is z=0.4307z = 0.4307, so

Q∗=500+0.4307⋅100≈543.Q^* = 500 + 0.4307 \cdot 100 \approx 543 .

With φ(0.4307)=0.3636\varphi(0.4307) = 0.3636, the loss function is L(z)=0.3636−0.4307⋅13=0.2200\mathcal{L}(z) = 0.3636 - 0.4307 \cdot \tfrac{1}{3} = 0.2200. Hence

  • expected shortage: 100⋅0.2200=22.0100 \cdot 0.2200 = 22.0 cakes;
  • expected sales: 500−22.0=478.0500 - 22.0 = 478.0 cakes;
  • expected leftovers: 543.07−478.0=65.1543.07 - 478.0 = 65.1 cakes.

Expected profit is (p−c)μ(p - c)\mu minus the expected cost of mismatch:

6⋅500−(6⋅22.0+3⋅65.1)=3000−327.2=2672.8.6 \cdot 500 - (6 \cdot 22.0 + 3 \cdot 65.1) = 3000 - 327.2 = 2672.8 .

Ordering the mean, Q=500Q = 500, gives expected shortage and leftovers of 100 φ(0)=39.9100\,\varphi(0) = 39.9 each, and expected profit 3000−9⋅39.9=2641.03000 - 9 \cdot 39.9 = 2641.0. The value 30003000 is what perfect knowledge of demand would earn; the remaining 327327 is the cost of uncertainty, and the only way to reduce it further is to reduce σ\sigma — better forecasting, or postponing production until demand is better known.

The probability of not running out, here 2/32/3, is not the same as the fraction of demand met. The bakery meets 478.0/500≈95.6%478.0 / 500 \approx 95.6\% of demand on average, even though it sells out on one day in three.

Policies for repeated orders under uncertainty

Most items are reordered repeatedly with uncertain demand and a positive lead time. Three policy classes dominate practice. In each, decisions are based on the inventory position: stock on hand plus stock on order minus backorders.

  • Base-stock (order-up-to) policy. At each review, order enough to raise the inventory position to a fixed level SS. With periodic review, backordered demand and no fixed ordering cost, a base-stock policy is optimal, and SS is a newsvendor quantile of the demand over the lead time plus one review period.
  • (s, S) policy. At each review, if the inventory position is at or below ss, order up to SS; otherwise do nothing. With a fixed ordering cost, policies of this form are optimal under fairly general conditions. Roughly, S−sS - s plays the role of the EOQ and ss protects against lead-time demand.
  • (Q, r) policy. With continuous review, whenever the inventory position falls to the reorder point rr, order a fixed quantity QQ. A good approximation takes QQ from the EOQ formula and sets rr from the lead-time demand distribution.

Safety stock

With uncertain demand, the reorder point is set above the expected lead-time demand. The excess is the safety stock. If demand over the lead time is normal with mean μL\mu_L and standard deviation σL\sigma_L, and we want to avoid a stockout in each cycle with probability α\alpha (the cycle service level), then

r=μL+zα σL,safety stock=zα σL,zα=Φ−1(α).r = \mu_L + z_\alpha\, \sigma_L, \qquad \text{safety stock} = z_\alpha\, \sigma_L, \qquad z_\alpha = \Phi^{-1}(\alpha) .

If demand per period is independent with standard deviation σ\sigma and the lead time is LL periods, then σL=σL\sigma_L = \sigma\sqrt{L}: safety stock grows with the square root of the lead time, not linearly.

(Safety stock for a (Q, r) policy)

Return to the shop of the EOQ example, with demand averaging 100100 units a month (1200 a year) but now with a monthly standard deviation of 3030. The lead time is one month, so lead-time demand has μL=100\mu_L = 100 and σL=30\sigma_L = 30. For a 95%95\% cycle service level, z=1.645z = 1.645, so

safety stock=1.645⋅30=49.3,r=100+49.3=149.3.\text{safety stock} = 1.645 \cdot 30 = 49.3, \qquad r = 100 + 49.3 = 149.3 .

The policy is: when the inventory position falls to about 149149 units, order Q=200Q = 200. The expected shortage per cycle is 30 L(1.645)=0.6330\, \mathcal{L}(1.645) = 0.63 units, so the fraction of demand met from stock is 1−0.63/200≈99.7%1 - 0.63/200 \approx 99.7\%. Holding the safety stock costs 6⋅49.3=2966 \cdot 49.3 = 296 a year. Raising the cycle service level to 99%99\% (z=2.326z = 2.326) needs 69.869.8 units of safety stock, at 419419 a year.

The example shows the steep cost of high service levels: the last few percentage points require disproportionately more stock, because zαz_\alpha grows rapidly as α\alpha approaches 11.

Extensions

  • Multi-echelon inventory. Stock is held at several levels — a central warehouse feeding regional depots feeding stores — and the question is where safety stock is most effective. Holding it centrally pools demand variability across locations.
  • Multiple items. Items share a budget, warehouse space or a joint ordering cost; Lagrangian methods adjust each item's EOQ or service level.
  • Perishability and obsolescence. Food, blood and medicines expire; fashion and electronics lose value quickly. These push towards newsvendor-type models.
  • Dynamic programming. Time-varying demand, capacity limits and non-stationary costs are handled by stochastic dynamic programming, which is also how the optimality of base-stock and (s, S) policies is proved.
  • Demand learning. In practice the demand distribution is itself estimated from data, often censored by stockouts — sales are observed, but lost demand is not.

Further reading: Silver, Pyke and Thomas, Inventory and Production Management in Supply Chains; Zipkin, Foundations of Inventory Management; Nahmias, Production and Operations Analysis.