
Gurobi Optimizer Reference Manual
Version 7.0, Copyright © 2017, Gurobi Optimization, Inc.

This is the reference manual for the GurobiTM Optimizer. It contains documentation for the following Gurobi language interfaces:
The Gurobi interactive shell is also documented in the Python section.
This document also includes information on our Distributed Parallel Algorithms, which allow you to use multiple machines to achieve higher performance, Gurobi Compute Server, which allows you to offload Gurobi computations from a set of client machines onto one or more servers, and Gurobi Instant Cloud, which allows you to launch machines on the cloud and offload Gurobi computations to them.
Additional Resources
You can consult the Gurobi Quick Start for a high-level overview of the Gurobi Optimizer, or the Gurobi Example Tour for a quick tour of the examples provided with the Gurobi distribution.
Getting Help
If you have a question that is not answered in this document, you can
post it to the Gurobi Google
Group. If you have a
current maintenance contract with us, you can send your question to
support@gurobi.com
.
- C API Overview
- C API Details
- Environment Creation and Destruction
- Model Creation and Modification
- GRBloadmodel
- GRBnewmodel
- GRBcopymodel
- GRBaddconstr
- GRBaddconstrs
- GRBaddgenconstrXxx
- GRBaddgenconstrMax
- GRBaddgenconstrMin
- GRBaddgenconstrAbs
- GRBaddgenconstrAnd
- GRBaddgenconstrOr
- GRBaddgenconstrIndicator
- GRBaddqconstr
- GRBaddqpterms
- GRBaddrangeconstr
- GRBaddrangeconstrs
- GRBaddsos
- GRBaddvar
- GRBaddvars
- GRBchgcoeffs
- GRBdelconstrs
- GRBdelgenconstrs
- GRBdelq
- GRBdelqconstrs
- GRBdelsos
- GRBdelvars
- GRBsetpwlobj
- GRBupdatemodel
- GRBfreemodel
- GRBXaddconstrs
- GRBXaddrangeconstrs
- GRBXaddvars
- GRBXchgcoeffs
- GRBXloadmodel
- Model Solution
- Model Queries
- Input/Output
- Attribute Management
- GRBgetattrinfo
- GRBgetintattr
- GRBsetintattr
- GRBgetintattrelement
- GRBsetintattrelement
- GRBgetintattrarray
- GRBsetintattrarray
- GRBgetintattrlist
- GRBsetintattrlist
- GRBgetdblattr
- GRBsetdblattr
- GRBgetdblattrelement
- GRBsetdblattrelement
- GRBgetdblattrarray
- GRBsetdblattrarray
- GRBgetdblattrlist
- GRBsetdblattrlist
- GRBgetcharattrelement
- GRBsetcharattrelement
- GRBgetcharattrarray
- GRBsetcharattrarray
- GRBgetcharattrlist
- GRBsetcharattrlist
- GRBgetstrattr
- GRBsetstrattr
- GRBgetstrattrelement
- GRBsetstrattrelement
- GRBgetstrattrarray
- GRBsetstrattrarray
- GRBgetstrattrlist
- GRBsetstrattrlist
- Parameter Management and Tuning
- Monitoring Progress - Logging and Callbacks
- Modifying Solver Behavior - Callbacks
- Error Handling
- Advanced simplex routines
- C++ API Overview
- C++ API Details
- GRBEnv
- GRBModel
- GRBModel()
- GRBModel::addConstr()
- GRBModel::addConstrs()
- GRBModel::addGenConstrXxx()
- GRBModel::addQConstr()
- GRBModel::addRange()
- GRBModel::addRanges()
- GRBModel::addSOS()
- GRBModel::addVar()
- GRBModel::addVars()
- GRBModel::chgCoeff()
- GRBModel::chgCoeffs()
- GRBModel::computeIIS()
- GRBModel::discardConcurrentEnvs()
- GRBModel::feasRelax()
- GRBModel::fixedModel()
- GRBModel::get()
- GRBModel::getCoeff()
- GRBModel::getCol()
- GRBModel::getConcurrentEnv()
- GRBModel::getConstrByName()
- GRBModel::getConstrs()
- GRBModel::getEnv()
- GRBModel::getGenConstrMax()
- GRBModel::getGenConstrMin()
- GRBModel::getGenConstrAbs()
- GRBModel::getGenConstrAnd()
- GRBModel::getGenConstrOr()
- GRBModel::getGenConstrIndicator()
- GRBModel::getGenConstrs()
- GRBModel::getObjective()
- GRBModel::getPWLObj()
- GRBModel::getQCRow()
- GRBModel::getQConstrs()
- GRBModel::getRow()
- GRBModel::getSOS()
- GRBModel::getSOSs()
- GRBModel::getTuneResult()
- GRBModel::getVarByName()
- GRBModel::getVars()
- GRBModel::optimize()
- GRBModel::optimizeasync()
- GRBModel::presolve()
- GRBModel::read()
- GRBModel::remove()
- GRBModel::reset()
- GRBModel::setCallback()
- GRBModel::set()
- GRBModel::setObjective()
- GRBModel::setPWLObj()
- GRBModel::sync()
- GRBModel::terminate()
- GRBModel::tune()
- GRBModel::update()
- GRBModel::write()
- GRBVar
- GRBConstr
- GRBQConstr
- GRBSOS
- GRBGenConstr
- GRBExpr
- GRBLinExpr
- GRBLinExpr()
- GRBLinExpr::addTerms()
- GRBLinExpr::clear()
- GRBLinExpr::getConstant()
- GRBLinExpr::getCoeff()
- GRBLinExpr::getValue()
- GRBLinExpr::getVar()
- GRBLinExpr::operator=
- GRBLinExpr::operator+
- GRBLinExpr::operator-
- GRBLinExpr::operator+=
- GRBLinExpr::operator-=
- GRBLinExpr::operator*=
- GRBLinExpr::remove()
- GRBLinExpr::size()
- GRBQuadExpr
- GRBQuadExpr()
- GRBQuadExpr::addTerm()
- GRBQuadExpr::addTerms()
- GRBQuadExpr::clear()
- GRBQuadExpr::getCoeff()
- GRBQuadExpr::getLinExpr()
- GRBQuadExpr::getValue()
- GRBQuadExpr::getVar1()
- GRBQuadExpr::getVar2()
- GRBQuadExpr::operator=
- GRBQuadExpr::operator+
- GRBQuadExpr::operator-
- GRBQuadExpr::operator+=
- GRBQuadExpr::operator-=
- GRBQuadExpr::operator*=
- GRBQuadExpr::remove()
- GRBQuadExpr::size()
- GRBTempConstr
- GRBColumn
- GRBCallback
- GRBException
- Non-Member Functions
- Attribute Enums
- Parameter Enums
- Java API Overview
- Java API Details
- GRBEnv
- GRBModel
- GRBModel()
- GRBModel.addConstr()
- GRBModel.addConstrs()
- GRBModel.addGenConstrXxx()
- GRBModel.addQConstr()
- GRBModel.addRange()
- GRBModel.addRanges()
- GRBModel.addSOS()
- GRBModel.addVar()
- GRBModel.addVars()
- GRBModel.chgCoeff()
- GRBModel.chgCoeffs()
- GRBModel.computeIIS()
- GRBModel.discardConcurrentEnvs()
- GRBModel.dispose()
- GRBModel.feasRelax()
- GRBModel.fixedModel()
- GRBModel.get()
- GRBModel.getCoeff()
- GRBModel.getCol()
- GRBModel.getConcurrentEnv()
- GRBModel.getConstrByName()
- GRBModel.getConstrs()
- GRBModel.getEnv()
- GRBModel.getGenConstrMax()
- GRBModel.getGenConstrMin()
- GRBModel.getGenConstrAbs()
- GRBModel.getGenConstrAnd()
- GRBModel.getGenConstrOr()
- GRBModel.getGenConstrIndicator()
- GRBModel.getGenConstrs()
- GRBModel.getObjective()
- GRBModel.getPWLObj()
- GRBModel.getQConstr()
- GRBModel.getQConstrs()
- GRBModel.getRow()
- GRBModel.getSOS()
- GRBModel.getSOSs()
- GRBModel.getTuneResult()
- GRBModel.getVarByName()
- GRBModel.getVars()
- GRBModel.optimize()
- GRBModel.optimizeasync()
- GRBModel.presolve()
- GRBModel.read()
- GRBModel.remove()
- GRBModel.reset()
- GRBModel.setCallback()
- GRBModel.set()
- GRBModel.setObjective()
- GRBModel.setPWLObj()
- GRBModel.terminate()
- GRBModel.tune()
- GRBModel.update()
- GRBModel.write()
- GRBVar
- GRBConstr
- GRBQConstr
- GRBSOS
- GRBGenConstr
- GRBExpr
- GRBLinExpr
- GRBQuadExpr
- GRBColumn
- GRBCallback
- GRBException
- GRB
- .NET API Overview
- .NET API Details
- GRBEnv
- GRBModel
- GRBModel()
- GRBModel.AddConstr()
- GRBModel.AddConstrs()
- GRBModel.AddGenConstrXxx()
- GRBModel.AddQConstr()
- GRBModel.AddRange()
- GRBModel.AddRanges()
- GRBModel.AddSOS()
- GRBModel.AddVar()
- GRBModel.AddVars()
- GRBModel.ChgCoeff()
- GRBModel.ChgCoeffs()
- GRBModel.ComputeIIS()
- GRBModel.DiscardConcurrentEnvs()
- GRBModel.Dispose()
- GRBModel.FeasRelax()
- GRBModel.FixedModel()
- GRBModel.Get()
- GRBModel.GetCoeff()
- GRBModel.GetCol()
- GRBModel.GetConcurrentEnv()
- GRBModel.GetConstrByName()
- GRBModel.GetConstrs()
- GRBModel.GetEnv()
- GRBModel.GetGenConstrMax()
- GRBModel.GetGenConstrMin()
- GRBModel.GetGenConstrAbs()
- GRBModel.GetGenConstrAnd()
- GRBModel.GetGenConstrOr()
- GRBModel.GetGenConstrIndicator()
- GRBModel.GetGenConstrs()
- GRBModel.GetObjective()
- GRBModel.GetPWLObj()
- GRBModel.GetQConstr()
- GRBModel.GetQConstrs()
- GRBModel.GetQCRow()
- GRBModel.GetRow()
- GRBModel.GetSOS()
- GRBModel.GetSOSs()
- GRBModel.GetTuneResult()
- GRBModel.GetVarByName()
- GRBModel.GetVars()
- GRBModel.Optimize()
- GRBModel::OptimizeAsync()
- GRBModel.Presolve()
- GRBModel.Read()
- GRBModel.Remove()
- GRBModel.Reset()
- GRBModel.SetCallback()
- GRBModel.Set()
- GRBModel.SetObjective()
- GRBModel.SetPWLObj()
- GRBModel.Terminate()
- GRBModel.Tune()
- GRBModel.Update()
- GRBModel.Write()
- GRBVar
- GRBConstr
- GRBQConstr
- GRBSOS
- GRBGenConstr
- GRBExpr
- GRBLinExpr
- GRBQuadExpr
- GRBTempConstr
- GRBColumn
- Overloaded Operators
- GRBCallback
- GRBException
- GRB
- Python API Overview
- Python API Details
- Global Functions
- Model
- Model()
- Model.addConstr()
- Model.addConstrs()
- Model.addGenConstrXxx()
- Model.addGenConstrMax()
- Model.addGenConstrMin()
- Model.addGenConstrAbs()
- Model.addGenConstrAnd()
- Model.addGenConstrOr()
- Model.addGenConstrIndicator()
- Model.addQConstr()
- Model.addRange()
- Model.addSOS()
- Model.addVar()
- Model.addVars()
- Model.cbCut()
- Model.cbGet()
- Model.cbGetNodeRel()
- Model.cbGetSolution()
- Model.cbLazy()
- Model.cbSetSolution()
- Model.chgCoeff()
- Model.computeIIS()
- Model.copy()
- Model.discardConcurrentEnvs()
- Model.feasRelaxS()
- Model.feasRelax()
- Model.fixed()
- Model.getAttr()
- Model.getCoeff()
- Model.getCol()
- Model.getConcurrentEnv()
- Model.getConstrByName()
- Model.getConstrs()
- Model.getGenConstrMax()
- Model.getGenConstrMin()
- Model.getGenConstrAbs()
- Model.getGenConstrAnd()
- Model.getGenConstrOr()
- Model.getGenConstrIndicator()
- Model.getGenConstrs()
- Model.getObjective()
- Model.getParamInfo()
- Model.getPWLObj()
- Model.getQConstrs()
- Model.getQCRow()
- Model.getRow()
- Model.getSOS()
- Model.getSOSs()
- Model.getTuneResult()
- Model.getVarByName()
- Model.getVars()
- Model.message()
- Model.optimize()
- Model.presolve()
- Model.printAttr()
- Model.printQuality()
- Model.printStats()
- Model.read()
- Model.relax()
- Model.remove()
- Model.reset()
- Model.resetParams()
- Model.setAttr()
- Model.setObjective()
- Model.setPWLObj()
- Model.setParam()
- Model.terminate()
- Model.tune()
- Model.update()
- Model.write()
- Var
- Constr
- QConstr
- SOS
- GenConstr
- LinExpr
- QuadExpr
- TempConstr
- Column
- Callbacks
- GurobiError
- Env
- GRB
- tuplelist
- tupledict
- MATLAB API Overview
- Solving models with the Gurobi MATLAB interface
- Reading and writing models with the Gurobi MATLAB interface
- Computing an IIS with the Gurobi MATLAB interface
- Setting up the Gurobi MATLAB interface
- R API Overview
- Solving models with the Gurobi R interface
- Writing models with the Gurobi R interface
- Installing the R package
- Variables and Constraints
- Attributes
- Model Attributes
- NumConstrs
- NumVars
- NumSOS
- NumQConstrs
- NumGenConstrs
- NumNZs
- DNumNZs
- NumQNZs
- NumQCNZs
- NumIntVars
- NumBinVars
- NumPWLObjVars
- ModelName
- ModelSense
- ObjCon
- ObjVal
- ObjBound
- ObjBoundC
- PoolObjBound
- PoolObjVal
- MIPGap
- Runtime
- Status
- SolCount
- IterCount
- BarIterCount
- NodeCount
- IsMIP
- IsQP
- IsQCP
- IISMinimal
- MaxCoeff
- MinCoeff
- MaxBound
- MinBound
- MaxObjCoeff
- MinObjCoeff
- MaxRHS
- MinRHS
- MaxQCCoeff
- MinQCCoeff
- MaxQObjCoeff
- MinQObjCoeff
- Kappa
- KappaExact
- FarkasProof
- TuneResultCount
- Variable Attributes
- Linear Constraint Attributes
- SOS Attributes
- Quadratic Constraint Attributes
- General Constraint Attributes
- Quality Attributes
- BoundVio
- BoundSVio
- BoundVioIndex
- BoundSVioIndex
- BoundVioSum
- BoundSVioSum
- ConstrVio
- ConstrSVio
- ConstrVioIndex
- ConstrSVioIndex
- ConstrVioSum
- ConstrSVioSum
- ConstrResidual
- ConstrSResidual
- ConstrResidualIndex
- ConstrSResidualIndex
- ConstrResidualSum
- ConstrSResidualSum
- DualVio
- DualSVio
- DualVioIndex
- DualSVioIndex
- DualVioSum
- DualSVioSum
- DualResidual
- DualSResidual
- DualResidualIndex
- DualSResidualIndex
- DualResidualSum
- DualSResidualSum
- ComplVio
- ComplVioIndex
- ComplVioSum
- IntVio
- IntVioIndex
- IntVioSum
- Multi-objective Attributes
- Attribute Examples
- Model Attributes
- Parameters
- Parameter Guidelines
- Parameter Descriptions
- AggFill
- Aggregate
- BarConvTol
- BarCorrectors
- BarHomogeneous
- BarOrder
- BarQCPConvTol
- BarIterLimit
- BestBdStop
- BestObjStop
- BranchDir
- DegenMoves
- CliqueCuts
- ConcurrentJobs
- ConcurrentMIP
- ConcurrentSettings
- CoverCuts
- Crossover
- CrossoverBasis
- Cutoff
- CutAggPasses
- CutPasses
- Cuts
- Disconnected
- DisplayInterval
- DistributedMIPJobs
- DualReductions
- FeasibilityTol
- FeasRelaxBigM
- FlowCoverCuts
- FlowPathCuts
- GomoryPasses
- GUBCoverCuts
- Heuristics
- IISMethod
- ImpliedCuts
- ImproveStartGap
- ImproveStartNodes
- ImproveStartTime
- InfProofCuts
- InfUnbdInfo
- InputFile
- IntFeasTol
- IterationLimit
- LazyConstraints
- LogFile
- LogToConsole
- MarkowitzTol
- Method
- MinRelNodes
- MIPFocus
- MIPGap
- MIPGapAbs
- MIPSepCuts
- MIQCPMethod
- MIRCuts
- ModKCuts
- MultiObjMethod
- MultiObjPre
- NetworkCuts
- NodefileDir
- NodefileStart
- NodeLimit
- NodeMethod
- NormAdjust
- NumericFocus
- ObjScale
- OptimalityTol
- ObjNumber
- OutputFlag
- PerturbValue
- PoolGap
- PoolSearchMode
- PoolSolutions
- PreCrush
- PreDepRow
- PreDual
- PreMIQCPForm
- PrePasses
- PreQLinearize
- Presolve
- PreSOS1BigM
- PreSOS2BigM
- PreSparsify
- ProjImpliedCuts
- PSDTol
- PumpPasses
- QCPDual
- Quad
- Record
- ResultFile
- RINS
- ScaleFlag
- Seed
- Sifting
- SiftMethod
- SimplexPricing
- SolutionLimit
- SolutionNumber
- StrongCGCuts
- SubMIPCuts
- SubMIPNodes
- Symmetry
- Threads
- TimeLimit
- TuneCriterion
- TuneJobs
- TuneOutput
- TuneResults
- TuneTimeLimit
- TuneTrials
- UpdateMode
- VarBranch
- WorkerPassword
- WorkerPool
- WorkerPort
- ZeroHalfCuts
- ZeroObjNodes
- Parameter Examples
- Optimization Status Codes
- Callback Codes
- Error Codes
- Model File Formats
- MPS format
- REW format
- LP format
- RLP format
- ILP format
- OPB format
- MST format
- HNT format
- ORD format
- BAS format
- SOL format
- PRM format
- Logging
- Simplex Logging
- Barrier Logging
- Sifting Logging
- MIP Logging
- Multi-Objective Logging
- Distributed MIP Logging
- Gurobi Command-Line Tool
- Solution Pool
- Multiple Objectives
- Recording API Calls
- Concurrent Optimizer
- Parameter Tuning Tool
- Gurobi Remote Services
- Distributed Parallel Algorithms
- Configuring a Distributed Worker Pool
- Writing Your Own Distributed Algorithms
- Distributed Algorithm Considerations
- Gurobi Compute Server
- Gurobi Instant Cloud