Parameters control the operation of the Gurobi solvers. They must be modified before the optimization begins. While you should feel free to experiment with different parameter settings, we recommend that you leave parameters at their default settings unless you find a compelling reason not to. For a discussion of when you might want to change parameter values, refer to our Parameter Guidelines.
Parameter names are represented using strings in the Gurobi APIs. The case of the string is ignored, as are underscores. Thus, TIME_LIMIT and TimeLimit are equivalent. The Gurobi language APIs all provide a set of pre-defined constants or enums that can be used to refer to the parameters without using hard-coded strings. The pre-defined names vary from language to language, in order to better conform to the conventions of the language.
In the C interface, the symbolic constant for each parameter name is prefixed by GRB_type_PAR_, where type is either INT, DBL, or STR. For example, the constant definition for the Threads parameter (found in C header file gurobi_c.h) is:
#define GRB_INT_PAR_THREADS "Threads"
In the C++ interface, parameters are grouped by datatype into three enums: GRB_DoubleParam, GRB_IntParam, and GRB_StringParam. You refer to a specific parameter by appending the parameter name to the enum name. For example, the Threads parameter is GRB_IntParam_Threads.
In the Java and .NET interfaces, parameters are also grouped by datatype into three enums: GRB.DoubleParam, GRB.IntParam, and GRB.StringParam. You would refer to the Threads parameter as GRB.IntParam.Threads.
In the Python interface, parameters are listed as constants within the GRB.Param class. You would refer to the Threads parameter as GRB.Param.Threads.
To give another example, the MIPGap parameter would be referred to in the different interfaces as:
Language | Parameter |
---|---|
C | GRB_DBL_PAR_MIPGAP |
C++ | GRB_DoubleParam_MIPGap |
Java | GRB.DoubleParam.MIPGap |
.NET | GRB.DoubleParam.MIPGap |
Python | GRB.Param.MIPGap |
The available parameters are as follows:
Termination: These parameters affect the termination of the algorithms. If the algorithm exceeds any of these limits, it will terminate and report a non-optimal termination status (see the Status Code section for further details).
Parameter name | Purpose |
---|---|
BarIterLimit | Barrier iteration limit |
Cutoff | Objective cutoff |
IterationLimit | Simplex iteration limit |
NodeLimit | MIP node limit |
SolutionLimit | MIP feasible solution limit |
TimeLimit | Time limit |
Tolerances: These parameters control the allowable feasibility or optimality violations.
Parameter name | Purpose |
---|---|
BarConvTol | Barrier convergence tolerance |
BarQCPConvTol | Barrier QCP convergence tolerance |
FeasibilityTol | Primal feasibility tolerance |
IntFeasTol | Integer feasibility tolerance |
MarkowitzTol | Threshold pivoting tolerance |
MIPGap | Relative MIP optimality gap |
MIPGapAbs | Absolute MIP optimality gap |
OptimalityTol | Dual feasibility tolerance |
PSDTol | Positive semi-definite tolerance |
Simplex: These parameters control the operation of the simplex algorithms.
Parameter name | Purpose |
---|---|
InfUnbdInfo | Generate additional info for infeasible/unbounded models |
NormAdjust | Simplex pricing norm |
ObjScale | Objective scaling |
PerturbValue | Simplex perturbation magnitude |
Quad | Quad precision computation in simplex |
ScaleFlag | Model scaling |
Sifting | Sifting within dual simplex |
SiftMethod | LP method used to solve sifting sub-problems |
SimplexPricing | Simplex variable pricing strategy |
Barrier: These parameters control the operation of the barrier solver.
Parameter name | Purpose |
---|---|
BarCorrectors | Central correction limit |
BarHomogeneous | Barrier homogeneous algorithm |
BarOrder | Barrier ordering algorithm |
Crossover | Barrier crossover strategy |
CrossoverBasis | Crossover initial basis construction strategy |
QCPDual | Compute dual variables for QCP models |
MIP: These parameters control the operation of the MIP algorithms.
Parameter name | Purpose |
---|---|
BranchDir | Branch direction preference |
Heuristics | Turn MIP heuristics up or down |
ImproveStartGap | Trigger solution improvement |
ImproveStartTime | Trigger solution improvement |
MinRelNodes | Minimum relaxation heuristic control |
MIPFocus | Set the focus of the MIP solver |
MIQCPMethod | Method used to solve MIQCP models |
NodefileDir | Directory for MIP node files |
NodefileStart | Memory threshold for writing MIP tree nodes to disk |
NodeMethod | Method used to solve MIP node relaxations |
PumpPasses | Feasibility pump heuristic control |
RINS | RINS heuristic |
SolutionNumber | Sub-optimal MIP solution retrieval |
SubMIPNodes | Nodes explored by sub-MIP heuristics |
Symmetry | MIP symmetry detection |
VarBranch | Branch variable selection strategy |
ZeroObjNodes | Zero objective heuristic control |
MIP Cuts: These parameters affect the generation of MIP cutting planes. In all cases, a value of -1 corresponds to an automatic setting, which allows the solver to determine the appropriate level of aggressiveness in the cut generation. Unless otherwise noted, settings of 0, 1, and 2 correspond to no cut generation, conservative cut generation, or aggressive cut generation, respectively. The Cuts parameter provides global cut control, affecting the generation of all cuts. This parameter also has a setting of 3, which corresponds to very aggressive cut generation. The other parameters override the global Cuts parameter (so setting Cuts to 2 and CliqueCuts to 0 would generate all cut types aggressively, except clique cuts which would not be generated at all).
Parameter name | Purpose |
---|---|
Cuts | Global cut generation control |
CliqueCuts | Clique cut generation |
CoverCuts | Cover cut generation |
FlowCoverCuts | Flow cover cut generation |
FlowPathCuts | Flow path cut generation |
GUBCoverCuts | GUB cover cut generation |
ImpliedCuts | Implied bound cut generation |
MIPSepCuts | MIP separation cut generation |
MIRCuts | MIR cut generation |
ModKCuts | Mod-k cut generation |
NetworkCuts | Network cut generation |
SubMIPCuts | Sub-MIP cut generation |
ZeroHalfCuts | Zero-half cut generation |
CutAggPasses | Constraint aggregation passes performed during cut generation |
CutPasses | Root cutting plane pass limit |
GomoryPasses | Root Gomory cut pass limit |
Other: Other parameters.
Parameter name | Purpose |
---|---|
AggFill | Allowed fill during presolve aggregation |
Aggregate | Presolve aggregation control |
DisplayInterval | Frequency at which log lines are printed |
DualReductions | Reductions that must be disabled when adding lazy constraints |
FeasRelaxBigM | Big-M value for feasibility relaxations |
IISMethod | IIS method |
LogFile | Log file name |
LogToConsole | Console logging |
Method | Algorithm used to solve continuous models |
OutputFlag | Solver output control |
PreCrush | Presolve reductions that must be disabled when adding user cuts |
PreDepRow | Presolve dependent row reduction |
PreDual | Presolve dualization |
PrePasses | Presolve pass limit |
PreQLinearize | Presolve Q matrix linearization |
Presolve | Presolve level |
PreSparsify | Presolve sparsify reduction |
ResultFile | Result file written upon completion of optimization |
Threads | Number of parallel threads to use |