Skip to main content

Multiple stopping criteria from matlab

Answered

Comments

2 comments

  • Maliheh Aramon
    • Gurobi Staff 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

Please sign in to leave a comment.