Your Forecast Is Accurate, but Decisions Still Happen in Excel
Here is a familiar scene at companies that have adopted demand forecasting. The system produces next week's sales forecast for every store. Then a planner spends hours in a spreadsheet working out how many cases to ship from which warehouse to which store. However accurate the forecast is, the decision on the floor stays the same.
This gap is usually where machine learning projects stall. The step that turns predictions into decisions is still done by hand.
Where Mathematical Optimization Fits Best
Mixed-integer linear programming (MILP) works especially well for recurring decisions like these:
What these problems share is a long list of constraints and options that grow combinatorially. With just 3 DCs, 40 stores, and 200 SKUs, you already have 3 × 40 × 200 = 24,000 allocation variables. A planner can find a reasonable answer in Excel, but there's no way to know whether a better one exists.
Three Building Blocks of a Model
Every optimization model has three parts.
Some business rules are easy to miss when you turn them into constraints. A minimum order quantity often means "order in whole case multiples, and either order nothing or order at least 500 units." That calls for a binary variable. Exception suppliers and customers bring rules like "this vendor only delivers on Tuesdays" or "this store ships only from its assigned DC," and those rules often live only in a planner's head. When a model returns an unrealistic plan, a missing rule like this is usually the cause.
Choosing a Solver and Managing Run Time
Solvers fall into two broad camps:
We recommend building the model on an open-source solver first and measuring solve times on real data. Look at commercial solvers only if the problem can't be solved within your operating window.
In production, getting a good-enough solution within a fixed time matters more than proving mathematical optimality. A rule such as "stop at 120 seconds or once the MIP gap is under 1%" keeps results reliable even in a daily early-morning batch.
Connecting Forecasts to Optimization
If you feed the optimizer a single point forecast, it treats that number as certain and allocates stock too tightly. There are two common ways to account for uncertainty:
The results screen matters just as much. Planners should be able to approve or adjust recommendations and record why they made a change. Frequent overrides point to rules the model is missing, so that log is where model improvement begins.
Start Small
POLYGLOTSOFT supports the full build of data and optimization systems, from demand forecasting models to MILP-based optimization engines and the screens where planners review and approve results. If you already have forecasts but your decisions still happen in Excel, let's start by modeling one recurring decision together.
