# Get branch-and-bound node depth with JuMP

**URL:** <https://discourse.julialang.org/t/get-branch-and-bound-node-depth-with-jump/71128>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package, jump, optimization\
**Created:** [November 8, 2021, 6:50am UTC](https://discourse.julialang.org/t/get-branch-and-bound-node-depth-with-jump/71128 "2021-11-08T06:50:29Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 15, 2021, 6:09am UTC](https://discourse.julialang.org/t/get-branch-and-bound-node-depth-with-jump/71128/11 "2021-11-15T06:09:12Z")

</div>

> CPXcallbackgetinfolong(cb\_data, CPXCALLBACKINFO\_NODEDEPTH, depth)

You need to check the return code to see if the call succeeded. I’m guessing it didn’t. Probably because there was no node and the problem was solved at the root node via heuristics?

More generally, you need to read the CPLEX documentation in more detail: [IBM Documentation](https://www.ibm.com/docs/en/icos/20.1.0?topic=manual-cpxcallbackinfo)

You say you only want to add cuts at the root, but `CPX_CALLBACKCONTEXT_CANDIDATE` indicates that you have a valid integer solution. Perhaps you want `CPXCALLBACKINFO_NODECOUNT` or `CPXCALLBACKINFO_NODEUID`? instead?

---

_[View the full topic](https://discourse.julialang.org/t/get-branch-and-bound-node-depth-with-jump/71128)._
