Get current BnB node depth
AnsweredHi all,
Is there any way of getting the current node depth in the GRBCallback? I know that it is possible to get the node count using GRB_CB_MIPNODE_NODCNT, and that if this count is zero, then we are at the root. But I would like to also get the current node depth in the callback. The purpose for this is because I want to add some cuts only if the depth of the node is less than a given parameter.
Thanks,
Matheus
-
Official comment
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?. -
Hi Matheous,
Unfortunately the only information avaliable during callbacks is detailed here:
https://www.gurobi.com/documentation/8.1/refman/callback_codes.html
Daniel
0 -
I have found myself with the same problem. Is there any implementation through Python/Gurobi to obtain this parameter (node_depth)?
If at least I could know which are the parent nodes of the current node (NODCNT parameter of the callback) I suppose I could implement myself, is there a way of knowing such parameters?
Thanks in advance.
0 -
Hi Alberto,
This information is not available, unfortunately.
Best regards,
Matthias0 -
Are there any plans to implement a function like "m.cbGetNodeDepth" anytime soon? Also, What does gurobi use as reference to print "node depth" in the model log while optimizing?
Thanks!
Nicolas
0
Post is closed for comments.
Comments
6 comments