How do I specify the algorithm used to solve my model in pyomo?
AnsweredI want to designate the algorithm used (https://www.gurobi.com/documentation/9.1/refman/method.html#parameter:Method), but I am not sure where I specify this parameter. I think that it should be included somewhere in these two lines of code:
solver = po.SolverFactory('gurobi')
result = solver.solve(model, tee = True)
All syntax combinations that I have tried have caused errors.
1
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
You can specify solver parameters in the solver object's options dictionary:
solver.options['Method'] = 1
This is covered in the Sending Options to the Solver section of the Pyomo documentation.
0
Post is closed for comments.
Comments
2 comments