In Gurobi, is it possible to see if a group of constraints and variables are feasible without actually optimizing the problem? It seems if the objective is a constant, Gurobi still does a lot of heavy computation to find an optimal solution, which I don't need!
Asked
Active
Viewed 1,214 times
2 Answers
2
Sorry. Except for very easy infeasibilities that can be detected in the presolver, Gurobi may have to do lots of work to prove whether the model is feasible or infeasible. No silver bullets here.

Erwin Kalvelagen
- 15,677
- 2
- 14
- 39
-
Thanks! Is there a way to make it faster? – mnmp Mar 02 '16 at 08:18
-
I am not sure if this helpful, but Gurobi has a heuristic to help find integer feasible solutions called the feasibility pump. Setting PumpPasses can help in some cases when it is very difficult to find a feasible integer solution. I don't think it will help at all in proving quickly the model is infeasible. – Erwin Kalvelagen Mar 02 '16 at 08:24
0
I am not sure if there is a better way to do this, but you can use either solution limits or time limits to stop the solver once a condition is met.
For example:
model.Params.SolutionLimit = n
stops the solver once n solutions have been found.
model.Params.SolutionLimit = n
stops the solver once it has run for n seconds too.
You can look at this gurobi parameters page for more info here

Mançaux Pierre-Alexandre
- 858
- 1
- 11
- 42