Skip to main content

Injecting Heuristic Solution with Callback is Very Slow

Ongoing

Comments

6 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Philip,

    It is possible that all available threads are occupied by a heuristic, thus resulting in a long waiting time for information to be processed to the main thread. You could try disabling all heuristics by setting Heuristics=0 and or MIPFocus=3. This will turn off the searches for feasible points and should get to your callback quicker.

    Best regards,
    Jaromił

    0
  • Philip Taffet
    Gurobi-versary
    Conversationalist
    Curious

    Hi Jaromił,

    Thanks for the response. I tried the two parameter settings you suggested, and it they did not help. The first MIPNODE callback happened 1300s after the root relaxation finished, and >1 hour into the solve, it still has not terminated, in spite of the callback providing an optimal solution.

    I am happy to share the model and code to reproduce the issue.

    Thanks,

    Philip

    0
  • Philip Taffet
    Gurobi-versary
    Conversationalist
    Curious

    Setting Cuts=0, it solves in about an hour, but it still does not seem to be using my heuristic solution, in spite of returning the correct objective from cbUseSolution()



    Nodes | Current Node | Objective Bounds | Work
    Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time

    0 0 20.00000 0 9729 - 20.00000 - - 394s
    H 0 0 30.0000000 20.00000 33.3% - 793s
    MIPNODE at 803.6793129444122
    Solution objective value: 20.0
    0 0 20.00000 0 9729 30.00000 20.00000 33.3% - 836s
    MIPNODE at 837.3833448886871
    Solution objective value: 20.0
    MIPNODE at 2788.5118820667267
    Solution objective value: 20.0
    H 0 2 20.0000000 20.00000 0.00% - 2816s
    0 2 20.00000 0 9729 20.00000 20.00000 0.00% - 2816s

    Explored 1 nodes (226447 simplex iterations) in 2817.82 seconds
    Thread count was 32 (of 96 available processors)

    Solution count 2: 20 30

    Optimal solution found (tolerance 1.00e-04)
    Best objective 2.000000000000e+01, best bound 2.000000000000e+01, gap 0.0000%

    User-callback calls 167689, time in user-callback 75.82 sec

    So updating the two problems with this information:

    • Gurobi accepts an optimal heuristic solution (as determined by cbUseSolution) but then ignores it (at least for 2000s)
    • Gurobi spends a lot of time making fruitless attempts to make cuts on this problem

    The second problem may just be something strange with my model, but the first problem seems to be a real issue to me.

    0
  • Tobias Achterberg
    Gurobi Staff Gurobi Staff

    I think that you have just hit a small quirk in our callback behavior at the root node. Namely, the solution *is* accepted, but at the time the next log line directly after the callback invocation is printed, this solution is not yet integrated into the global data structures. Hence, you only see your solution at the next log line. Unfortunately, in your case the next log line comes 2000 seconds later.

    This is a behavior that we have already fixed in our development code. So, with the next minor/major version of Gurobi this should no longer happen.

    Regards,

    Tobias

    0
  • Philip Taffet
    Gurobi-versary
    Conversationalist
    Curious

    Hi Tobias,

    Thanks, that makes sense. I'm looking forward to the fix.

    Thanks,

    Philip

    0
  • Mike Lang
    Gurobi-versary
    Conversationalist
    First Question

    Dear all, 

    was this issue resolved? I have found the same or a very similar problem that I cannot solve:

    https://support.gurobi.com/hc/en-us/community/posts/4408074414353-Callback-on-MIPNODE-is-late-or-slow 

    Thank you

    Mike

    0

Please sign in to leave a comment.