I believe this is an easy question but I couldn't find any related post. In my branch-and-cut, below is how I code the user cut callback
if where == GRB.Callback.MIPNODE:
status = MyModel.cbGet(GRB.Callback.MIPNODE_STATUS)
if status == GRB.OPTIMAL:
My understanding is that Gurobi execute this user cut callback in every node. What if I just want my user cut to be added at root node only (as many as possible) to strengthen the LP relaxation bound and then start the regular branch-and-cut process (with GRB cuts only) without user cut callback on all the leaf nodes? Also, how to set a specific condition to force Gurobi to branch after adding user cut on root node only? For example, say if the violation is less than a threshold, then I want Gurobi to stop adding user cuts on root node and start branching.
Could you please let me know what parameter I should change? Thank you.
Please sign in to leave a comment.