Skip to main content

Multiple stopping criteria from matlab

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Maliheh Aramon
    • Gurobi Staff
    Hi Johan, 
     
    The function in Matlab API to optimize a model is gurobi(model, params). Calling this function for the second time will not resume the optimization run from the point at which the run is terminated/interrupted. However, you can provide the solution found in the previous run as a MIP start for the second run.
     
    For the use-case you described, you can implement something like below:
    model = gurobi_read(filename);
    params.TimeLimit = 150;
    result = gurobi(model, params);
    if result.mipgap > desired_MIPGap
    params.TimeLimit = 5000;
    model.start = result.x;
    result = gurobi(model, params);
    end
     
    Best regards,
    Maliheh
     
    0
  • Johan Gustafsson
    • Gurobi-versary
    • Curious
    • Conversationalist

    Hi Maliheh,

    Thank you, that makes a lot of sense, I will try this!

    Best,

    Johan

    0

Post is closed for comments.