Skip to main content

Difference between two-step and single-step optimization

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Hi Mohammad,

    Yes, optimizing a model in two steps like this can affect the solution returned by Gurobi. With the first approach, Gurobi performs a single solve with a time limit of one hour and optimality tolerance of 1%. With the second approach, Gurobi uses a different time limit and optimality tolerance, then warm-starts the second solve with the best solution it found. You are really solving the problem in two different ways, so it could happen that you obtain different solutions at different times.

    I'll note that optimizing in this way does not affect the optimal solution(s) to your problem. Gurobi may return different solutions (even with the same value of MIPGap), because there may be multiple feasible solutions that satisfy your optimality tolerances, as small as they might be.

    Also, this two-step approach might sometimes produce high-quality solutions faster, but this of course will not always be the case.

    Thanks,

    Eli

    0
  • Mohammadamin Edrisi
    Gurobi-versary
    First Comment
    First Question

    Hi Eli, 

    Thanks for your comprehensive response! 

    Best,

    Mohammad

    0

Post is closed for comments.