Skip to main content

Why does my optimization model's solution vary in a for-loop, despite the loop parameter not being in the model?

Awaiting user input


1 comment

  • Maliheh Aramon
    Gurobi Staff Gurobi Staff

     Hi Karl, 

    If the same model is solved with the same parameters on the same hardware, the solution path should not change regardless of how many times you solve it. However, traversing the same solution path does not necessarily mean that Gurobi would stop at the same solution point, If you use a non-deterministic termination criterion such as TimeLimit, the exact point in the search tree where Gurobi stops in each run might differ because the exact number of CPU cycles your machine gives to Gurobi might differ in each run depending on the status of the other processes running on your machine. 

    What termination criteria are you using? In case you are using TimeLimit, you can consider setting the WorkLimit parameter instead which is deterministic.

    Env.alpha = alpha

    What is the Env object here? Is this a Gurobi Environment object?

    Best regards,



Please sign in to leave a comment.