Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# GRB

GRB

  Class for .NET enums and constants. The enums are used to get or set Gurobi attributes or parameters.

  Constants

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

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

      /// <summary>
      /// Optimization status codes
      /// </summary>
      public class Status
      {
        /// <summary>
        /// Model is loaded, but no solution information is available.
        /// </summary>
        public const int LOADED = 1;

        /// <summary>
        /// Model was solved to optimality (subject to tolerances) and an optimal
        /// solution is available.
        /// </summary>
        public const int OPTIMAL = 2;

        /// <summary>
        /// Model was proven to be infeasible.
        /// </summary>
        public const int INFEASIBLE = 3;

        /// <summary>
        /// Model was proven to be either infeasible or unbounded.
        /// </summary>
        public const int INF_OR_UNBD = 4;

        /// <summary>
        /// Model was proven to be unbounded.
        /// </summary>
        public const int UNBOUNDED = 5;

        /// <summary>
        /// Optimal objective was proven to be worse than the value specified
        /// in the Cutoff parameter.
        /// </summary>
        public const int CUTOFF = 6;

        /// <summary>
        /// Optimization terminated because the total number of simplex
        /// iterations performed exceeded the limit specified in the IterationLimit
        /// parameter.
        /// </summary>
        public const int ITERATION_LIMIT = 7;

        /// <summary>
        /// Optimization terminated because the total number of branch-and-cut
        /// nodes explored exceeded the limit specified in the NodeLimit
        /// parameter.
        /// </summary>
        public const int NODE_LIMIT = 8;

        /// <summary>
        /// Optimization terminated because the total elapsed time
        /// exceeded the limit specified in the TimeLimit parameter.
        /// </summary>
        public const int TIME_LIMIT = 9;

        /// <summary>
        /// Optimization terminated because the number of solutions found
        /// reached the value specified in the SolutionLimit parameter.
        /// </summary>
        public const int SOLUTION_LIMIT = 10;

        /// <summary>
        /// Optimization was terminated by the user.
        /// </summary>
        public const int INTERRUPTED = 11;

        /// <summary>
        /// Optimization was terminated due to unrecoverable numerical
        /// difficulties.
        /// </summary>
        public const int NUMERIC = 12;

        /// <summary>
        /// Optimization terminated with a sub-optimal solution.
        /// </summary>
        public const int SUBOPTIMAL = 13;

        /// <summary>
        /// Optimization is still in progress.
        /// </summary>
        public const int INPROGRESS = 14;

        /// <summary>
        /// User specified objective limit (a bound on either the best objective
        /// or the best bound), and that limit has been reached.
        /// </summary>
        public const int USER_OBJ_LIMIT = 15;

        /// <summary>
        /// Optimization terminated because the total elapsed work
        /// exceeded the limit specified in the WorkLimit parameter.
        /// </summary>
        public const int WORK_LIMIT = 16;

        /// <summary>
        /// Optimization terminated because the total amount of allocated
        /// memory exceeded the limit specified in the SoftMemLimit parameter.
        /// </summary>
        public const int MEM_LIMIT = 17;

        /// <summary>
        /// Model was solved to local optimality (subject to tolerances) and
        /// a first-order optimal solution point is available.
        /// </summary>
        public const int LOCALLY_OPTIMAL = 18;

        /// <summary>
        /// A first-order minimizer of the constraint violation was found.
        /// </summary>
        public const int LOCALLY_INFEASIBLE = 19;
      }

      /// <summary>
      /// Batch status codes
      /// </summary>
      public class BatchStatus
      {

        /// <summary>
        /// Batch object was created, but is not ready to be scheduled.
        /// See the Batch Optimization section of the manual for more details.
        /// </summary>
        public const int CREATED   = 1;

        /// <summary>
        /// The Batch object has been completely specified, and now is waiting
        /// for a job to finish processing the request.
        /// See the Batch Optimization section of the manual for more details.
        /// </summary>
        public const int SUBMITTED = 2;

        /// <summary>
        /// Batch processing was aborted by the user.
        /// See the Batch Optimization section of the manual for more details.
        /// </summary>
        public const int ABORTED   = 3;

        /// <summary>
        /// Batch processing failed.
        /// See the Batch Optimization section of the manual for more details.
        /// </summary>
        public const int FAILED    = 4;

        /// <summary>
        /// A Batch Job successfully processed the Batch request.
        /// See the Batch Optimization section of the manual for more details.
        /// </summary>
        public const int COMPLETED = 5;
      }

      // Constraint senses

      /// <summary>
      /// Less or equal constraint sense.
      /// </summary>
      public const char LESS_EQUAL    = '<';
      /// <summary>
      /// Greater or equal constraint sense.
      /// </summary>
      public const char GREATER_EQUAL = '>';
      /// <summary>
      /// Equal constraint sense.
      /// </summary>
      public const char EQUAL         = '=';

      // Variable types

      /// <summary>
      /// Continuous variable.
      /// </summary>
      public const char CONTINUOUS   = 'C';
      /// <summary>
      /// Binary variable.
      /// </summary>
      public const char BINARY       = 'B';
      /// <summary>
      /// Integer variable.
      /// </summary>
      public const char INTEGER      = 'I';
      /// <summary>
      /// Semi-continuous variable.
      /// </summary>
      public const char SEMICONT     = 'S';
      /// <summary>
      /// Semi-integer variable.
      /// </summary>
      public const char SEMIINT      = 'N';

      // Objective sense

      /// <summary>
      /// Minimization objective.
      /// </summary>
      public const int MINIMIZE = 1;
      /// <summary>
      /// Maximization objective.
      /// </summary>
      public const int MAXIMIZE = -1;

      // SOS types

      /// <summary>
      /// SOS of type 1.
      /// </summary>
      public const int SOS_TYPE1      = 1;
      /// <summary>
      /// SOS of type 2.
      /// </summary>
      public const int SOS_TYPE2      = 2;

      // General constraint types

      /// <summary>
      /// General constraint maximum.
      /// </summary>
      public const int GENCONSTR_MAX       = 0;
      /// <summary>
      /// General constraint minimum.
      /// </summary>
      public const int GENCONSTR_MIN       = 1;
      /// <summary>
      /// General constraint absolute value.
      /// </summary>
      public const int GENCONSTR_ABS       = 2;
      /// <summary>
      /// General constraint logical AND.
      /// </summary>
      public const int GENCONSTR_AND       = 3;
      /// <summary>
      /// General constraint logical OR.
      /// </summary>
      public const int GENCONSTR_OR        = 4;
      /// <summary>
      /// General constraint norm.
      /// </summary>
      public const int GENCONSTR_NORM      = 5;
      /// <summary>
      /// General constraint nonlinear multivariate function.
      /// </summary>
      public const int GENCONSTR_NL        = 6;
      /// <summary>
      /// General constraint indicator.
      /// </summary>
      public const int GENCONSTR_INDICATOR = 7;
      /// <summary>
      /// General constraint piecewise-linear.
      /// </summary>
      public const int GENCONSTR_PWL       = 8;
      /// <summary>
      /// General constraint polynomial function.
      /// </summary>
      public const int GENCONSTR_POLY      = 9;
      /// <summary>
      /// General constraint natural exponential function.
      /// </summary>
      public const int GENCONSTR_EXP       = 10;
      /// <summary>
      /// General constraint exponential function.
      /// </summary>
      public const int GENCONSTR_EXPA      = 11;
      /// <summary>
      /// General constraint natural logarithmic function.
      /// </summary>
      public const int GENCONSTR_LOG       = 12;
      /// <summary>
      /// General constraint logarithmic function.
      /// </summary>
      public const int GENCONSTR_LOGA      = 13;
      /// <summary>
      /// General constraint power function.
      /// </summary>
      public const int GENCONSTR_POW       = 14;
      /// <summary>
      /// General constraint sine function.
      /// </summary>
      public const int GENCONSTR_SIN       = 15;
      /// <summary>
      /// General constraint cosine function.
      /// </summary>
      public const int GENCONSTR_COS       = 16;
      /// <summary>
      /// General constraint tangent function.
      /// </summary>
      public const int GENCONSTR_TAN       = 17;
      /// <summary>
      /// General constraint logistic function.
      /// </summary>
      public const int GENCONSTR_LOGISTIC  = 18;

      // Operation codes for general constraint nonlinear multivariate function

      /// <summary>
      /// Operation code for constant.
      /// </summary>
      public const int OPCODE_CONSTANT     = 0;
      /// <summary>
      /// Operation code for variable.
      /// </summary>
      public const int OPCODE_VARIABLE     = 1;
      /// <summary>
      /// Operation code for addition.
      /// </summary>
      public const int OPCODE_PLUS         = 2;
      /// <summary>
      /// Operation code for subtraction.
      /// </summary>
      public const int OPCODE_MINUS        = 3;
      /// <summary>
      /// Operation code for multiplication.
      /// </summary>
      public const int OPCODE_MULTIPLY     = 4;
      /// <summary>
      /// Operation code for division.
      /// </summary>
      public const int OPCODE_DIVIDE       = 5;
      /// <summary>
      /// Operation code for negation.
      /// </summary>
      public const int OPCODE_UMINUS       = 6;
      /// <summary>
      /// Operation code for square.
      /// </summary>
      public const int OPCODE_SQUARE       = 7;
      /// <summary>
      /// Operation code for square root.
      /// </summary>
      public const int OPCODE_SQRT         = 8;
      /// <summary>
      /// Operation code for sin.
      /// </summary>
      public const int OPCODE_SIN          = 9;
      /// <summary>
      /// Operation code for cos.
      /// </summary>
      public const int OPCODE_COS          = 10;
      /// <summary>
      /// Operation code for tan.
      /// </summary>
      public const int OPCODE_TAN          = 11;
      /// <summary>
      /// Operation code for the power function.
      /// </summary>
      public const int OPCODE_POW          = 12;
      /// <summary>
      /// Operation code for exp.
      /// </summary>
      public const int OPCODE_EXP          = 13;
      /// <summary>
      /// Operation code for log.
      /// </summary>
      public const int OPCODE_LOG          = 14;
      /// <summary>
      /// Operation code for log2.
      /// </summary>
      public const int OPCODE_LOG2         = 15;
      /// <summary>
      /// Operation code for log10.
      /// </summary>
      public const int OPCODE_LOG10        = 16;
      /// <summary>
      /// Operation code for logistic function.
      /// </summary>
      public const int OPCODE_LOGISTIC     = 17;
      /// <summary>
      /// Operation code for tanh function.
      /// </summary>
      public const int OPCODE_TANH         = 18;
      /// <summary>
      /// Operation code for signpow function.
      /// </summary>
      public const int OPCODE_SIGNPOW      = 19;

      // Basis status info

      /// <summary>
      /// Variable is basic.
      /// </summary>
      public const int BASIC           = 0;
      /// <summary>
      /// Variable is non-basic at lower bound.
      /// </summary>
      public const int NONBASIC_LOWER  = -1;
      /// <summary>
      /// Variable is non-basic at upper bound.
      /// </summary>
      public const int NONBASIC_UPPER  = -2;
      /// <summary>
      /// Variable is superbasic.
      /// </summary>
      public const int SUPERBASIC      = -3;

      // Numeric constants

      /// <summary>
      /// Infinity value.
      /// </summary>
      public const double INFINITY    = 1e100;
      /// <summary>
      /// Undefined value.
      /// </summary>
      public const double UNDEFINED   = 1e101;
      /// <summary>
      /// Maximum integer value.
      /// </summary>
      public const int    MAXINT      = 2000000000;

      // Limits

      /// <summary>
      /// Maximum string length.
      /// </summary>
      public const int MAX_STRLEN     = 512;
      /// <summary>
      /// Maximum name length.
      /// </summary>
      public const int MAX_NAMELEN    = 255;
      /// <summary>
      /// Maximum tag length.
      /// </summary>
      public const int MAX_TAGLEN     = 10240;
      /// <summary>
      /// Maximum concurrent threads.
      /// </summary>
      public const int MAX_CONCURRENT = 64;

      // Other constants

      /// <summary>
      /// Default compute server port.
      /// </summary>
      public const int DEFAULT_CS_PORT = 61000;

      // Version numbers

      /// <summary>
      /// Major number
      /// </summary>
      public const int VERSION_MAJOR     = 13;
      /// <summary>
      /// Minor number
      /// </summary>
      public const int VERSION_MINOR     = 0;
      /// <summary>
      /// Technical number
      /// </summary>
      public const int VERSION_TECHNICAL = 0;

      // Callback constants

      /// <summary>
      /// Gurobi callback codes.
      /// </summary>
      public class Callback
      {
        /// <summary>
        /// Periodic polling callback.
        /// </summary>
        public const int POLLING       =     0;

        /// <summary>
        /// Currently performing presolve.
        /// </summary>
        public const int PRESOLVE      =     1;

        /// <summary>
        /// Currently in simplex.
        /// </summary>
        public const int SIMPLEX       =     2;

        /// <summary>
        /// Currently in MIP.
        /// </summary>
        public const int MIP           =     3;

        /// <summary>
        /// Found a new MIP incumbent.
        /// </summary>
        public const int MIPSOL        =     4;

        /// <summary>
        /// Currently exploring a MIP node.
        /// </summary>
        public const int MIPNODE       =     5;

        /// <summary>
        /// Currently in barrier.
        /// </summary>
        public const int BARRIER       =     7;

        /// <summary>
        /// Printing a log message.
        /// </summary>
        public const int MESSAGE       =     6;

        /// <summary>
        /// Currently in multi-objective optimization.
        /// </summary>
        public const int MULTIOBJ      =     8;

        /// <summary>
        /// Currently computing an IIS.
        /// </summary>
        public const int IIS           =     9;

        /// <summary>
        /// Currently in PDHG.
        /// </summary>
        public const int PDHG          =    10;

        /// <summary>
        /// Currently in NL barrier.
        /// </summary>
        public const int NLBAR         =    11;

        /// <summary>
        /// Returns the number of columns removed by presolve to this point.
        /// </summary>
        public const int PRE_COLDEL      = 1000;
        /// <summary>
        /// Returns the number of rows removed by presolve to this point.
        /// </summary>
        public const int PRE_ROWDEL      = 1001;
        /// <summary>
        /// Returns the number of constraint senses changed by presolve to this
        /// point.
        /// </summary>
        public const int PRE_SENCHG      = 1002;
        /// <summary>
        /// Returns the number of bounds changed by presolve to this point.
        /// </summary>
        public const int PRE_BNDCHG      = 1003;
        /// <summary>
        /// Returns the number of coefficients changed by presolve to this point.
        /// </summary>
        public const int PRE_COECHG      = 1004;
        /// <summary>
        /// Returns the current simplex iteration count.
        /// </summary>
        public const int SPX_ITRCNT      = 2000;
        /// <summary>
        /// Returns the current simplex objective value.
        /// </summary>
        public const int SPX_OBJVAL      = 2001;
        /// <summary>
        /// Returns the current simplex primal infeasibility.
        /// </summary>
        public const int SPX_PRIMINF     = 2002;
        /// <summary>
        /// Returns the current simplex dual infeasibility.
        /// </summary>
        public const int SPX_DUALINF     = 2003;
        /// <summary>
        /// Returns 1 if the model has been perturbed.
        /// </summary>
        public const int SPX_ISPERT      = 2004;
        /// <summary>
        /// Returns the current best objective value.
        /// </summary>
        public const int MIP_OBJBST      = 3000;
        /// <summary>
        /// Returns the current best objective bound.
        /// </summary>
        public const int MIP_OBJBND      = 3001;
        /// <summary>
        /// Returns the current explored node count.
        /// </summary>
        public const int MIP_NODCNT      = 3002;
        /// <summary>
        /// Returns the current solution count.
        /// </summary>
        public const int MIP_SOLCNT      = 3003;
        /// <summary>
        /// Returns the current cutting plane count.
        /// </summary>
        public const int MIP_CUTCNT      = 3004;
        /// <summary>
        /// Returns the current unexplored node count.
        /// </summary>
        public const int MIP_NODLFT      = 3005;
        /// <summary>
        /// Returns the current simplex iteration count.
        /// </summary>
        public const int MIP_ITRCNT      = 3006;
        /// <summary>
        /// For a multi-scenario model, returns the number of scenarios that are still open.
        /// </summary>
        public const int MIP_OPENSCENARIOS = 3007;
        /// <summary>
        /// Returns the current phase of the MIP algorithm.
        /// </summary>
        public const int MIP_PHASE         = 3008;

        /// <summary>
        /// Returns the new solution.
        /// </summary>
        public const int MIPSOL_SOL      = 4001;
        /// <summary>
        /// Returns the objective value for the new solution.
        /// </summary>
        public const int MIPSOL_OBJ      = 4002;
        /// <summary>
        /// Returns the current best objective value.
        /// </summary>
        public const int MIPSOL_OBJBST   = 4003;
        /// <summary>
        /// Returns the current best objective bound.
        /// </summary>
        public const int MIPSOL_OBJBND   = 4004;
        /// <summary>
        /// Returns the current explored node count.
        /// </summary>
        public const int MIPSOL_NODCNT   = 4005;
        /// <summary>
        /// Returns the current solution count.
        /// </summary>
        public const int MIPSOL_SOLCNT   = 4006;
        /// <summary>
        /// For a multi-scenario model, returns the number of scenarios that are still open.
        /// </summary>
        public const int MIPSOL_OPENSCENARIOS = 4007;
        /// <summary>
        /// Returns the current phase of the MIP algorithm.
        /// </summary>
        public const int MIPSOL_PHASE   = 4008;

        /// <summary>
        /// Returns the status of the current node relaxation.
        /// </summary>
        public const int MIPNODE_STATUS  = 5001;
        /// <summary>
        /// Returns the current node relaxation solution or ray.
        /// </summary>
        public const int MIPNODE_REL     = 5002;
        /// <summary>
        /// Returns the current best objective value.
        /// </summary>
        public const int MIPNODE_OBJBST  = 5003;
        /// <summary>
        /// Returns the current best objective bound.
        /// </summary>
        public const int MIPNODE_OBJBND  = 5004;
        /// <summary>
        /// Returns the current explored node count.
        /// </summary>
        public const int MIPNODE_NODCNT  = 5005;
        /// <summary>
        /// Returns the current solution count.
        /// </summary>
        public const int MIPNODE_SOLCNT  = 5006;
        /// <summary>
        /// Returns the branching variable for the current node.
        /// </summary>
        public const int MIPNODE_BRVAR  = 5007;
        /// <summary>
        /// For a multi-scenario model, returns the number of scenarios that are still open.
        /// </summary>
        public const int MIPNODE_OPENSCENARIOS = 5008;
        /// <summary>
        /// Returns the current phase of the MIP algorithm.
        /// </summary>
        public const int MIPNODE_PHASE  = 5009;

        /// <summary>
        /// Returns the current barrier iteration count.
        /// </summary>
        public const int BARRIER_ITRCNT  = 7001;
        /// <summary>
        /// Returns the current barrier primal objective value.
        /// </summary>
        public const int BARRIER_PRIMOBJ = 7002;
        /// <summary>
        /// Returns the current barrier dual objective value.
        /// </summary>
        public const int BARRIER_DUALOBJ = 7003;
        /// <summary>
        /// Returns the current barrier primal infeasibility.
        /// </summary>
        public const int BARRIER_PRIMINF = 7004;
        /// <summary>
        /// Returns the current barrier dual infeasibility.
        /// </summary>
        public const int BARRIER_DUALINF = 7005;
        /// <summary>
        /// Returns the current barrier complementarity violation.
        /// </summary>
        public const int BARRIER_COMPL   = 7006;

        /// <summary>
        /// Returns the message that is being printed.
        /// </summary>
        public const int MSG_STRING      = 6001;

        /// <summary>
        /// Returns the elapsed solver runtime (in seconds).
        /// </summary>
        public const int RUNTIME         = 6002;
        /// <summary>
        /// Returns the elapsed solver work (in work units).
        /// </summary>
        public const int WORK            = 6003;
        /// <summary>
        /// Returns the current size of allocated memory (in GB).
        /// </summary>
        public const int MEMUSED         = 6004;
        /// <summary>
        /// Returns the maximum size of allocated memory (in GB).
        /// </summary>
        public const int MAXMEMUSED      = 6005;

        /// <summary>
        /// Returns the number of objectives that have already been optimized.
        /// </summary>
        public const int MULTIOBJ_OBJCNT = 8001;
        /// <summary>
        /// Returns the current solution count.
        /// </summary>
        public const int MULTIOBJ_SOLCNT = 8002;
        /// <summary>
        /// Returns the current solution.
        /// </summary>
        public const int MULTIOBJ_SOL    = 8003;
        /// <summary>
        /// Returns the iteration count of last objective solve.
        /// </summary>
        public const int MULTIOBJ_ITRCNT = 8004;
        /// <summary>
        /// Returns the objective value of best solution of last objective solve.
        /// </summary>
        public const int MULTIOBJ_OBJBST = 8005;
        /// <summary>
        /// Returns the objective bound of last objective solve.
        /// </summary>
        public const int MULTIOBJ_OBJBND = 8006;
        /// <summary>
        /// Returns the status of last objective solve.
        /// </summary>
        public const int MULTIOBJ_STATUS = 8007;
        /// <summary>
        /// Returns the MIP gap of last objective solve.
        /// </summary>
        public const int MULTIOBJ_MIPGAP = 8008;
        /// <summary>
        /// Returns the node count of last objective solve.
        /// </summary>
        public const int MULTIOBJ_NODCNT = 8009;
        /// <summary>
        /// Returns the open node count of last objective solve.
        /// </summary>
        public const int MULTIOBJ_NODLFT = 8010;
        /// <summary>
        /// Returns the runtime (in seconds) of last objective solve.
        /// </summary>
        public const int MULTIOBJ_RUNTIME = 8011;
        /// <summary>
        /// Returns the elapsed work (in work units) of last objective solve.
        /// </summary>
        public const int MULTIOBJ_WORK = 8012;

        /// <summary>
        /// Returns the minimum number of constraints in the IIS.
        /// </summary>
        public const int IIS_CONSTRMIN   = 9001;
        /// <summary>
        /// Returns the maximum number of constraints in the IIS.
        /// </summary>
        public const int IIS_CONSTRMAX   = 9002;
        /// <summary>
        /// Returns the estimated number of constraints in the IIS.
        /// </summary>
        public const int IIS_CONSTRGUESS = 9003;
        /// <summary>
        /// Returns the minimum number of bounds in the IIS.
        /// </summary>
        public const int IIS_BOUNDMIN    = 9004;
        /// <summary>
        /// Returns the maximum number of bounds in the IIS.
        /// </summary>
        public const int IIS_BOUNDMAX    = 9005;
        /// <summary>
        /// Returns the estimated number of bounds in the IIS.
        /// </summary>
        public const int IIS_BOUNDGUESS  = 9006;

        /// <summary>
        /// Returns the current PDHG iteration count.
        /// </summary>
        public const int PDHG_ITRCNT  = 10001;
        /// <summary>
        /// Returns the current PDHG primal objective value.
        /// </summary>
        public const int PDHG_PRIMOBJ = 10002;
        /// <summary>
        /// Returns the current PDHG dual objective value.
        /// </summary>
        public const int PDHG_DUALOBJ = 10003;
        /// <summary>
        /// Returns the current PDHG primal infeasibility.
        /// </summary>
        public const int PDHG_PRIMINF = 10004;
        /// <summary>
        /// Returns the current PDHG dual infeasibility.
        /// </summary>
        public const int PDHG_DUALINF = 10005;
        /// <summary>
        /// Returns the current PDHG complementarity violation.
        /// </summary>
        public const int PDHG_COMPL   = 10006;

        /// <summary>
        /// Returns the current NL barrier iteration count.
        /// </summary>
        public const int NLBAR_ITRCNT  = 11001;
        /// <summary>
        /// Returns the current NL barrier primal objective value.
        /// </summary>
        public const int NLBAR_PRIMOBJ = 11002;
        /// <summary>
        /// Returns the current NL barrier primal infeasibility.
        /// </summary>
        public const int NLBAR_PRIMINF = 11003;
        /// <summary>
        /// Returns the current NL barrier dual infeasibility.
        /// </summary>
        public const int NLBAR_DUALINF = 11004;
        /// <summary>
        /// Returns the current NL barrier complementarity violation.
        /// </summary>
        public const int NLBAR_COMPL   = 11005;

        /// <summary>
        /// Default value for wheres flag
        /// </summary>
        public const int ALL_BIT = int.MaxValue; // set all bits to 1
      }

      // Errors

      /// <summary>
      /// Gurobi error codes.
      /// </summary>
      public class Error
      {
        /// <summary>
        /// Available memory was exhausted.
        /// </summary>
        public const int OUT_OF_MEMORY            = 10001;

        /// <summary>
        /// NULL input value provided for a required argument.
        /// </summary>
        public const int NULL_ARGUMENT            = 10002;

        /// <summary>
        /// Invalid input value.
        /// </summary>
        public const int INVALID_ARGUMENT         = 10003;

        /// <summary>
        /// Tried to query or set an unknown attribute.
        /// </summary>
        public const int UNKNOWN_ATTRIBUTE        = 10004;

        /// <summary>
        /// Tried to query or set an attribute that could not be accessed.
        /// </summary>
        public const int DATA_NOT_AVAILABLE       = 10005;

        /// <summary>
        /// Index for attribute query was out of range.
        /// </summary>
        public const int INDEX_OUT_OF_RANGE       = 10006;

        /// <summary>
        /// Tried to query or set an unknown parameter.
        /// </summary>
        public const int UNKNOWN_PARAMETER        = 10007;

        /// <summary>
        /// Tried to set a parameter to a value that is outside its valid range.
        /// </summary>
        public const int VALUE_OUT_OF_RANGE       = 10008;

        /// <summary>
        /// Failed to obtain a Gurobi license.
        /// </summary>
        public const int NO_LICENSE               = 10009;

        /// <summary>
        /// Attempted to solve a model that is larger than the limit for a
        /// trial license.
        /// </summary>
        public const int SIZE_LIMIT_EXCEEDED      = 10010;

        /// <summary>
        /// Problem in callback.
        /// </summary>
        public const int CALLBACK                 = 10011;

        /// <summary>
        /// Failed to read the requested file.
        /// </summary>
        public const int FILE_READ                = 10012;

        /// <summary>
        /// Failed to write the requested file.
        /// </summary>
        public const int FILE_WRITE               = 10013;

        /// <summary>
        /// Numerical error during requested operation.
        /// </summary>
        public const int NUMERIC                  = 10014;

        /// <summary>
        /// Attempted to perform infeasibility analysis on a feasible model.
        /// </summary>
        public const int IIS_NOT_INFEASIBLE       = 10015;

        /// <summary>
        /// Requested operation not valid for a MIP model.
        /// </summary>
        public const int NOT_FOR_MIP              = 10016;

        /// <summary>
        /// Tried to access a model while optimization was in progress.
        /// </summary>
        public const int OPTIMIZATION_IN_PROGRESS = 10017;

        /// <summary>
        /// Constraint, variable, or SOS contained duplicate indices.
        /// </summary>
        public const int DUPLICATES               = 10018;

        /// <summary>
        /// Error in reading or writing a MIP node file.
        /// </summary>
        public const int NODEFILE                 = 10019;

        /// <summary>
        /// non-PSD Q matrix in the objective or in a quadratic constraint.
        /// </summary>
        public const int Q_NOT_PSD                = 10020;

        /// <summary>
        /// Equality quadratic constraints.
        /// </summary>
        public const int QCP_EQUALITY_CONSTRAINT  = 10021;

        /// <summary>
        /// Network error.
        /// </summary>
        public const int NETWORK                  = 10022;

        /// <summary>
        /// Job rejected from Compute Server queue.
        /// </summary>
        public const int JOB_REJECTED             = 10023;

        /// <summary>
        /// Operation is not supported in the current usage environment.
        /// </summary>
        public const int NOT_SUPPORTED            = 10024;

        /// <summary>
        /// Result is larger than return value allows.
        /// </summary>
        public const int EXCEED_2B_NONZEROS       = 10025;

        /// <summary>
        /// Problem with piecewise-linear objective function.
        /// </summary>
        public const int INVALID_PIECEWIE_OBJ     = 10026;

        /// <summary>
        /// Not allowed to change UpdateMode parameter once model
        /// has been created.
        /// </summary>
        public const int UPDATEMODE_CHANGE        = 10027;

        /// <summary>
        /// Problem launching Instant Cloud job.
        /// </summary>
        public const int CLOUD                    = 10028;

        /// <summary>
        /// An error occurred during model modification or update.
        /// </summary>
        public const int MODEL_MODIFICATION       = 10029;

        /// <summary>
        /// An error occured with the client-server application.
        /// </summary>
        public const int CSWORKER                 = 10030;

        /// <summary>
        /// Multi-model tuning invoked on models of different types.
        /// </summary>
        public const int TUNE_MODEL_TYPES         = 10031;

        /// <summary>
        /// Multi-model tuning invoked on models of different types.
        /// </summary>
        public const int SECURITY                 = 10032;

        /// <summary>
        /// Tried to access a constraint or variable that is not in the model.
        /// </summary>
        public const int NOT_IN_MODEL             = 20001;

        /// <summary>
        /// Failed to create the requested model.
        /// </summary>
        public const int FAILED_TO_CREATE_MODEL   = 20002;

        /// <summary>
        /// Internal Gurobi error.
        /// </summary>
        public const int INTERNAL                 = 20003;
      }

      // Cuts parameter values

      /// <summary>
      /// Constant for Cuts parameter -
      /// choose cuts control automatically.
      /// </summary>
      public const int CUTS_AUTO           = -1;
      /// <summary>
      /// Constant for Cuts parameter -
      /// shuts off cuts.
      /// </summary>
      public const int CUTS_OFF            = 0;
      /// <summary>
      /// Constant for Cuts parameter -
      /// moderate cut generation.
      /// </summary>
      public const int CUTS_CONSERVATIVE   = 1;
      /// <summary>
      /// Constant for Cuts parameter -
      /// aggressive cut generation.
      /// </summary>
      public const int CUTS_AGGRESSIVE     = 2;
      /// <summary>
      /// Constant for Cuts parameter -
      /// very aggressive cut generation.
      /// </summary>
      public const int CUTS_VERYAGGRESSIVE = 3;

      // Presolve parameter values

      /// <summary>
      /// Constant for Presolve parameter -
      /// automatic presolve setting.
      /// </summary>
      public const int PRESOLVE_AUTO         = -1;
      /// <summary>
      /// Constant for Presolve parameter -
      /// turns off presolve.
      /// </summary>
      public const int PRESOLVE_OFF          = 0;
      /// <summary>
      /// Constant for Presolve parameter -
      /// moderate presolve setting.
      /// </summary>
      public const int PRESOLVE_CONSERVATIVE = 1;
      /// <summary>
      /// Constant for Presolve parameter -
      /// aggressive presolve setting.
      /// </summary>
      public const int PRESOLVE_AGGRESSIVE   = 2;

      // Method parameter values

      /// <summary>
      /// Constant for Method parameter -
      /// none equals to choose method automatically.
      /// </summary>
      public const int METHOD_NONE                             = -1;
      /// <summary>
      /// Constant for Method parameter -
      /// choose method automatically.
      /// </summary>
      public const int METHOD_AUTO                             = -1;
      /// <summary>
      /// Constant for Method and NodeMethod parameters -
      /// use primal simplex.
      /// </summary>
      public const int METHOD_PRIMAL                           = 0;
      /// <summary>
      /// Constant for Method and NodeMethod parameters -
      /// use dual simplex.
      /// </summary>
      public const int METHOD_DUAL                             = 1;
      /// <summary>
      /// Constant for Method and NodeMethod parameters -
      /// use barrier.
      /// </summary>
      public const int METHOD_BARRIER                          = 2;
      /// <summary>
      /// Constant for Method parameters -
      /// use concurrent optimizer.
      /// </summary>
      public const int METHOD_CONCURRENT                       = 3;
      /// <summary>
      /// Constant for Method parameter -
      /// use deterministic concurrent optimizer.
      /// </summary>
      public const int METHOD_DETERMINISTIC_CONCURRENT         = 4;
      /// <summary>
      /// Constant for Method parameter -
      /// use deterministic concurrent primal and dual simplex.
      /// </summary>
      public const int METHOD_DETERMINISTIC_CONCURRENT_SIMPLEX = 5;
      /// <summary>
      /// Constant for Method and NodeMethod parameters -
      /// use PDHG.
      /// </summary>
      public const int METHOD_PDHG                             = 6;

      // BarHomogeneous parameter values

      /// <summary>
      /// Constant for BarHomogeneous parameter -
      /// choose whether to use homogeneous barrier method automatically.
      /// </summary>
      public const int BARHOMOGENEOUS_AUTO = -1;
      /// <summary>
      /// Constant for BarHomogeneous parameter -
      /// do not run the homogeneous barrier method.
      /// </summary>
      public const int BARHOMOGENEOUS_OFF  = 0;
      /// <summary>
      /// Constant for BarHomogeneous parameter -
      /// use the homogeneous barrier method.
      /// </summary>
      public const int BARHOMOGENEOUS_ON   = 1;

      // BarOrder parameter values

      /// <summary>
      /// Constant for BarOrder parameter -
      /// choose ordering method automatically.
      /// </summary>
      public const int BARORDER_AUTOMATIC        = -1;
      /// <summary>
      /// Constant for BarOrder parameter -
      /// choose Approximate Minimum Degree ordering.
      /// </summary>
      public const int BARORDER_AMD              = 0;
      /// <summary>
      /// Constant for BarOrder parameter -
      /// choose Nested Dissection ordering.
      /// </summary>
      public const int BARORDER_NESTEDDISSECTION = 1;

      // MIPFocus parameter values

      /// <summary>
      /// Constant for MIPFocus parameter -
      /// strike a balance between finding new feasible solutions and improving
      /// the best bound.
      /// </summary>
      public const int MIPFOCUS_BALANCED    = 0;
      /// <summary>
      /// Constant for MIPFocus parameter -
      /// focus on finding feasible solutions quickly.
      /// </summary>
      public const int MIPFOCUS_FEASIBILITY = 1;
      /// <summary>
      /// Constant for MIPFocus parameter -
      /// focus on proving optimality.
      /// </summary>
      public const int MIPFOCUS_OPTIMALITY  = 2;
      /// <summary>
      /// Constant for MIPFocus parameter -
      /// focus on moving the best bound.
      /// </summary>
      public const int MIPFOCUS_BESTBOUND   = 3;

      // SimplexPricing parameter values

      /// <summary>
      /// Constant for SimplexPricing parameter -
      /// choose Simplex pricing strategy automatically.
      /// </summary>
      public const int SIMPLEXPRICING_AUTO           = -1;
      /// <summary>
      /// Constant for SimplexPricing parameter -
      /// choose Partial Pricing as Simplex pricing strategy.
      /// </summary>
      public const int SIMPLEXPRICING_PARTIAL        = 0;
      /// <summary>
      /// Constant for SimplexPricing parameter -
      /// choose Steepest Edge as Simplex pricing strategy.
      /// </summary>
      public const int SIMPLEXPRICING_STEEPEST_EDGE  = 1;
      /// <summary>
      /// Constant for SimplexPricing parameter -
      /// choose Devex as Simplex pricing strategy.
      /// </summary>
      public const int SIMPLEXPRICING_DEVEX          = 2;
      /// <summary>
      /// Constant for SimplexPricing parameter -
      /// choose Quick-Start Steepest Edge as Simplex pricing strategy.
      /// </summary>
      public const int SIMPLEXPRICING_STEEPEST_QUICK = 3;

      // VarBranch parameter values

      /// <summary>
      /// Constant for VarBranch parameter -
      /// choose branch variable selection strategy automatically.
      /// </summary>
      public const int VARBRANCH_AUTO           = -1;
      /// <summary>
      /// Constant for VarBranch parameter -
      /// choose Pseudo Reduced Cost Branching as branch variable selection
      /// strategy.
      /// </summary>
      public const int VARBRANCH_PSEUDO_REDUCED = 0;
      /// <summary>
      /// Constant for VarBranch parameter -
      /// choose Pseudo Shadow Price Branching as branch variable selection
      /// strategy.
      /// </summary>
      public const int VARBRANCH_PSEUDO_SHADOW  = 1;
      /// <summary>
      /// Constant for VarBranch parameter -
      /// choose Maximum Infeasibility Branching as branch variable selection
      /// strategy.
      /// </summary>
      public const int VARBRANCH_MAX_INFEAS     = 2;
      /// <summary>
      /// Constant for VarBranch parameter -
      /// choose Strong Branching as branch variable selection strategy.
      /// </summary>
      public const int VARBRANCH_STRONG         = 3;

      // PartitionPlace parameter values

      /// <summary>
      /// Constant for PartitionPlace parameter -
      /// run partition heuristic before the root relaxation is solved.
      /// </summary>
      public const int PARTITION_EARLY     = 16;
      /// <summary>
      /// Constant for PartitionPlace parameter -
      /// run partition heuristic at the start of the root cut loop.
      /// </summary>
      public const int PARTITION_ROOTSTART = 8;
      /// <summary>
      /// Constant for PartitionPlace parameter -
      /// run partition heuristic at the end of the root cut loop.
      /// </summary>
      public const int PARTITION_ROOTEND   = 4;
      /// <summary>
      /// Constant for PartitionPlace parameter -
      /// run partition heuristic at the nodes of the branch-and-cut search.
      /// </summary>
      public const int PARTITION_NODES     = 2;
      /// <summary>
      /// Constant for PartitionPlace parameter -
      /// run partition heuristic when the branch-and-cut search terminates.
      /// </summary>
      public const int PARTITION_CLEANUP   = 1;

      // Callback phase values

      /// <summary>
      /// Constant for MIP_PHASE, MIPNODE_PHASE, and MIPSOL_PHASE
      /// callback return value.  MIP is currently performing
      /// the NoRel heuristic.
      /// </summary>
      public const int MIP_PHASE_NOREL   = 0;
      /// <summary>
      /// Constant for MIP_PHASE, MIPNODE_PHASE, and MIPSOL_PHASE
      /// callback return value.  MIP is currently exploring
      /// the standard MIP search.
      /// </summary>
      public const int MIP_PHASE_SEARCH  = 1;
      /// <summary>
      /// Constant for MIP_PHASE, MIPNODE_PHASE, and MIPSOL_PHASE
      /// callback return value.  MIP is currently in
      /// the solution improvement phase.
      /// </summary>
      public const int MIP_PHASE_IMPROVE = 2;

      // FeasRelax method parameter values

      /// <summary>
      /// minimize linearly weighted sum of penalties for feasrelax model.
      /// </summary>
      public const int FEASRELAX_LINEAR      = 0;
      /// <summary>
      /// minimize quadratically weighted sum of penalties for feasrelax model.
      /// </summary>
      public const int FEASRELAX_QUADRATIC   = 1;
      /// <summary>
      /// minimize weighted cardinality of relaxations for feasrelax model.
      /// </summary>
      public const int FEASRELAX_CARDINALITY = 2;

  GRB.CharAttr

    This enum is used to get or set char-valued attributes (through `GRBModel.Get` or `GRBModel.Set`). Please refer to the Attributes section to see a list of all attributes and their purpose.

  GRB.DoubleAttr

    This enum is used to get or set double-valued attributes (through `GRBModel.Get` or `GRBModel.Set`). Please refer to the Attributes section to see a list of all attributes and their purpose.

  GRB.DoubleParam

    This enum is used to get or set double-valued parameters (through `GRBModel.Get`, `GRBModel.Set`, `GRBEnv.Get`, `GRBEnv.Set`, or `GRBCallback.Set`). Please refer to the Parameters section to see a list of all parameters and their purpose.

  GRB.IntAttr

    This enum is used to get or set int-valued attributes (through `GRBModel.Get` or `GRBModel.Set`). Please refer to the Attributes section to see a list of all attributes and their purpose.

  GRB.IntParam

    This enum is used to get or set int-valued parameters (through `GRBModel.Get`, `GRBModel.Set`, `GRBEnv.Get`, `GRBEnv.Set`, or `GRBCallback.Set`). Please refer to the Parameters section to see a list of all parameters and their purpose.

  GRB.StringAttr

    This enum is used to get or set string-valued attributes (through `GRBModel.Get` or `GRBModel.Set`). Please refer to the Attributes section to see a list of all attributes and their purpose.

  GRB.StringParam

    This enum is used to get or set string-valued parameters (through `GRBModel.Get`, `GRBModel.Set`, `GRBEnv.Get`, `GRBEnv.Set`, or `GRBCallback.Set`). Please refer to the Parameters section to see a list of all parameters and their purpose.

Help and Feedback

Press `/` or click to search this documentation | Gurobi website | Gurobi community forum
Go to other Gurobi documentation | Gurobi download | Contact support