GUROBI 4.6
Gurobi Optimization, www.gurobi.com
Contents
1 2 3 Introduction . . . . . . . . . . . . . . . . . . . How to Run a Model with Gurobi . . . . . . Overview of GAMS/Gurobi . . . . . . . . . . 3.1 Linear and Quadratic Programming . . . . . 3.2 MixedInteger Programming . . . . . . . . . . GAMS Options . . . . . . . . . . . . . . . . . . Summary of GUROBI Options . . . . . . . . 5.1 Termination options . . . . . . . . . . . . . . 5.2 Tolerance options . . . . . . . . . . . . . . . . 5.3 S
GUROBI 4.6
Gurobi Optimization,
www.gurobi.com
Contents
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 How to Run a Model with Gurobi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Overview of GAMS/Gurobi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.1 Linear and Quadratic Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23.2 MixedInteger Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 GAMS Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Summary of GUROBI Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5.1 Termination options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45.2 Tolerance options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45.3 Simplex and Barrier options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45.4 MIP options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45.5 Other options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55.6 The GAMS/Gurobi Options File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6 GAMS/Gurobi Log File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Detailed Descriptions of GUROBI Options. . . . . . . . . . . . . . . . . . . . . . . . 8
1 Introduction
The Gurobi suite of optimization products include stateoftheart simplex and parallel barrier based linearprogramming (LP) and quadratic programming (QP) solvers, as well as parallel mixedinteger linear programming(MILP) and mixedinteger quadratic programming (MIQP) solvers.While numerous solving options are available, Gurobi automatically calculates and sets most options at the bestvalues for speciﬁc problems. All Gurobi options available through GAMS/Gurobi are summarized at the end of this chapter.
2 How to Run a Model with Gurobi
The following statement can be used inside your GAMS program to specify using Gurobi
Option LP = Gurobi; { or MIP or RMIP or QCP or MIQCP or RMIQCP }
The above statement should appear before the
solve
statement. If Gurobi was speciﬁed as the default solverduring GAMS installation, the above statement is not necessary.
GUROBI 4.6 2
3 Overview of GAMS/Gurobi
3.1 Linear and Quadratic Programming
Gurobi can solve LP and QP problems using several alternative algorithms. The majority of LP or QP problemssolve best using Gurobi’s stateoftheart dual simplex algorithm. Certain types of problems beneﬁt from usingthe parallel barrier or the primal simplex algorithms. If you are solving LP problems on a multicore system, youshould also consider using the concurrent optimizer. It runs diﬀerent optimization algorithms on diﬀerent cores,and returns when the ﬁrst one ﬁnishes.GAMS/Gurobi also provides access to the Gurobi infeasibility ﬁnder. The infeasibility ﬁnder takes an infeasiblelinear program and produces an irreducibly inconsistent set of constraints (IIS). An IIS is a set of constraints andvariable bounds which is infeasible but becomes feasible if any one member of the set is dropped. GAMS/Gurobireports the IIS in terms of GAMS equation and variable names and includes the IIS report as part of the normalsolution listing. The infeasibility ﬁnder is activated by the optioniis.GAMS/Gurobi supports sensitivity analysis (postoptimality analysis) for linear programs which allows one toﬁnd out more about an optimal solution for a problem. In particular, objective ranging and constraint ranginggive information about how much an objective coeﬃcient or a righthandside and variable bounds can changewithout changing the optimal basis. In other words, they give information about how sensitive the optimal basisis to a change in the objective function or the bounds and righthand side. GAMS/Gurobi reports the sensitivityinformation as part of the normal solution listing. Sensitivity analysis is activated by the optionsensitivity.The Gurobi presolve can sometimes diagnose a problem as being infeasible
or
unbounded. When this happens,GAMS/Gurobi can, in order to get better diagnostic information, rerun the problem with presolve turned oﬀ. Thererun without presolve is controlled by the optionrerun. In default mode only problems that are small (i.e. demosized) will be rerun.Gurobi can either presolve a model or start from an advanced basis. Often the solve from scratch of a presolvedmodel outperforms a solve from an unpresolved model started from an advanced basis. It is impossible todetermine a priori if presolve or starting from a given advanced basis without presolve will be faster. By default,GAMS/Gurobi will automatically use an advanced basis from a previous
solve
statement. The GAMS
BRatio
option can be used to specify when not to use an advanced basis. The GAMS/Gurobi optionusebasiscan beused to ignore a basis passed on by GAMS (it overrides
BRatio
). In case of multiple solves in a row and slowperformance of the second and subsequent solves, the user is advised to set the GAMS
BRatio
option to 1.
3.2 MixedInteger Programming
The methods used to solve pure integer and mixed integer programming problems require dramatically moremathematical computation than those for similarly sized pure linear or quadratic programs. Many relativelysmall integer programming models take enormous amounts of time to solve.For problems with discrete variables, Gurobi uses a branch and cut algorithm which solves a series of LP or QPsubproblems. Because a single mixed integer problem generates many subproblems, even small mixed integerproblems can be very compute intensive and require signiﬁcant amounts of physical memory.GAMS/Gurobi supports Special Order Sets of type 1 and type 2 as well as semicontinuous and semiintegervariables.You can provide a known solution (for example, from a MIP problem previously solved or from your knowledgeof the problem) to serve as the ﬁrst integer solution.If you specify some or all values for the discrete variables together with GAMS/Gurobi optionmipstart, Gurobiwill check the validity of the values as an integerfeasible solution. If this process succeeds, the solution will betreated as an integer solution of the current problem.The Gurobi MIP solver includes shared memory parallelism, capable of simultaneously exploiting any number of processors and cores per processor. The implementation is deterministic: two separate runs on the same modelwill produce identical solution paths.
GUROBI 4.6 3
4 GAMS Options
The following GAMS options are used by GAMS/Gurobi:
Option BRatio = x;
Determines whether or not to use an advanced basis. A value of 1.0 causes GAMS to instruct Gurobi notto use an advanced basis. A value of 0.0 causes GAMS to construct a basis from whatever information isavailable. The default value of 0.25 will nearly always cause GAMS to pass along an advanced basis if asolve statement has previously been executed.
Option IterLim = n;
Sets the simplex iteration limit. Simplex algorithms will terminate and pass on the current solution toGAMS. For MIP problems, if the number of the cumulative simplex iterations exceeds the limit, Gurobiwill terminate.
Option NodLim = x;
Maximum number of nodes to process for a MIP problem. This GAMS option is overridden by theGAMS/Gurobi optionnodelimit.
Option OptCR = x;
Relative optimality criterion for a MIP problem. Notice that Gurobi uses a diﬀerent deﬁnition than GAMSnormally uses. The OptCR option asks Gurobi to stop when

