If the result that Gurobi returns is not one that you expected, the first step is to identify the type of wrong result.
Some common situations:
- Gurobi says the model is infeasible, but you expect it to be feasible.
- Gurobi returns a solution with an unexpected optimal objective value.
- Gurobi returns a solution with unexpected variable values.
- Gurobi returns two different solutions for the same problem.
Gurobi reports that the model is infeasible, but you expect it to be feasible.
The reason we see most often for this issue is a user modeling error. A common one is when the users have not explicitly set a lower bound on variables; the default lower bound in Gurobi is 0.0 not -INF.
Of course, there can be other reasons for this, such as numerical issues in the model, and we have provided several Knowledge Base articles to help you diagnose the infeasibility.
- Why does Gurobi report my model is infeasible when it has a feasible solution?
- How do I resolve the error "Model is infeasible or unbounded"?
- How do I determine why my model is infeasible?
- How do I use 'compute IIS' to find a subset of constraints that are causing model infeasibility?
- How do I change variable and/or constraint bounds to make an infeasible model feasible using feasRelax?
Gurobi returns a solution with an unexpected optimal objective value.
Some common reasons for this issue are using the wrong objective sense (min vs max; default sense in Gurobi is min) and numerical issues with the model.
- How do I diagnose a suboptimal objective value returned as optimal by Gurobi?
- How do I diagnose a wrong solution?
Gurobi returns a solution with unexpected variable values.
A common reason for this is that Gurobi does not round solution values for integer variables.
- Why does Gurobi sometimes return non-integral values for integer variables?
- How do I diagnose a wrong solution?
Gurobi returns two different solutions for the same problem.
Gurobi returns optimal solutions with respect to the tolerances defined by the parameters MIPGap and MIPGapAbs unless there are other user-defined termination criteria. So, it is possible to get two different solutions within the MIPGap and MIPGapAbs tolerances if the solver follows a different solution path, for instance, when solving on different machines.
While Gurobi can be deterministic, there are some guidelines that need to be followed in order to always return the same solution.
Comments
0 comments
Article is closed for comments.