Skip to main content

Family 7 · OR Problem Family

Inventory & Lot Sizing

Problems of determining the timing and quantity of replenishment decisions over a planning horizon, balancing holding costs, setup costs, and ordering costs under deterministic or stochastic demand.

Economic Order Quantity

EOQ — Harris (1913)
18 Tests 3 Variants Closed-Form O(1)

A retailer faces constant demand rate D and must decide the order quantity Q to minimize total annual cost, which comprises ordering cost (fixed cost K per order) and holding cost (h per unit per year). The classic EOQ formula Q* = √(2DK/h) yields the optimal trade-off. Extensions handle planned backorders (adjusting the formula by a factor (h+b)/b) and all-units quantity discounts (evaluating the EOQ at each price tier).

Mathematical Formulation TC(Q) = (D/Q) · K + (Q/2) · h
Q* = √(2DK / h)
TC* = √(2DKh)

With Planned Backorders Q* = √(2DK/h · (h+b)/b)
Closed-Form Continuous Review Deterministic Demand Backorders Quantity Discounts
Algorithm Type Complexity Reference
Classic EOQ Formula Exact O(1) Harris (1913)
Backorder EOQ Formula Exact O(1) Hadley & Whitin (1963)
Discount Evaluation Exact O(B log B) Benton & Park (1996)
View EOQ Source

Dynamic Lot Sizing

Uncapacitated Lot Sizing — Silver-Meal / PPB
18 Tests 3 Algorithms O(T²) Exact

Given a planning horizon of T periods with time-varying demands dt, ordering costs Kt, and holding costs ht, determine when and how much to order in each period to minimize total cost. The Zero Inventory Ordering (ZIO) property holds at optimality: orders are placed only when inventory reaches zero, reducing the search space from continuous quantities to binary order/no-order decisions per period.

DP Formulation (ZIO Property) f(t) = min1 ≤ i ≤ t { f(i−1) + C(i, t) },   f(0) = 0
C(i, j) = Ki + ∑k=i+1..j hk−1 · ∑ℓ=k..j d

Flow Balance It = It−1 + xt − dt ≥ 0   ∀ t
Dynamic Programming ZIO Property Time-Varying Demand Greedy Heuristics
Algorithm Type Complexity Reference
Wagner-Whitin DP Exact O(T²) Wagner & Whitin (1958)
Silver-Meal Heuristic Heuristic O(T²) worst Silver & Meal (1973)
Part-Period Balancing Heuristic O(T²) worst DeMatteis (1968)
Silver-Meal Intuition Starting from the first uncovered period, extend the order to cover additional periods as long as the average cost per period decreases. When it increases, place the order and start a new one. Part-Period Balancing uses the EOQ insight that total cost is minimized when cumulative holding cost approximately equals the ordering cost.
View Lot Sizing Source

Wagner-Whitin Lot Sizing

Wagner-Whitin DP — O(T²) Exact
13 Tests 1 Algorithm Polynomial Exact

A dedicated implementation of the Wagner-Whitin dynamic programming algorithm for the uncapacitated lot sizing problem. Exploits the ZIO property: at optimality, It−1 · xt = 0 for all t — either inventory entering a period is zero (so we order) or production is zero (we carry inventory). This reduces the search space and enables a clean O(T²) forward DP. The Aggarwal-Park (1993) improvement further reduces complexity to O(T) using the SMAWK technique.

DP Recurrence f(j) = min1 ≤ i ≤ j { f(i−1) + Ki + ∑k=i..j−1 hk · ∑ℓ=k+1..j d }
f(0) = 0

ZIO Property It−1 · xt = 0   ∀ t   (order only when inventory is zero)
Dynamic Programming ZIO Property Deterministic Demand Optimal
Algorithm Type Complexity Reference
Wagner-Whitin DP Exact O(T²) Wagner & Whitin (1958)
View Wagner-Whitin Source

Capacitated Lot Sizing

CLSP — NP-hard (Florian, Lenstra & Rinnooy Kan, 1980)
47 Tests 3 Algorithms NP-hard

Extends the uncapacitated lot sizing problem with production capacity constraints Ct per period. Decision variables include production quantities xt and binary setup indicators yt. The capacity linking constraint xt ≤ Ct · yt couples the continuous and binary variables, making the problem NP-hard even for constant costs and capacities. The MILP formulation uses 3T variables and is solved via SciPy HiGHS.

MILP Formulation min ∑t [ Kt yt + vt xt + ht It ]
s.t. It−1 + xt = dt + It   ∀ t   (flow balance)
     xt ≤ Ct · yt   ∀ t   (capacity linking)
     xt, It ≥ 0,   yt ∈ {0, 1}
