Unexpected Behavior with Heuristic Solutions and Callbacks in Gurobi
Awaiting user inputI've encountered an issue with my Gurobi model where heuristic solutions found during the solving process do not seem to trigger the callback function. I've inserted 'cout' statements within my callback to log activity, but these do not appear in the logs, leading me to suspect that Gurobi may not be processing heuristic MIP solutions for the addition of lazy constraints. Has anyone else experienced this, and how might I resolve it? (I'm using Gurobi 11.)
Additionally, I noticed a significant speed increase in the solver when I disable the presolve option. It seems that the root node's lower bound is much larger (minimizing), which I assume contributes to the increased speed. Is this a normal occurrence? Any insights would be greatly appreciated!
-
Did you set the parameter LazyConstraints=1 to tell the solver that the callback should be called for each newly found solution? See also this article.
If yes, can you create an MRE so that we can reproduce the behavior on our side?
Disabling presolving can indeed help in some cases since it changes the model structure and the solver's solution path. Obtaining a weaker dual bound with presolving is, however, rare. Usually, it is the opposite. Could you post the relevant parts of the two solver logs?
0
Please sign in to leave a comment.
Comments
1 comment