Skip to main content

Setting a time limit for cbUseSolution

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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi Thiago,

    It is not directly possible to set a time limit for the cbUseSolution function.

    However, setting StartNodeLimit to a small value, e.g., 10 or 100, might help in this case.

    Other than that, you could measure the time passed on a different thread and if some particular time is exceeded you could call the terminate() function. After the optimization has been terminated, you can then again call the optimize() function to proceed the optimization from the last point of termination. This is a rather tricky way and may take some time to make it work properly.

    I hope the above helps.

    Best regards,
    Jaromił

    0
  • Thiago Serra
    • Gurobi-versary
    • First Question
    • First Comment

    It does help. Thank you very much!

    0

Post is closed for comments.