Try our new documentation site (beta).
Parameters
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 |
One note about integer-valued parameters: while the maximum value that
can be stored in a signed integer is , we use a MAXINT
value of 2,000,000,000. Attempting to set an integer parameter to a
value larger than this maximum will produce an error.
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 |
ConcurrentMIP | Enables concurrent MIP solver |
ConcurrentMIPJobs | Enables distributed concurrent MIP |
ConcurrentSettings | Comma-separated list of .prm files - used to create concurrent environments |
Disconnected | Disconnected component strategy |
Heuristics | Turn MIP heuristics up or down |
ImproveStartGap | Trigger solution improvement |
ImproveStartNodes | 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 |
Tuning: These parameters control the operation of the parameter tuning tool.
Parameter name | Purpose |
---|---|
TuneJobs | Enables distributed tuning |
TuneOutput | Tuning output level |
TuneResults | Number of improved parameter sets returned |
TuneTimeLimit | Time limit for tuning |
TuneTrials | Perform multiple runs on each parameter set to limit the effect of random noise |
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 |
Distributed algorithms: Parameters that are used to control our distributed parallel algorithms (distributed concurrent MIP and distributed tuning).
Parameter name | Purpose |
---|---|
ServerPassword | Password for compute servers |
ServerPool | List of available compute servers |
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 | Disables dual reductions in presolve |
FeasRelaxBigM | Big-M value for feasibility relaxations |
IISMethod | IIS method |
InputFile | File to be read before optimization commences |
LazyConstraints | Programs that use lazy constraints must set this parameter |
LogFile | Log file name |
LogToConsole | Console logging |
Method | Algorithm used to solve continuous models |
NonBlocking | Non-blocking optimization |
NumericFocus | Set the numerical focus |
OutputFlag | Solver output control |
PreCrush | Allows presolve to translate constraints on the original model to equivalent constraints on the presolved model |
PreDepRow | Presolve dependent row reduction |
PreDual | Presolve dualization |
PrePasses | Presolve pass limit |
PreQLinearize | Presolve Q matrix linearization |
Presolve | Presolve level |
PreSOS1BigM | Controls SOS1 converstion to binary form |
PreSOS2BigM | Controls SOS2 converstion to binary form |
PreSparsify | Presolve sparsify reduction |
ResultFile | Result file written upon completion of optimization |
Seed | Modify the random number seed |
Threads | Number of parallel threads to use |
Subsections
- Parameter Guidelines
- Parameter Descriptions
- AggFill
- Aggregate
- BarConvTol
- BarCorrectors
- BarHomogeneous
- BarOrder
- BarQCPConvTol
- BarIterLimit
- BranchDir
- CliqueCuts
- ConcurrentMIP
- ConcurrentMIPJobs
- ConcurrentSettings
- CoverCuts
- Crossover
- CrossoverBasis
- Cutoff
- CutAggPasses
- CutPasses
- Cuts
- Disconnected
- DisplayInterval
- DualReductions
- FeasibilityTol
- FeasRelaxBigM
- FlowCoverCuts
- FlowPathCuts
- GomoryPasses
- GUBCoverCuts
- Heuristics
- IISMethod
- ImpliedCuts
- ImproveStartGap
- ImproveStartNodes
- ImproveStartTime
- InfUnbdInfo
- InputFile
- IntFeasTol
- IterationLimit
- LazyConstraints
- LogFile
- LogToConsole
- MarkowitzTol
- Method
- MinRelNodes
- MIPFocus
- MIPGap
- MIPGapAbs
- MIPSepCuts
- MIQCPMethod
- MIRCuts
- ModKCuts
- NetworkCuts
- NodefileDir
- NodefileStart
- NodeLimit
- NodeMethod
- NonBlocking
- NormAdjust
- NumericFocus
- ObjScale
- OptimalityTol
- OutputFlag
- PerturbValue
- PreCrush
- PreDepRow
- PreDual
- PrePasses
- PreQLinearize
- Presolve
- PreSOS1BigM
- PreSOS2BigM
- PreSparsify
- PSDTol
- PumpPasses
- QCPDual
- Quad
- ResultFile
- RINS
- ScaleFlag
- ServerPassword
- ServerPool
- Seed
- Sifting
- SiftMethod
- SimplexPricing
- SolutionLimit
- SolutionNumber
- SubMIPCuts
- SubMIPNodes
- Symmetry
- Threads
- TimeLimit
- TuneJobs
- TuneOutput
- TuneResults
- TuneTimeLimit
- TuneTrials
- VarBranch
- ZeroHalfCuts
- ZeroObjNodes