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

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.

1 Like

Drop the objective function?


Use SolutionLimit

set_optimizer_attribute(model, "SolutionLimit", 1)
1 Like

Thanks a lot! It works fine.