# Callback information about parent in B&B tree

**URL:** <https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [July 20, 2018, 9:35pm UTC](https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546 "2018-07-20T21:35:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [July 22, 2018, 10:14pm UTC](https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546/4 "2018-07-22T22:14:49Z")

</div>

You should be aware that the upcoming release of JuMP will not support solver independent callbacks. See

> [@Cutting plane algorithm performance varies with Gurobi and CPLEX](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/2):
>
> Callbacks are tied in very deeply to how a MIP solver works, and they’re just not the same across solvers. (This took some experience to discover.) In JuMP 0.19 we will no longer be providing solver-independent callbacks for this reason; they create a false expectation that you can abstract away the solver when you implement the callbacks. The replacement will be solver-specific callbacks that expose the same interface as the low-level API.

However, at present you can get the CPLEX model from a JuMP model as follows

```julia
m = Model(solver=CplexSolver())
# ... some stuff like @variable and @constraint...
JuMP.build(m)
cpx_mpb = JuMP.internalmodel(m)
# cpx_mpb is a CplexMathProgModel, see
# https://github.com/JuliaOpt/CPLEX.jl/blob/ad35be73747ba144fc67a685d4f0caee780a8c1d/src/CplexSolverInterface.jl#L3
cpx = cpx_mpb.inner 
# cpx is a CPLEX Model, see
# https://github.com/JuliaOpt/CPLEX.jl/blob/ad35be73747ba144fc67a685d4f0caee780a8c1d/src/cpx_model.jl#L1

```

You can then use the (wrapped) CPLEX C API to add branch callbacks etc.

---

_[View the full topic](https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546)._
