# Gurobi local cuts

**URL:** <https://discourse.julialang.org/t/gurobi-local-cuts/21814>\
**Category:** Optimization (Mathematical)\
**Created:** [March 13, 2019, 11:39am UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814 "2019-03-13T11:39:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lefteris\_Manousakis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lefteris_manousakis/32/10832_2.png) [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Post date:** [March 13, 2019, 11:39am UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814/1 "2019-03-13T11:39:46Z")

</div>

HI everyone!

I am tryin to add local cut with Gurobi (Julia v0.6). Although it works with CPLEX is seems that Gurobi wrapper does not support local cuts.

_\> LoadError: e[91mMethodError: no method matching cbaddcutlocal!(::Gurobi.GurobiCallbackData, ::Array{Int32,1}, ::Array{Float64,1}, ::Char, ::Float64)e[0m_  
_\> Closest candidates are:_  
_\> cbaddcutlocal!(e[91m::MathProgBase.SolverInterface.LPQPWrapperCallbackDatae[39m, ::Any, ::Any, ::Any, ::Any) at C:\Users\Lefteris Manousakis.julia\v0.6\MathProgBase\src\SolverInterface\lpqp\_to\_conic.jl:335_  
_\> cbaddcutlocal!(e[91m::CPLEX.CplexCallbackDatae[39m, ::Any, ::Any, ::Any, ::Any) at C:\Users\Lefteris Manousakis.julia\v0.6\CPLEX\src\CplexSolverInterface.jl:446e[39m_

How can I fix this? IS Gurobi supporting local cuts in general (so can I write a function in the wrapper?  
Should I change the MPB or Gurobi pkg?

Thank you

---

<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:** [March 13, 2019, 12:22pm UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814/2 "2019-03-13T12:22:53Z")

</div>

I’m not sure if Gurobi supports local cuts. The first step would be to check that it is supported via the C API, and as a second step, implement the required changes in the Gurobi.jl wrapper.

---

<div class="post-metadata">

**Author:** ![joehuchette](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joehuchette/32/32_2.png) [@joehuchette](https://discourse.julialang.org/u/joehuchette)\
**Post date:** [March 13, 2019, 12:52pm UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814/3 "2019-03-13T12:52:03Z")

</div>

Gurobi doesn’t support local cuts, unfortunately.

---

<div class="post-metadata">

**Author:** ![Lefteris\_Manousakis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lefteris_manousakis/32/10832_2.png) [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Post date:** [March 13, 2019, 12:57pm UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814/4 "2019-03-13T12:57:39Z")

</div>

Thank you both for the immediate replies. I modified the wrapper and I also discovered that tha C API does not support local cuts. Does that mean that in Gurobi we cannot add for example local cuts for routing problems ( Subtour separation, capacity cuts, etc). Is there a workaround for this?

I am PhD student working on optimization problems in the field of transportation and logistics, and in my current problem I have found Gurobi to be a lot faster than CPLEX. So, I wouldn’t like to go back to using CPLEX. For the time being I perform the separation and adding cuts only at the root node, where the cuts are global, so no problem occurs.

---

<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:** [March 13, 2019, 1:42pm UTC](https://discourse.julialang.org/t/gurobi-local-cuts/21814/5 "2019-03-13T13:42:04Z")

</div>

> Is there a workaround for this?

Unfortunately, no.
