# Cutting plane algorithm performance varies with Gurobi and CPLEX

**URL:** https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597
**Category:** Optimization (Mathematical)
**Created:** [January 25, 2018, 4:54pm UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597 "2018-01-25T16:54:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![varun7rs](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@varun7rs](https://discourse.julialang.org/u/varun7rs)
#### Post date: [January 25, 2018, 4:54pm UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/1 "2018-01-25T16:54:29Z")

</div>

I’ve implemented a cutting plane algorithm (using lazy callback mechanism) to robustify the solution obtained from the deterministic MIP akin to the work “Reformulation versus cutting-planes for robust optimization”. What I observed here was that CPLEX quite often returned a solution with a bad optimality gap while Gurobi couldn’t find even a feasible solution for the same problem. The only change that I perform to the code is that I replace the name of the solver from CPLEX to Gurobi. Apart from that, the logic remains untouched. Could you please throw some pointers regarding this issue?

---

<div class="post-metadata">

### Author: ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)
#### Post date: [January 25, 2018, 10:14pm UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/2 "2018-01-25T22:14:07Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)
#### Post date: [January 26, 2018, 8:28am UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/3 "2018-01-26T08:28:25Z")

</div>

In addition, there is a lot _performance variability_ in MIP solving, even before you add callbacks.  
That’s also why there is no clear winner in MIP benchmarks.

---

<div class="post-metadata">

### Author: ![bbrunaud](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bbrunaud/32/1737_2.png) [@bbrunaud](https://discourse.julialang.org/u/bbrunaud)
#### Post date: [March 9, 2018, 5:10pm UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/4 "2018-03-09T17:10:34Z")

</div>

I understand the variability issues. But why kill the whole thing all together?. I really love that it is so simple to implement a callback in JuMP 0.18. By moving to lower level things will only become more complicated. Would it be too much to keep the callback interface?.

---

<div class="post-metadata">

### Author: ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)
#### Post date: [March 12, 2018, 9:38am UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/5 "2018-03-12T09:38:16Z")

</div>

Solver-independent callbacks can still be implemented by an extension of JuMP. I think the point is to not offer them _officially_ because the actual behavior is not really solver-independent.

---

<div class="post-metadata">

### Author: ![varun7rs](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@varun7rs](https://discourse.julialang.org/u/varun7rs)
#### Post date: [March 12, 2018, 4:33pm UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/6 "2018-03-12T16:33:56Z")

</div>

Would it be possible to add solver-dependent callbacks in JuMP 0.18? An example would be very helpful.

---

<div class="post-metadata">

### Author: ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)
#### Post date: [March 13, 2018, 7:46am UTC](https://discourse.julialang.org/t/cutting-plane-algorithm-performance-varies-with-gurobi-and-cplex/8597/7 "2018-03-13T07:46:50Z")

</div>

I’m guessing you would just use the _direct_ solver code, not the MathProgBase wrapper.  
I have not done that before, but I would start looking here: [https://github.com/JuliaOpt/CPLEX.jl/blob/master/src/cpx\_callbacks.jl](https://github.com/JuliaOpt/CPLEX.jl/blob/master/src/cpx_callbacks.jl)
