# Locally solved status with Gurobi

**URL:** <https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539>\
**Category:** Optimization (Mathematical)\
**Tags:** gurobi\
**Created:** [March 12, 2024, 9:35pm UTC](https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539 "2024-03-12T21:35:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![math\_opt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math_opt/32/25317_2.png) [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Post date:** [March 12, 2024, 9:35pm UTC](https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539/1 "2024-03-12T21:35:08Z")

</div>

I am solving some LPs using Gurobi and the interior point method and without crossover. I notice that it returns the solution to be suboptimal and terminates with status `LOCALLY_SOLVED`, which, according to [documentation](https://jump.dev/JuMP.jl/stable/manual/solutions/#Why-did-the-solver-stop?), means _the solver found a locally optimal solution (which may also be globally optimal, but it could not prove so)._ Why is Gurobi unable to prove optimality (being a global solver)? Note that it doesn’t hit the time limit. I am probably missing something trivial here, but any help is appreciated. Optimization problems are part of the subproblems in an algorithm, so I am unable to provide a MWE here. Thanks!

---

<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 12, 2024, 9:55pm UTC](https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539/2 "2024-03-12T21:55:29Z")

</div>

We’re just working on a change for this:

- [Strange reporting with respect to feasibility · Issue #546 · jump-dev/Gurobi.jl · GitHub](https://github.com/jump-dev/Gurobi.jl/issues/546)
- [Check feasibility of solutions in PrimalStatus and DualStatus by odow · Pull Request #548 · jump-dev/Gurobi.jl · GitHub](https://github.com/jump-dev/Gurobi.jl/pull/548)

But I haven’t made a new release yet.

`LOCALLY_SOLVED` maps to [Gurobi’s `SUBOPTIMAL` status](https://www.gurobi.com/documentation/current/refman/optimization_status_codes.html):

> <https://github.com/jump-dev/Gurobi.jl/blob/1892ca0aaa622943c3efec42516818c905f46471/src/MOI_wrapper/MOI_wrapper.jl#L2767-L2770>

---

<div class="post-metadata">

**Author:** ![math\_opt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math_opt/32/25317_2.png) [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Post date:** [March 12, 2024, 10:30pm UTC](https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539/3 "2024-03-12T22:30:09Z")

</div>

Sounds good. Thanks!

---

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [April 4, 2025, 4:46am UTC](https://discourse.julialang.org/t/locally-solved-status-with-gurobi/111539/4 "2025-04-04T04:46:51Z")

</div>

It’s probably not under the default setting.  
I guess that the setting was  
`set_attribute(model, "Crossover", 0)` in conjunction with  
`set_attribute(model, "Method", 2)`.
