GUROBI Appendix C

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the GUROBI Manual. See GUROBI.

Gurobi Parameters

Setting GUROBI Parameters in Matlab

The behavior of the GUROBI solver is controlled by means of a large number of parameters. It is possible to set all of these parameters from Matlab.

If using the gurobiTL interface for solving problems defined in a TOMLAB Prob structure, the field Prob.MIP.grbControl is used to set values for parameters. The user needs to set only those parameters that he/she wants to change. The non-TOMLAB format gurobi.m interface has a corresponding input parameter, grbControl.

When setting parameter values in the grbControl structure, this prefix should be omitted. For example, to set the iterations for the dual simplex optimizer do:

>> grbControl.ITERATIONLIMIT  = 1000;
>> grbControl.LPMETHOD	= 0;

The complete list of GUROBI parameters are given in the Tables below:

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.

TOMLAB parameter Value
grbControl.Cutoff Any number.

Default: INF

Description: Sets a target objective value; optimization will terminate if the engine determines that the optimal objective value for the model is worse than the specified cutoff.
grbControl.IterationLimit Any non-negative integer.

Default: INF

Description: Limits the number of simplex iterations performed.
grbControl.NodeLimit Any non-negative integer

Default: INF

Description: Limits the number of MIP nodes explored (MIP only).
grbControl.SolutionLimit Any positive integer

Default: 1

Description: Limits the number of feasible solutions found (MIP only).
grbControl.TimeLimit Any non-negative number

Default: 0

Description: Limits the total time expended (in seconds).

Tolerances

These parameters control the allowable feasibility or optimality violations.

TOMLAB parameter Value
grbControl.FeasibilityTol Any number from 10-9 to 10-2 .

Default: 10-6

Description: Primal feasibility tolerance. All constraints must be satisfied to a tolerance of FeasibilityTol.
grbControl.IntFeasTol Any number from 10-9 to 10-1 .

Default: 10-5

Description: Integer feasibility tolerance (MIP only). An integrality restriction on a variable is considered satisfied when the variable's value is less than INTFEASTOL from the nearest integer value.
grbControl.MarkowitzTol Any number from 10-4 to 0.999.

Default: 0.0078125

Description: Threshold pivoting tolerance. Used to limit numerical error in the simplex algorithm. A larger value may avoid numerical problems in rare situations, but it will also harm performance.
grbControl.MIPGap Any number = 0

Default: 10-4

Description: Relative MIP optimality gap (MIP only). The MIP engine will terminate (with an optimal result) when the gap between the lower and upper objective bound is less than MIPGap times the upper bound.
grbControl.OptimalityTol Any number from 10-9 to 10-2 .

Default: 10-6

Description: Dual feasibility tolerance. Reduced costs must all be smaller than OptimalityTol in the improving direction in order for a model to be declared optimal.

Simplex

These parameters control the operation of the simplex algorithms.

TOMLAB parameter Value
grbControl.LPMethod Any integer from 0 to 1.

Default: 1

Description: Simplex algorithm (0=primal, 1=dual). The selected algorithm is used when solving continuous models, and when solving node relaxations within the MIP solver.
grbControl.NormAdjust Any number from -1 to 3.

Default: -1

Description: Chooses from among multiple pricing norm variants. The default value of -1 chooses automatically.
grbControl.ObjScale Any number = -1.

Default: 0.0

Description: Divides the model objective by the specified value to avoid numerical errors that may result from very large objective coefficients. The default value of 0 decides on the scaling automatically. A value less than zero uses the maximum coefficient to the specified power as the scaling (so ObjScale=-0.5 would scale by the square root of the largest objective coefficient).
grbControl.PerturbValue Any number from 0 to 10-2 .

Default: 0.0002

Description: Magnitude of simplex perturbation (when required).
grbControl.Quad Any number from -1 to 1.

Default: -1

Description: Enables or disables quad precision computation in simplex. The -1 default setting allows the algorithm to decide.
grbControl.ScaleFlag Any integer from 0 to 1.

Default: 1

Description: Enables or disables model scaling.
grbControl.SimplexPricing Any integer from -1 to 3 Default: -1
Description: Determines simplex variable pricing strategy. Available options are Automatic (-1), Partial Pricing (0), Steepest Edge (1), Devex (2), and Quick-Start Steepest Edge (3).

MIP

These parameters control the operation of the MIP algorithms.

TOMLAB parameter Value
grbControl.Heuristics Any number from 0 to 1.

Default: 0.05

