# Stop Criteria using JuMP with Gurobi when find the first feasible solution

**URL:** <https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, gurobi\
**Created:** [August 24, 2022, 1:39pm UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262 "2022-08-24T13:39:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luiz\_Monteiro](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Post date:** [August 24, 2022, 1:39pm UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262/1 "2022-08-24T13:39:45Z")

</div>

Hello! I have a MILP problem and I am using Gurobi solver through JuMP in Julia Language. I want to stop the model run when the solver find the first feasible solution. Is there a way to set the stop criteria with this criteria? Thank you.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [August 24, 2022, 4:34pm UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262/2 "2022-08-24T16:34:37Z")

</div>

Drop the objective function?

---

<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:** [August 24, 2022, 9:45pm UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262/3 "2022-08-24T21:45:47Z")

</div>

Use [SolutionLimit](https://www.gurobi.com/documentation/9.5/refman/solutionlimit.html)

```julia
set_optimizer_attribute(model, "SolutionLimit", 1)

```

---

<div class="post-metadata">

**Author:** ![Luiz\_Monteiro](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Post date:** [August 25, 2022, 12:12am UTC](https://discourse.julialang.org/t/stop-criteria-using-jump-with-gurobi-when-find-the-first-feasible-solution/86262/4 "2022-08-25T00:12:02Z")

</div>

Thanks a lot! It works fine.
