Setting optimality tolerance for Gurobi

Dear all,

I am struggling to figure out how to improve the tolerance of my Gurobi solver.
In the Gurobi docs the parameters “FeasiblityTol” and “OptimalityTol” can be set directly as a parameter, but when trying to set these via the cmdline_options in the solve function, they cannot be found (the solver_io is the default value “lp”)
Any tips or experiences?

All the best,


Good settings for energy system modelling for Gurobi:

Have a look at BarConvTol to control the convergence tolerance of the barrier/interior point algorithm.

1 Like

Hello Mo,

you are trying to solve an oemof.solph based model, right?
You can provide cmdline_options in the form of a dict. The Gurobi parames, e.g. FeasibilityTol and OptimalityTol and others can be used here as keys. I recommend to go with reasonable presets, such as the example from Fabian.


Quick Update:

Thanks first off to both Johannes and Fabian for your quick replies!
I was trying to solve an oemof.solph model and Johannes suggestion worked, but not to the expected effect, I would’ve expected the parameter to shave off a fair chunk of the runtime, but in total i think the savings were akin to around 2-5%, am I wrong to expect a significant improvement?

All the best,


Do you have experience with adjusting AggFill? What is the tradeoff between computational time and memory usage?

My experience is that we were worse off for both memory and time when not setting AggFill=0.