Skip to main content

Got different results for the same case in two different platforms.




  • Thomas Opfer
    Thought Leader

    The documentation says:

    • The MIP solver will terminate (with an optimal result) when the gap between the lower and upper objective bound is less than MIPGap times the absolute value of the upper bound.
    • The MIP solver will terminate (with an optimal result) when the gap between the lower and upper objective bound is less than MIPGapAbs.

    While I am not sure, I think it is sufficient if one of these criteria is fulfilled.

    Of course, it can happen that the solver has different solutions on different platforms. Still, if you set both gaps to zero (and if there are no other termination criteria), you should get the same objective value (if no numerical problems are present).

  • Sonja Mars
    Gurobi Staff Gurobi Staff


    Yes, Thomas is correct, the solver will stop if one termination criterion is fulfilled.


    The same is true if you for example set a time limit to 100 seconds and a MIP gap of 1%. It the solver reaches 1% after 60 seconds it will stop, and if the solver still has 5% gap after 100 seconds it will also stop.

    Best regards,


  • Greg Glockner
    Gurobi Staff Gurobi Staff

    You may also want to see this knowledge base article: "Is Gurobi Optimizer deterministic". (Sorry it wasn't visible when you wrote your post).


  • Arezoo Jafari
    First Question

    Hi Greg,

    I noticed your post regarding "Is Gurobi Optimizer deterministic" and you mentioned that  -->

    "if you change any inputs, including small changes like:

    • Parameter values
    • Rounding of coefficients
    • Order of variables or constraints
    • Initial point

    Then you may get different results, even if everything else remains the same."

    I faced a similar problem with solving a two-stage stochastic model. I solved the model using Benders decomposition. The first time I solved the model and got results and objective value. The second time I solved the same model with similar input parameters and forced it to have the same solution but the objective function was different. The results of the model include decision variables such as Xs, sigma, gamma, and Z. I forced the model to get the exact values for Xs and solved the model for the second time. It seems that I changed the initial point in the second model. Do you think different initial points cause this behavior? How can I fix it?


Please sign in to leave a comment.