Try our new documentation site (beta).


Constants

The following list contains the set of constants needed by the Gurobi Java interface. You would refer to them using a GRB. prefix (e.g., GRB.Status.OPTIMAL).

  // Model status codes (after call to optimize())

  public class Status {
    public static final int LOADED          = 1;
    public static final int OPTIMAL         = 2;
    public static final int INFEASIBLE      = 3;
    public static final int INF_OR_UNBD     = 4;
    public static final int UNBOUNDED       = 5;
    public static final int CUTOFF          = 6;
    public static final int ITERATION_LIMIT = 7;
    public static final int NODE_LIMIT      = 8;
    public static final int TIME_LIMIT      = 9;
    public static final int SOLUTION_LIMIT  = 10;
    public static final int INTERRUPTED     = 11;
    public static final int NUMERIC         = 12;
    public static final int SUBOPTIMAL      = 13;
    public static final int INPROGRESS      = 14;
  }

  // Basis status info

  public static final int BASIC           = 0;
  public static final int NONBASIC_LOWER  = -1;
  public static final int NONBASIC_UPPER  = -2;
  public static final int SUPERBASIC      = -3;

  // Constraint senses

  public static final char LESS_EQUAL    = '<';
  public static final char GREATER_EQUAL = '>';
  public static final char EQUAL         = '=';

  // Variable types

  public static final char CONTINUOUS   = 'C';
  public static final char BINARY       = 'B';
  public static final char INTEGER      = 'I';
  public static final char SEMICONT     = 'S';
  public static final char SEMIINT      = 'N';

  // Objective sense

  public static final int MINIMIZE = 1;
  public static final int MAXIMIZE = -1;

  // SOS types

  public static final int SOS_TYPE1      = 1;
  public static final int SOS_TYPE2      = 2;

  // Numeric constants

  public static final double INFINITY    = 1e100;
  public static final double UNDEFINED   = 1e101;

  // Callback constants

  public class Callback {
    public static final int POLLING       =     0;
    public static final int PRESOLVE      =     1;
    public static final int SIMPLEX       =     2;
    public static final int MIP           =     3;
    public static final int MIPSOL        =     4;
    public static final int MIPNODE       =     5;
    public static final int MESSAGE       =     6;
    public static final int BARRIER       =     7;
    public static final int PRE_COLDEL    =  1000;
    public static final int PRE_ROWDEL    =  1001;
    public static final int PRE_SENCHG    =  1002;
    public static final int PRE_BNDCHG    =  1003;
    public static final int PRE_COECHG    =  1004;
    public static final int SPX_ITRCNT    =  2000;
    public static final int SPX_OBJVAL    =  2001;
    public static final int SPX_PRIMINF   =  2002;
    public static final int SPX_DUALINF   =  2003;
    public static final int SPX_ISPERT    =  2004;
    public static final int MIP_OBJBST    =  3000;
    public static final int MIP_OBJBND    =  3001;
    public static final int MIP_NODCNT    =  3002;
    public static final int MIP_SOLCNT    =  3003;
    public static final int MIP_CUTCNT    =  3004;
    public static final int MIP_NODLFT    =  3005;
    public static final int MIP_ITRCNT    =  3006;
    public static final int MIPSOL_SOL    =  4001;
    public static final int MIPSOL_OBJ    =  4002;
    public static final int MIPSOL_OBJBST =  4003;
    public static final int MIPSOL_OBJBND =  4004;
    public static final int MIPSOL_NODCNT =  4005;
    public static final int MIPSOL_SOLCNT =  4006;
    public static final int MIPNODE_STATUS=  5001;
    public static final int MIPNODE_REL   =  5002;
    public static final int MIPNODE_OBJBST=  5003;
    public static final int MIPNODE_OBJBND=  5004;
    public static final int MIPNODE_NODCNT=  5005;
    public static final int MIPNODE_SOLCNT=  5006;
    public static final int MSG_STRING    =  6001;
    public static final int RUNTIME       =  6002;
    public static final int BARRIER_ITRCNT  = 7001;
    public static final int BARRIER_PRIMOBJ = 7002;
    public static final int BARRIER_DUALOBJ = 7003;
    public static final int BARRIER_PRIMINF = 7004;
    public static final int BARRIER_DUALINF = 7005;
    public static final int BARRIER_COMPL   = 7006;
  }

  // Errors

  public class Error {
    public static final int OUT_OF_MEMORY            = 10001;
    public static final int NULL_ARGUMENT            = 10002;
    public static final int INVALID_ARGUMENT         = 10003;
    public static final int UNKNOWN_ATTRIBUTE        = 10004;
    public static final int DATA_NOT_AVAILABLE       = 10005;
    public static final int INDEX_OUT_OF_RANGE       = 10006;
    public static final int UNKNOWN_PARAMETER        = 10007;
    public static final int VALUE_OUT_OF_RANGE       = 10008;
    public static final int NO_LICENSE               = 10009;
    public static final int SIZE_LIMIT_EXCEEDED      = 10010;
    public static final int CALLBACK                 = 10011;
    public static final int FILE_READ                = 10012;
    public static final int FILE_WRITE               = 10013;
    public static final int NUMERIC                  = 10014;
    public static final int IIS_NOT_INFEASIBLE       = 10015;
    public static final int NOT_FOR_MIP              = 10016;
    public static final int OPTIMIZATION_IN_PROGRESS = 10017;
    public static final int DUPLICATES               = 10018;
    public static final int NODEFILE                 = 10019;
    public static final int Q_NOT_PSD                = 10020;
    public static final int QCP_EQUALITY_CONSTRAINT  = 10021;
    public static final int NETWORK                  = 10022;
    public static final int JOB_REJECTED             = 10023;
    public static final int NOT_SUPPORTED            = 10024;
    public static final int NOT_IN_MODEL             = 20001;
    public static final int FAILED_TO_CREATE_MODEL   = 20002;
    public static final int INTERNAL                 = 20003;
  }

  public static final int CUTS_AUTO           = -1;
  public static final int CUTS_OFF            = 0;
  public static final int CUTS_CONSERVATIVE   = 1;
  public static final int CUTS_AGGRESSIVE     = 2;
  public static final int CUTS_VERYAGGRESSIVE = 3;

  public static final int METHOD_AUTO                     = -1;
  public static final int METHOD_PRIMAL                   = 0;
  public static final int METHOD_DUAL                     = 1;
  public static final int METHOD_BARRIER                  = 2;
  public static final int METHOD_CONCURRENT               = 3;
  public static final int METHOD_DETERMINISTIC_CONCURRENT = 4;

  public static final int BARORDER_AUTOMATIC        = 0;
  public static final int BARORDER_AMD              = 1;
  public static final int BARORDER_NESTEDDISSECTION = 2;

  public static final int FEASRELAX_LINEAR      = 0;
  public static final int FEASRELAX_QUADRATIC   = 1;
  public static final int FEASRELAX_CARDINALITY = 2;

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