# Optimization Status Codes

Filter Content By
Version
Languages

## 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
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.