Description: Controls the amount of time spent in MIP heuristics. Larger values produce more and better feasible solutions, at a cost of slower progress in the best bound.
grbControl.NodefileDir Any directory string

Default: .

Description: Determines the directory into which nodes are written when node memory usage exceeds the specified NodefileStart value.
grbControl.NodefileStart Any number = 0.

Default: I nf

Description: Controls the point at which MIP tree nodes are written to disk. Whenever node storage exceeds the specified value (in GBytes), nodes are written to disk.
grbControl.RootMethod Any number from 0 to 1.

Default: 0

Description: Simplex algorithm used for MIP root relaxation (0=primal, 1=dual).
grbControl.SubMIPNodes Any number = 0.

Default: 500

Description: Limits the number of nodes explored by the RINS heuristic. Exploring more nodes can produce better solutions, but it generally takes longer.
grbControl.VarBranch Any integer from -1 to 3.

Default: -1

Description: Controls the branch variable selection strategy. The default -1 setting makes an automatic choice, depending on problem characteristics. Available alternatives are Pseudo Reduced Cost Branching (0), Pseudo Shadow Price Branching (1), Maximum Infeasibility Branching (2), and Strong Branching (3).

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

TOMLAB parameter Value
grbControl.Cuts Any integer from -1 to 3.

Default: -1

Description: Global cut generation control.
grbControl.CliqueCuts Any integer from -1 to 2.

Default: -1

Description: Controls clique cut generation. Overrides the Cuts parameter.
grbControl.CoverCuts Any integer from -1 to 2.

Default: -1

Description: Controls cover cut generation. Overrides the Cuts parameter.
grbControl.FlowCoverCuts Any integer from -1 to 2.

Default: -1

Description: Controls flow cover cut generation. Overrides the Cuts parameter.
grbControl.FlowPathCuts Any integer from -1 to 2.

Default: -1

Description: Controls flow path cut generation. Overrides the Cuts parameter.
grbControl.GUBCoverCuts Any integer from -1 to 2.

Default: -1

Description: Controls GUB cover cut generation. Overrides the Cuts parameter.
grbControl.ImpliedCuts Any integer from -1 to 2.

Default: -1

Description: Controls implied bound cut generation. Overrides the Cuts parameter.
grbControl.MIPSepCuts Any integer from -1 to 2.

Default: -1

Description: Controls MIP separation cut generation. Overrides the Cuts parameter.
grbControl.MIRCuts Any integer from -1 to 2.

Default: -1

Description: Controls MIR cut generation. Overrides the Cuts parameter.
grbControl.ZeroHalfCuts Any integer from -1 to 2.

Default: -1

Description: Controls zero-half cut generation. Overrides the Cuts parameter.
grbControl.CutAggPasses Any integer = -1.

Default: -1

Description: A non-negative value indicates the maximum number of constraint aggregation passes performed during cut generation. Overrides the Cuts parameter.
grbControl.GomoryPasses Any integer = -1.

Default: -1

Description: A non-negative value indicates the maximum number of Gomory cut passes performed. Overrides the Cuts parameter.

Other

Other parameters.

TOMLAB parameter Value
grbControl.Aggregate Any integer from 0 to 1.

Default: 1

Description: Enables or disables aggregation in presolve. In rare instances, aggregation can lead to an accumulation of numerical errors. Turning it off can sometimes improve solution accuracy.
grbControl.DisplayInterval Any integer = 1.

Default: 5

Description: Controls the frequency at which log lines are printed (in seconds).
grbControl.IISMethod Any integer from -1 to 1.

Default: -1

Description: Chooses the IIS method to use. Method 0 is often faster, while method 1 can produce a smaller IIS. The default value of -1 chooses automatically.
grbControl.OutputFlag Any integer from 0 to 1.

Default: 1

Description: Enables or disables engine output.
grbControl.PreCrush Any integer from 0 to 1.

Default: 0

Description: Allows presolve to translate constraints on the original model to equivalent constraints on the presolved model. Turn this parameter on when you are using callbacks to add your own cuts.
grbControl.Presolve Any integer from -1 to 2.

Default: -1

Description: Controls the presolve level. A value of -1 corresponds to an automatic setting. Other options are off (0), conservative (1), or aggressive (2).
grbControl.Threads Any integer from 0 to NProc.

Default: 0

Description: Controls the number of threads to apply to parallel MIP. The default value of 0 sets the thread

count equal to the maximum value, which is the number of processors in the machine.