MILP NP-Hard Capacity Constraints Setup Costs Production Planning
Algorithm Type Complexity Reference
MIP (SciPy HiGHS) Exact Exponential worst Standard MILP formulation
Greedy Lot-for-Lot Heuristic O(T) Produce exactly dt each period
Greedy Forward Heuristic O(T²) Extend production to future periods
Lot-Shifting Heuristic Phase 1: Start with lot-for-lot baseline (xt = dt).
Phase 2: Iterate backward, shifting production to earlier periods with spare capacity when the setup cost saved exceeds the incremental holding cost. This reduces setup frequency while respecting capacity constraints.
View CLSP Source

Multi-Echelon Inventory Optimization

Serial Supply Chain — Clark-Scarf Decomposition
17 Tests 3 Algorithms NP-hard (general networks)

A serial supply chain with L echelons, where each echelon has holding costs, ordering costs, and lead times. The goal is to set base-stock levels S at each echelon to minimize total expected holding cost while meeting the target service level at the customer-facing echelon. The cumulative lead time from echelon ℓ to the customer determines the demand variability each echelon must buffer against.

Echelon Base-Stock Policy L = ∑k=1..ℓ τk   (cumulative lead time)
σL = σD · √L
S = μD · L + zSL · σD · √L
where zSL = Φ−1(SL)
Supply Chain Base-Stock Policy Service Level Serial System Powers-of-Two
Algorithm Type Complexity Reference
Echelon Base-Stock Heuristic O(L) Clark & Scarf (1960)
Powers-of-Two Policy Heuristic O(L log R) Roundy (1985), ≤ 2% above optimal
Greedy Allocation Heuristic O(L · n) Greedy safety stock across echelons
Why Multi-Echelon Matters Setting safety stock independently at each echelon leads to double-counting of uncertainty buffers. Echelon-based policies coordinate inventory across the chain: the upstream echelon only buffers against the incremental lead-time uncertainty it adds, not the total. Roundy's powers-of-two policy achieves near-optimal cost with the practical constraint of nested reorder intervals.
View Multi-Echelon Source

Safety Stock Optimization

ROP / SS — Analytical Formulas, O(n)
14 Tests 1 Algorithm Closed-Form O(n)

For each of n SKUs with stochastic demand and lead time, compute the safety stock level and reorder point (ROP) to achieve a target cycle service level. The key quantity is the standard deviation of demand during lead time (σDDLT), which accounts for both demand uncertainty and lead-time variability through the convolution of independent random variables.

Demand During Lead Time σDDLT = √(μL · σD² + μD² · σL²)

Safety Stock and Reorder Point SS = z · σDDLT = Φ−1(SL) · σDDLT
ROP = μD · μL + SS
Reorder Point Service Level Stochastic Demand Lead-Time Variability Closed-Form
Algorithm Type Complexity Reference
Analytical SS Formulas Exact O(n) Silver, Pyke & Thomas (2016)
When Lead-Time Variability is Negligible When σL ≈ 0, the DDLT formula simplifies to σDDLT = σD · √μL. For fill-rate (Type II) service, the safety stock calculation requires the unit normal loss function G(z) rather than Φ−1(SL).
View Safety Stock Source

Vehicle / Container Loading

Dual-Capacity Bin Packing — NP-hard
12 Tests 1 Algorithm NP-hard

Given n items with weights wi and volumes vi, and vehicles with weight capacity W and volume capacity V, assign each item to a vehicle to minimize the number of vehicles used. This generalizes 1D bin packing with dual capacity constraints — each assignment must respect both the weight and volume limits simultaneously.

MILP Formulation min ∑k yk
s.t. ∑k xik = 1   ∀ i   (each item assigned once)
     ∑i wi xik ≤ W · yk   ∀ k   (weight capacity)
     ∑i vi xik ≤ V · yk   ∀ k   (volume capacity)
     xik ∈ {0,1},   yk ∈ {0,1}
Bin Packing Dual Capacity NP-Hard Logistics Vehicle Loading
Algorithm Type Complexity Reference
First-Fit Decreasing (Dual) Heuristic O(n²) Christensen et al. (2017)
FFD Dual-Capacity Strategy Sort items by weight descending. For each item, assign it to the first vehicle with sufficient remaining weight and volume capacity. If no vehicle fits, open a new one. This extends the classic FFD heuristic for 1D bin packing to handle the two-dimensional feasibility check at each assignment step.
View Vehicle Loading Source