Try our new documentation site (beta).


Optimization Status Codes

Once an optimize call has returned, the Gurobi optimizer sets the Status attribute of the model to one of several possible values. The attribute takes an integer value, but we recommend that you use one of the pre-defined status constants to check the status in your program. Each code has a name, and each language requires a prefix on this name to obtain the appropriate constant. You would access status code OPTIMAL in the following ways from the available Gurobi interfaces:

Language Status Code
C GRB_OPTIMAL
C++ GRB_OPTIMAL
Java GRB.Status.OPTIMAL
.NET GRB.Status.OPTIMAL
Python GRB.OPTIMAL

Possible status codes are as follows:

Status code Value Description
LOADED 1 Model is loaded, but no solution information is available.
OPTIMAL 2 Model was solved to optimality (subject to tolerances), and an optimal solution is available.
INFEASIBLE 3 Model was proven to be infeasible.
INF_OR_UNBD 4 Model was proven to be either infeasible or unbounded. To obtain a more definitive conclusion, set the DualReductions parameter to 0 and reoptimize.
UNBOUNDED 5 Model was proven to be unbounded. Important note: an unbounded status indicates the presence of an unbounded ray that allows the objective to improve without limit. It says nothing about whether the model has a feasible solution. If you require information on feasibility, you should set the objective to zero and reoptimize.
CUTOFF 6 Optimal objective for model was proven to be worse than the value specified in the Cutoff parameter. No solution information is available.
ITERATION_LIMIT 7 Optimization terminated because the total number of simplex iterations performed exceeded the value specified in the IterationLimit parameter, or because the total number of barrier iterations exceeded the value specified in the BarIterLimit parameter.
NODE_LIMIT 8 Optimization terminated because the total number of branch-and-cut nodes explored exceeded the value specified in the NodeLimit parameter.
TIME_LIMIT 9 Optimization terminated because the time expended exceeded the value specified in the TimeLimit parameter.
SOLUTION_LIMIT 10 Optimization terminated because the number of solutions found reached the value specified in the SolutionLimit parameter.
INTERRUPTED 11 Optimization was terminated by the user.
NUMERIC 12 Optimization was terminated due to unrecoverable numerical difficulties.
SUBOPTIMAL 13 Unable to satisfy optimality tolerances; a sub-optimal solution is available.
INPROGRESS 14 An asynchronous optimization call was made, but the associated optimization run is not yet complete.
USER_OBJ_LIMIT 15 User specified an objective limit (a bound on either the best objective or the best bound), and that limit has been reached.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search

Gurobi Optimization