Skip to main content

Grocery Perishable Ordering

Newsvendor Model

Every day, grocery stores face a fundamental trade-off: order too many perishable items and unsold stock goes to waste; order too few and customers leave empty-handed. The Newsvendor model finds the mathematically optimal order quantity that balances these competing costs under demand uncertainty.

The Problem

Balancing waste against lost sales for perishable goods

A grocery store must decide how many units of a perishable product — fresh bread, milk, produce — to order each day before knowing the actual demand. Products that go unsold at the end of the day can only be salvaged at a steep discount (day-old bread, marked-down dairy) or discarded entirely. Meanwhile, every unit of unmet demand represents a lost sale and a disappointed customer.

The cost structure is governed by two parameters. The overage cost co = cost − salvage captures the loss per unit ordered but not sold at full price. The underage cost cu = price − cost captures the lost profit per unit of demand that goes unfilled. The optimal order quantity Q* satisfies the critical fractile condition:

Newsvendor Optimality Condition find   Q*   // optimal order quantity
such that   P(D ≤ Q*) = cu / (cu + co)   // critical fractile

where
  cu = price − cost   // underage cost (lost profit per unit)
  co = cost − salvage   // overage cost (loss per unsold unit)
  D   // random demand (observed from historical scenarios)

The critical ratio cu/(cu + co) represents the optimal service level — the probability of having enough stock to meet demand. When underage cost is high relative to overage cost (high-margin products), the ratio is close to 1, favoring larger orders. When overage cost dominates (low-margin, highly perishable items), the ratio drops and the store orders conservatively.

Educational Demonstration
Cost parameters and demand scenarios below are illustrative examples for a fresh bread ordering problem. Real grocery operations involve additional factors such as supplier lead times, minimum order quantities, and multi-product shelf space constraints.

Try It Yourself

Optimize a fresh bread ordering decision

Newsvendor Solver

15 scenarios · Click any cell to edit
Day Demand (units)
Critical Fractile exact
Grid Search exact
Algorithm Optimal Q* Critical Ratio Exp. Profit ($) Exp. Waste (units) Exp. Shortage (units) Service Level Time
Select algorithms and click Solve to optimize the order quantity.

The Algorithms

Two exact methods for the discrete newsvendor problem

Critical Fractile

Exact — O(S log S)

The classical closed-form solution to the newsvendor problem. Compute the underage cost cu = price − cost and overage cost co = cost − salvage, then form the critical ratio. Sort the historical demand scenarios in ascending order to build the empirical CDF. The optimal order quantity Q* is the smallest demand value where the CDF reaches or exceeds the critical ratio.

cu = price - cost
co = cost - salvage
critical ratio = cu / (cu + co)
Q* = min { q : P(D ≤ q) ≥ critical ratio }
E[profit] = (1/S) Σs [ price · min(Q, ds) + salvage · max(0, Q - ds) - cost · Q ]

Grid Search

Exact — O(S × G)

A brute-force enumeration approach. Evaluate the expected profit for every candidate order quantity Q from min(demands) to max(demands). For each Q, compute the average profit across all scenarios: revenue from sales, salvage from leftovers, minus procurement cost. Select the Q that maximizes expected profit. This method always agrees with the critical fractile solution and additionally reveals the full profit curve, showing how expected profit varies with the order quantity.

for Q = min(d) to max(d):
  E[profit(Q)] = (1/S) Σs [ price · min(Q, ds) + salvage · max(0, Q - ds) - cost · Q ]
Q* = argmax E[profit(Q)]

Why It's More Complex

Real-world extensions beyond the basic model

Beyond the Single-Product Newsvendor

  • Multiple products sharing shelf space — bakery, dairy, and produce compete for limited refrigerated display area, coupling their ordering decisions
  • Supplier quantity discounts — volume-based pricing tiers create non-convex cost structures that break the simple critical fractile solution
  • Multi-period ordering — products with 2–3 day shelf life carry leftover inventory into the next period, linking daily decisions
  • Demand correlation between products — bread and butter sales are correlated; a joint ordering model captures substitution and complementarity effects
  • Substitution effects — when whole wheat bread is out of stock, some customers switch to white bread, creating demand spillover
  • Seasonal trends and promotions — holiday demand spikes, weekly patterns (weekend vs. weekday), and promotional events make historical demand non-stationary

Key References

Foundational literature on the newsvendor problem

  • Arrow, K. J., Harris, T., & Marschak, J. (1951). "Optimal inventory policy." Econometrica, 19(3), 250–272. — Foundational paper establishing the critical fractile solution for single-period inventory under uncertainty.
  • Qin, Y., Wang, R., Vakharia, A. J., Chen, Y., & Seref, M. M. H. (2011). "The newsvendor problem: Review and directions for future research." European Journal of Operational Research, 213(2), 361–374. — Comprehensive survey covering extensions, behavioral aspects, and computational approaches.

Need to optimize inventory decisions?

From single-product newsvendor models to multi-echelon supply chain optimization, operations research provides the mathematical framework for data-driven inventory management.

Disclaimer
Data shown is illustrative. Cost parameters, demand scenarios, and results are simplified examples intended for educational purposes. Real-world grocery ordering involves additional operational constraints not captured in this demonstration.
Portfolio
ESC