Gurobi/Pyomo Solver Options

2,859 views
Skip to first unread message

Ralf Növer

unread,
Apr 14, 2016, 3:23:32 AM4/14/16
to pyomo...@googlegroups.com
Hi,
since last week I'm trying to translate a Gurobipy script into pyomo. Currently I'm looking for a summary of the Pyomo solver-opions. I would be glad if someone could give me the pyomo-equivalents to the following Gurobipy-options:

MIPGap
Heuristics
MIPFocus
CutPasses
Threads
NodefileStart
NodefileDir
TimeLimit
LogFile


Besides, it would be good to know if there are any default values in the case of setting the options to "none".
And is there a possibilty to assign certain values directly to the SolverFactory-object like "opt.options.timelimit = 123"?

Thank you,

Ralf

Gabriel Hackebeil

unread,
Apr 14, 2016, 8:43:00 AM4/14/16
to pyomo...@googlegroups.com
The exact option name will depend on the interface that you use to a solver. For instance, if you use the NL-file interface to Gurobi, which you specify as

SolverFactory(“gurobi”, solver_io=“nl”)
or
SolverFactory(“gurobi_ampl”) ,

then an option like the mipgap will need to be set as

opt.options[‘mipgap’] = 0.05

If you use the Python interface to Gurobi, which you specify as

SolverFactory(“gurobi”, solver_io=“python”) ,

then you likely need to set the option as

opt.options[‘MIPGap’] = 0.05

Although, it is possible that the gurobipy interface ignores the case when you set an option name.

There are no default values for options on a solver. If you directly modify the options dictionary, like what is done above, those options will persist across every call to opt.solve(…) unless you delete them from the options dictionary. You can also pass a dictionary of options into the opt.solve(…) method using the “options” keyword. Those options will only persist within that solve and temporarily override any matching options in the options dictionary on the solver object.

Gabe

On Apr 14, 2016, at 12:22 AM, 'Ralf Növer' via Pyomo Forum <pyomo...@googlegroups.com> wrote:

Hi,
since last week I'm trying to translate a Gurobipy script into pyomo. Currently I'm looking for a summarize of the Pyomo solver-opions. I would be glad if someone could give me the pyomo-equivalents to the following Gurobipy-options:


MIPGap
Heuristics
MIPFocus
CutPasses
Threads
NodefileStart
NodefileDir
TimeLimit
LogFile


Besides, it would be good to know if there are any default values in the case of setting the options to "none".
And is there a possibilty to assign certain values directly to the SolverFactory-object like "opt.options.timelimit = 123"?

Thank you,

Ralf

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralf Növer

unread,
Apr 16, 2016, 8:50:35 AM4/16/16
to Pyomo Forum
Hi, thanks for your promt reply.
I'm using pyomo with the Python interface to Gurobi. So now I use the command opt.options[‘MIPGap’] = 0.05. If I understood you correctly, I can set the other options in the same way and their names are equal to the Gurobipy options, which I posted in my first post.

Ralf

Siirola, John D

unread,
Apr 16, 2016, 10:20:26 AM4/16/16
to pyomo...@googlegroups.com
Correct. We just pass whatever you set to the solver without changing it (or even looking at it). 

John
--
Reply all
Reply to author
Forward
0 new messages