Stochastic optimisation
Your plan is built for average demand, and demand is rarely average. Stochastic optimisation plans for the whole range, so your plan still works.
- Free 30-minute call
- No commitment
- You own the code
In short: Stochastic optimisation is planning with chance built in. Instead of one average forecast, the model uses the realistic range of demand or supply, and it picks the plan that works well across that whole range.
The problem
Your plan assumes one future: the average week. Then a supplier ships late, or demand jumps after a hot weekend. The plan has no room for it, so you improvise with rush orders and overtime. Deterministic planning, which plans for one fixed number, fails in exactly the weeks that cost most.
What changes
Today, you plan for the average and pay for every surprise with rush orders. With our model, the plan already allows for the range of demand and supply you face in practice. In calm weeks, you pay a little for a reserve, such as extra stock. In bad weeks, you avoid the expensive rush orders. You see in numbers what the reserve costs and what it saves, before you commit.
Is it worth it for you? Measure it first
Plenty of pages explain stochastic optimisation. Few tell you how to check whether you need it. In optimisation, the measure for this is called the value of the stochastic solution (VSS). Take the plan built for average demand. Test it on several weeks that could happen: calm ones, busy ones and one with a late supplier. These possible weeks are called scenarios. Then compare what this plan costs with what the plan built for the whole range costs.
Say the average-demand plan costs 112,000 francs a week across the scenarios, and the stochastic plan 104,000. The difference of 8,000 francs is the VSS, what planning for the range is worth to you. If the difference comes out small, stay deterministic. One experienced answer on Operations Research Stack Exchange guesses that most optimisation work in practice ignores uncertainty, because fixed values are good enough. Often they are, and the VSS shows you which case you’re in.
How it works
Stochastic optimisation plans with chance built in. We model how much your demand and supply have varied in the past. Two-stage stochastic programming splits the decision: you commit to some choices now and adjust others once demand is known. Robust optimisation (min-max) picks the plan whose worst case does the least damage.
Chance-constrained programming keeps a rule true with a set probability, say no empty shelf in 19 weeks out of 20. Scenario trees map how the future can branch, week by week. In Python, we build this with stochastic extensions of Pyomo and CVXPY, two modelling libraries. For many scenarios, we use mpi-sppy, another Python library. It splits a Pyomo model by scenario and solves the pieces at the same time. The honest boundary: when variability is small or cheap to absorb, a deterministic model is simpler and good enough. Then that’s what we recommend.
When it isn’t the answer
The honest boundary: when variability is small or cheap to absorb, a deterministic model is simpler and good enough. Then that’s what we recommend.
Common questions.
Something else? Ask us directly.
Stochastic optimisation assumes you can estimate how likely each outcome is. It then looks for the plan with the lowest cost on average over all outcomes. Robust optimisation doesn’t need those odds. You set a range of possible values, and the plan stays workable for every value in it, including the least favourable one. A widely read answer on Operations Research Stack Exchange explains the difference the same way. With good history, stochastic usually fits, and with little data, robust is safer.
Enough that the plan stops changing. A scenario is one possible course of events, such as a week with high demand. We solve the model with several different sets of scenarios, all of the same size. If today’s decisions and the average cost barely change, the number is big enough. If they change a lot from set to set, we add scenarios. Or we pick fewer scenarios that still cover the same range as your past data.
Mostly from your own history. Past weeks of demand, supplier lead times or no-shows become scenarios. Each scenario gets a weight that says how likely it is. Where two things move together, such as heat and drink sales, we keep them together. Where you have little past data, we say so. Then we plan with a range of possible values and its least favourable one, instead of inventing odds.
Sometimes they can, and then we’ll say so. Standard tools are built for an average problem, though. With Stochastic optimisation, we start from yours: its size, its rules and the exceptions nobody wrote down. That is why the plan fits your operation better.
You don’t need either to start. We build the model from the data you’ve got, messy or not, and cleaning it up is part of the job. You get a documented system your team can maintain, and we train them until they can run it long after we’ve left.
It starts with a free 30-minute call about your operation and the model that would fit it. Then we build a working prototype and run it on your numbers. You’ll see results before you commit to anything bigger.
Similar pages.
Terms on this page
Every abbreviation explained in plain words, in our article “Metrics and methods”.
Tell us what you’re planning.
In a free 30-minute call with a specialist, you find out whether optimisation can help.
- Free, no commitment
- You talk to a specialist directly
- A clear go or no-go