Demand is known but costs trade off: produce too much and you tie up cash; too little and setup costs explode. The classical lot-sizing problem offers an answer from 1958.
In plain words
Sound familiar?
- Setup takes 2-3 hours, production takes 1; starting a batch is half a day โ small batches waste time, big batches inflate inventory.
- The weekly production plan lives in a spreadsheet; each week the operations manager picks batch size by intuition.
- Raw material warehouse is full but when a customer orders, the right material is missing; we say 'we'll deliver next week' and lose customers.
- Seasonal product; demand peaks Jan-Mar and dips Apr-Jun; we can't stockpile enough going into the season and we miss it.
- Six-month-old products sit in finished-goods warehouse; we mark them down for obsolescence.
- We have 8 products with different molds; we pick the production order and batch size by intuition.
- The ERP runs MRP but ignores setup cost; every week it suggests small batches and multiplies setups.
Why it matters
How it's solved
Technical depth
How it's solved
Technical depthOne-liner: Every batch start carries a fixed setup cost; every unit produced-but-not-sold pays holding cost each week. The balance: the batch size is right when setup cost equals the holding cost across the next N weeks. Off-balance gives you either small batch ร frequent setups, or big batch ร bloated stock.
In operations research (a discipline that uses math and computing to solve business-decision problems) literature this is the Lot Sizing Problem. Variants: single-product / deterministic (Wagner-Whitin, polynomial โ solvable in reasonable time even at scale), single-product / capacitated (CLSP, NP-hard โ at large scale, the exact optimum is out of reach in reasonable time), multi-product / capacitated (Multi-Item CLSP), multi-level (Multi-Level / MRP-based). The solution is three-stage:
1. Modeling. Planning horizon (4-12 weeks typical), per-period demand, per-period unit production cost, per-period setup cost (mold change, line setup, calibration), unit inventory holding cost, capacity (machine-hour, labor-hour per period) if capacitated, start and end inventory. Multi-product adds a setup time matrix (transition from product A to B).
2. Solver-driven plan. Wagner-Whitin solves single-product / uncapacitated / deterministic to optimality in seconds via DP. For capacitated multi-product, MIP formulation or relax & fix, Dantzig-Wolfe decomposition. Industry-common heuristics: Silver-Meal (easy to implement), Part-Period Balancing, Least Unit Cost. Output: which product, how much, in which week (lot size and timing).
3. Field integration. Output becomes weekly work orders written to ERP / MES. Raw material requirements explode backward (MRP logic), supplier orders are triggered. The production line schedules setups (mold changes, cleaning) accordingly. Daily production lists reach the operator via tablet or printer."
Alternatives
Manual + spreadsheet + production manager's experience
FreeFree
Who it fits: Single product or 2-3 SKUs, very stable demand
- + Zero cost
- + Flexible, accommodates last-minute changes
- + Good outcome with an experienced production manager
- โ Becomes unmanageable beyond 5 SKUs
- โ Setup-vs-inventory trade-off is intuitive
- โ Knowledge lives in the individual; lost on turnover
- โ Seasonality and promotions hard to plan
ERP MRP module
Enterprise30,000โ120,000 TRY license + 6,000โ15,000 TRY/year maintenance (TR market observation)
Who it fits: Medium-scale manufacturer, 10-100 SKUs
- + ERP-integrated โ order, stock, sales on one system
- + Local-language support
- + Reorder point + lot-for-lot, EOQ, POQ options
- โ Advanced algorithms like Wagner-Whitin usually missing
- โ Setup-vs-inventory optimization weak
- โ Multi-level capacitated weak
International specialized APS (Advanced Planning System)
Enterprise30,000โ200,000 EUR license + 10,000โ30,000 EUR/year
Who it fits: Large scale, multi-product / multi-line / multi-location
- + MIP/CP-based optimization
- + Capacitated multi-level scenarios
- + What-if scenarios, seasonal planning, S&OP integration
- โ Expensive
- โ 6-12 month deployment
- โ ERP integration is its own project
Open-source solvers + custom application
Open SourceLicense free; in-house build 10-16 weeks or 250K-800K TRY consulting
Who it fits: SMB with technology team and many custom constraints
- + No license, unlimited customization
- + Mature open-source MIP solvers sufficient
- + Business rules in code
- โ In-house OR/software capacity required
- โ Ongoing maintenance
- โ Visualization UI built separately
Recommendation
Ask in the meeting
- Do you support Wagner-Whitin or a comparable dynamic programming algorithm?
- Can setup cost be modeled per product and per transition (sequence-dependent setup)?
- Do you solve capacitated multi-product (CLSP)? Do you use a MIP or CP solver?
- Are seasonality and promotion windows supported via what-if scenarios?
- Which protocols for ERP / MES integration? Are work orders triggered automatically?
- What planning horizon (4-12 weeks typical)? Is rolling horizon supported?
- Can we run a 4-8 week pilot with real demand data during the trial?
- If we stop working with you, how do we get product master data and historical production plans back in a standard format?
Technical details
Editor’s note
Colloquially this is called “batch size”, “production-order size”, or “MRP planning”. Academically it’s the Lot Sizing Problem (LSP). The classical EOQ (Economic Order Quantity) formula from Harris (1913) is static / continuous-time; real production has period-by-period changing demand, which is why Wagner-Whitin’s dynamic version (1958) was built. Not knowing the two are distinct, you’d take “we compute EOQ” at face value from a vendor โ what you actually need is period-by-period lot sizing.
The most-skipped point in the industry: the true setup cost. Most SMBs say “setup is 1-2 hours” and move on. But during setup the machine is idle, the operator is busy, consumables are used, and the first part is often scrap during calibration โ true setup cost is usually 2-3ร the stated number. Wrong setup cost โ wrong lot size.
Step-by-step path โ for the SMB
Stage 1 โ Measure first, plan after. At least 8 weeks of data: weekly production per SKU, setup time + cost (actual), unit production cost, holding cost (% per year), fill rate. With seasonality, prefer 1 year.
Stage 2 โ Extract the knowledge asset. Product master data, setup matrix (AโB transition time + cost), capacities (machine-hour/week, labor-hour/week), demand forecast (incl. seasonality).
Stage 3 โ Pilot. 8-12 weeks. Start with 5-10 SKUs. Success criteria defined in advance: cost per setup -10% minimum, inventory turn +15% minimum, fill rate preserved. Production manager and planner as “champions”.
Stage 4 โ Roll-out. 3-6 months across all SKUs. ERP / MES integration closed. Monthly S&OP cycle: forecast โ lot size โ capacity.
Risks โ what can go wrong
- Demand forecast error. Wagner-Whitin assumes deterministic demand; in reality forecasts are wrong. If error >20% the lot-size decision is wrong. Fix: rolling horizon (re-plan weekly) + safety stock.
- Wrong setup cost input. Measured values, not gut feel. Typical underestimate: 50% understated โ algorithm suggests tiny lots.
- Operator resistance. “A computer can’t tell me what to produce” is frequent. Position the output as advisory during the pilot.
- Single-vendor lock-in. Demand history and production plans are knowledge assets. Contract must include “standard format export rights”.
Solution method โ a technical look
| Approach | Typical scale | Solve time | Guaranteed optimum? |
|---|---|---|---|
| Wagner-Whitin (single product, uncapacitated) | T = 50-100 periods | seconds | Yes (DP) |
| EOQ / continuous approx | Single product, stable demand | instant | No (static) |
| Silver-Meal / Part-Period heuristic | Single/multi-product | seconds | No, 85-95% optimum |
| MIP (CLSP) | 10-50 SKUs, T = 12-26 weeks | minutes | Yes (within limit) |
| Lagrangean / Relax & Fix | 100+ SKUs, multi-level | minutes-hours | No, 95-98% |
Objective function choice:
- Objective 1 โ Total cost (setup + holding + production): Standard.
- Objective 2 โ Maximize fill rate: When stockout penalty is heavy.
- Objective 3 โ Capacity smoothing: When line utilization is the priority.
- Objective 4 โ Output per setup (OEE-like): Efficiency focus.
For multi-objective, use weighted-sum or hierarchical (satisfy #2 first, then minimize #1).
Academic references
See the sources field in the frontmatter.
Sources
- Wagner, H. M. and Whitin, T. M. (1958). Dynamic version of the economic lot size model. Management Science, 5(1), 89โ96. Foundational paper of the lot-sizing literature.
- Florian, M., Lenstra, J. K. and Rinnooy Kan, A. H. G. (1980). Deterministic production planning: Algorithms and complexity. Management Science, 26(7), 669โ679. Complexity of the capacitated version.
- Silver, E. A. and Meal, H. C. (1973). A heuristic for selecting lot size requirements for the case of a deterministic time-varying demand rate and discrete opportunities for replenishment. Production and Inventory Management, 14(2), 64โ74. Practical heuristic.
- Turkish Statistical Institute โ Industrial Production Index (monthly). Reference for SMB production volatility.
- Turkish CoHE (YรK) Thesis Center โ keywords: ’lot size’ or ‘parti bรผyรผklรผฤรผ’ โ 60+ Turkish theses. tez.yok.gov.tr
Glossary
- Lot Sizing
- Determining how much to produce each period over a planning horizon, balancing setup and inventory holding costs.
- Wagner-Whitin Algorithm
- The classical dynamic-programming algorithm that solves the single-product, uncapacitated, deterministic lot-sizing problem to optimality.
Related problems
A New Part Order Arrives โ How Do I Get the Optimal Operation Sequence + Machine Choice + Setup?
If you are an SMB CNC manufacturer, tooling shop or engineering workshop producing 50-500 different parts, every new order puts the same decision in front of you: you take the customer's CAD model and have to work out on which machine, in which order, with which tool and fixture, and in how many setups the part will be made. If you simply write down the first feasible sequence that comes to mind, setup time grows 3-5x and parts that miss tolerance are reworked; finding the right sequence means comparing several alternative routings for the same part. When the decision lives only in one engineer's head, the similar-part memory walks out of the door when that engineer leaves, and routings of older parts are not refreshed when a new machine is bought. This page is for production-engineering teams who want to make the operation sequence and the machine assignment written and comparable as the bridge from design to make.
Backward from the Customer Order โ Which Raw Material, When, and How Much Should I Order?
For mid-size manufacturing SMBs running 50-500 end items and 200-2,000 raw materials and sub-components (automotive Tier-2, white-goods component shops, furniture and assembly, machinery). With each product's parts list (BOM) and each part's procurement or production lead time on file, the question is: a customer orders 200 units of product X with a fixed delivery week โ which raw materials in what quantity must be ordered which week, and which sub-parts must enter assembly when? Material requirements planning (academic name MRP) answers this question backwards from the delivery date and is the core logic underneath every ERP. Done on paper or by 'my supplier always takes 3 weeks' rules of thumb, you either run out and stop the line, or burn cash on excess stock.
Five Suppliers Quote the Same Part โ How Much Do I Buy from Each?
You run a manufacturer with 20-200 staff and buy the same raw material or component from 4-8 different suppliers. Each supplier differs on price, quality, lead time, capacity, payment terms, and financial stability; deciding who stays on the approved list and how much of each order goes to whom are two separate calls. A wrong pick can trigger a months-long quality crisis or stop the line when a single supplier fails; the 'cheapest bid wins' approach hides quality, late-delivery, and compliance costs and ends up 15-40% more expensive. Scoring 5-15 bids across 8-12 criteria by hand in a spreadsheet becomes inconsistent fast.