Solver performance tuning
Your model runs four hours, and your operation needs it in four minutes. The cause is usually how the model is written, and we fix that.
- Free 30-minute call
- No commitment
- You own the code
In short: Solver performance tuning means making an optimisation model compute faster, mostly by improving its formulation, how the problem is written as maths. With a better formulation, the plan is ready when you need it.
The problem
You have a solver licence. Your model starts at midnight and still hasn’t finished when the planning window closes at 6. Your IT team suggests a faster server. It buys you very little.
What changes
Today, you wait for the run and hope it finishes in time. With our solution, we rewrite the same model so it computes faster. That is how it finishes inside your planning window. You keep your solver and your licence, and you need no new infrastructure. How much faster it gets depends on your model, so we measure before we promise anything.
How it works
The wins come from the formulation, meaning how your problem is written as maths. The licence and the machine matter far less. Solvers first solve a simpler version of the problem that allows fractions, such as half a truck. It’s called the linear programming (LP) relaxation, and it shows how good a plan can get at best. The closer this simpler version is to the full problem, the faster the search ends. So we rewrite the model to bring the two closer together.
Often two plans are the same, only with the names swapped, like truck 1 and truck 2. We add rules so the solver checks such plans only once. We add valid inequalities, extra rules that cut off fractional answers without losing any workable plan. Benders decomposition settles the big decisions first and checks the detail separately. Warm starts give the solver a good plan to start from.
Why one tuning run can fool you
Gurobi ships a tuning tool, and it’s worth running. Read its documentation first, though. A solver starts its search from a random number, the random seed. Changing only this number or the order of the constraints can send the search down a different path. Gurobi reports cases where such a small change made the solve time a hundred times longer or shorter. So a setting that wins once may just have been lucky.
We tune the way the documentation suggests. Each setting runs several trials with different seeds, and the tuning tool’s command line takes several models at once. On top of that, we use a set of your past days, the easy ones and the hard ones. Gurobi’s documentation also states that tuning doesn’t replace good modelling, which is why we start with the formulation. On CPLEX models, we test the same way. The honest boundary: if the problem itself has changed since the model was built, tuning won’t help. Then the model needs a new formulation, and we say so.
When it isn’t the answer
The honest boundary: if the problem itself has changed since the model was built, tuning won’t help. Then the model needs a new formulation, and we say so.
Common questions.
Something else? Ask us directly.
Run it, but not on a single case. Give it several representative models and several trials per setting. Each trial starts from a different random number, the random seed, so one lucky start doesn’t pick the winner. Set a time limit per solve and for the whole run. Then check the suggested settings on cases it hasn’t seen.
Because the search path is fragile. A solver starts its search from a random number, the random seed. Gurobi’s documentation describes how a different seed or a different order of the constraints can change the path. In some cases, the solve time was a hundred times longer or shorter. Your data changes a little every day, which has the same effect. A sound model shows smaller swings, which is one more reason we fix the formulation first.
The gap is how far the best plan found may still be from the best possible. Accept the gap whose possible saving is worth less than the extra waiting. If 1% of a weekly plan is worth less than another hour of run time, stop at 1%. It’s a business decision, so we set it with you, not by default.
Sometimes they can, and then we’ll say so. Standard tools are built for an average problem, though. With Solver performance tuning, 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