Adding Constraint in a Loop; Turn off 'Warm Start'
AnsweredHi,
I have an algorithm which contains a loop. At each iteration, I calculate some parameter values and add a new constraint to the existing model and solve. The way I implement it is: I initiate a model (let's call it m) outside the loop. And within the loop, I add a new constraint by calling m.addConstr and then m.optimize(). However, the model now uses the solution from the previous iteration. Is there any way I can turn off this 'warm start' and let the model just forget the solution from last iteration?
I am on gurobipy. Thanks.
-
Official comment
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Wenbo,
Is there any way I can turn off this 'warm start' and let the model just forget the solution from last iteration?
You can either set the LPWarmStart parameter to 0 or call the model.reset() method.
Best regards,
Jaromił0
Post is closed for comments.
Comments
2 comments