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.
-
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
Please sign in to leave a comment.
Comments
1 comment