Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13921

How to stop glpk solver after presolve stage and use the result after the presolve stage in Pyomo

$
0
0

I want to stop the optimization using glpk solver in Pyomo after very first iterations because after the solution is not getting better and use this value as the result of my model. How is it possible to do that in Pyomo? Setting options as mipgap or tmlim do not help at all. On the screenshot I want to stop my solver right after 1811 and use this value as the result of my objective function.

solver = SolverFactory("glpk")# solver.options["mipgap"] = 100# solver.options["tmlim"] = 2results = solver.solve(pyomo_model, options={"seed": PYOMO_SEED}, tee=True)results.write()

enter image description here


Viewing all articles
Browse latest Browse all 13921

Trending Articles