BP
−
BF

<

BF
 ∗
OptCRwhere
BF
is the objective function value of the current best integer solution while
BP
is the best possibleinteger solution. The GAMS deﬁnition is:

BP
−
BF

<

BP
 ∗
OptCR
Option ResLim = x;
Sets the time limit in seconds. The algorithm will terminate and pass on the current solution to GAMS.Gurobi measures time in wall time on all platforms. Some other GAMS solvers measure time in CPU timeon some Unix systems. This GAMS option is overridden by the GAMS/Gurobi optiontimelimit.
Option SysOut = On;
Will echo Gurobi messages to the GAMS listing ﬁle. This option may be useful in case of a solver failure.
ModelName
.Cutoﬀ = x;
Cutoﬀ value. When the branch and bound search starts, the parts of the tree with an objective worse thanx are deleted. This can sometimes speed up the initial phase of the branch and bound algorithm. ThisGAMS option is overridden by the GAMS/Gurobi optioncutoﬀ .
ModelName
.OptFile = 1;
Instructs GAMS/Gurobi to read the option ﬁle. The name of the option ﬁle is
gurobi.opt
.
ModelName
.PriorOpt = 1;
Instructs GAMS/Gurobi to use the priority branching information passed by GAMS through variable suﬃxvalues
variable
.prior
.
GUROBI 4.6 4
5 Summary of GUROBI Options
5.1 Termination options
bariterlimitLimits the number of barrier iterations performedcutoﬀ Sets a target objective valueiterationlimitLimits the number of simplex iterations performednodelimitLimits the number of MIP nodes exploredsolutionlimitLimits the number of feasible solutions foundtimelimitLimits the total time expended in seconds
5.2 Tolerance options
barconvtolControls barrier terminationfeasibilitytolPrimal feasibility toleranceintfeastolInteger feasibility tolerancemarkowitztolThreshold pivoting tolerancemipgapRelative MIP optimality gapmipgapabsAbsolute MIP optimality gapoptimalitytolDual feasibility tolerancepsdtollimit on the amount of diagonal perturbation
5.3 Simplex and Barrier options
barcorrectorsLimits the number of central corrections performed in each barrier iterationbarorderChooses the barrier sparse matrix ﬁllreducing algorithmcrossoverDetermines the crossover strategy used to transform the barrier solution into a basic solutioncrossoverbasisDetermines the initial basis construction strategy for crossovernormadjustPricing norm variantsobjscaleObjective coeﬃcients scalingperturbvalueMagnitude of simplex perturbation when requiredquadQuad precision computation in simplexscaleﬂagEnables or disables model scalingsiftingSifting within dual simplexsiftmethodLP method used to solve sifting subproblemssimplexpricingDetermines variable pricing strategy
5.4 MIP options
branchdirDetermines which child node is explored ﬁrst in the branchandcut searchcliquecutsControls clique cut generationcovercutsControls cover cut generationcutaggpassesMaximum number of aggregation passes during cut generationcutpassesMaximum number of cutting plane passes performed during root cut generationcutsGlobal cut generation controlﬂowcovercutsControls ﬂow cover cut generationﬂowpathcutsControls ﬂow path cut generation