Skip to main content

why using gurobi solver in loop could cause increase the optimisation time.

Answered

Comments

4 comments

  • Jaromił Najman
    • Gurobi Staff

    Could you please provide more information about how exactly you execute the loop and what you did before. A small code example would be best, cf. minimal reproducible example. In particular what do you change in the loop, i.e., how do you modify your model(s) at each iteration. Without the additional information, one could only start guessing what might have gone wrong.

    0
  • Cass C
    • Gurobi-versary
    • Curious
    • Conversationalist

    Hi Jaromił Najman

    Many thanks for the reply.

    I have went through some documents which mentioned, the reason might be the MIP. By using an automated solve loop, this may cause Gurobi to reuse older heuristic solutions, leading to increased solve time.

    So it would be excellent if the model can be reset to the initial status after each running. But I have no idea how to implement this.

    0
  • Riley Clement
    • Gurobi Staff

    Hi Cass,

    Model.reset() sounds like what you are looking for.

    - Riley

    0
  • Cass C
    • Gurobi-versary
    • Curious
    • Conversationalist

    Hi, Riley, many thanks for this. It indeed solved my trouble. I put it in the wrong location before and that was why I got some issues.

    Best 

    0

Please sign in to leave a comment.