Detailed Release Notes for Gurobi 9.5

Detailed Release Notes for Gurobi 9.5

Supported Platforms

Platform (port) Operating System Compiler Notes
Windows 64-bit (win64) Windows 10, 11, Windows Server 2012 R2, 2016, 2019, 2022 Visual Studio 2017 Use gurobi_c++md2017.lib (e.g.) for C++
  Windows 10, 11, Windows Server 2012 R2, 2016, 2019, 2022 Visual Studio 2019 Use gurobi_c++md2019.lib (e.g.) for C++
Linux x86-64 64-bit (linux64) Red Hat Enterprise Linux 7, 8 (and corresponding CentOS distributions) GCC <span>$</span>\ge<span>$</span> 4.8 Use libgurobi_g++5.2.a for newer C++ compilers
  SUSE Enterprise Linux 12, 15    
  Ubuntu 18.04, 20.04    
macOS 64-bit universal2 (macos_universal2) macOS 10.15 (Catalina), 11 (Big Sur), 12 (Monterey) Xcode 12/13

AIX 64-bit (power64) AIX 7.1, 7.2 XL C/C++ 9 Due to limited Python support on AIX, this port does not include the Interactive Shell or the Python libraries.

Note that the previous mac64 port has been replaced by the new macos_universal2 port, which supports both Intel and Apple processors.

Additional Supported Platform Information

Gurobi 9.5 supports the following language/platform versions:

Language Version
Python 2.7, 3.7, 3.8, 3.9, 3.10
MATLAB R2019a-R2021b
R 4.1
JDK 8, 11, 15
.NET Core 3.1

Deprecation Notes

End of support for Python 2.7 in next release

The release that follows Gurobi 9.5 (major or minor) will drop support for Python 2.7. We recommend that you move to a supported Python 3 version now.

Legacy methods for creating Compute Server and Instant Cloud environments

The following legacy methods for creating Compute Server and Instant Cloud environments are deprecated in Gurobi 9.5 and will be removed in the next major or minor release:

  • C: GRBloadclientenv, GRBloadcloudenv
  • C++:
         GRBEnv(const std::string& logfilename, const std::string& computeserver,
                const std::string& router, const std::string& password,
                const std::string& group, int CStlsInsecure, int priority,
                double timeout)
         GRBEnv(const std::string& logfilename, const std::string& accessID,
                const std::string& secretKey, const std::string& pool,
                int priority)
  • Java:
         GRBEnv(String logFileName, String computeServer, String router,
                String password, String group, int CStlsInsecure, int priority,
                double timeout)
         GRBEnv(String logfilename, String accessID, String secretKey, String pool,
                int priority)
  • .NET:
         GRBEnv(string logfilename, string computeserver, string router,
                string password, string group, int CStlsInsecure, int priority,
                double timeout)
         GRBEnv(string logfilename, string accessID, string secretKey, string pool,
                int priority)
  • gurobipy: Env.ClientEnv, Env.CloudEnv,
  • Matlab and R: The env parameter to the Gurobi functions. See Matlab and R changes below for conversion details.

To programmatically create Compute Server and Instant Cloud environments you should use the configuration parameters introduced in Gurobi 8.0.

New features affecting all APIs

New parameters The following parameters are new in Gurobi 9.5:

  • PreSOS1Encoding and PreSOS2Encoding to choose a reformulation for SOS1 and SOS2 constraints.

  • NLPHeur to control the use of the new non-linear barrier solver for quickly finding feasible solutions to non-convex quadratic models.

  • WorkLimit to terminate an optimization when the specified work limit has been exceeded.

  • MemLimit to terminate an optimization when the the memory used by the optimization exceeds the specified value.

  • LiftProjectCuts to control a new type of cut in this release.

  • LPWarmStart to control how the Simplex algorithms warm-start from a previous solution. In particular, new options to warm-start are introduced, including the option to start from a basis while maintaining presolve.

New attributes The following attributes are new in Gurobi 9.5:

  • The ConcurrentWinMethod attribute indicates the winning method after solving an LP with the concurrent optimizer.

  • The Work attribute captures the amount of work performed in an Optimize call in a deterministic fashion.

  • The IISLBForce, IISUBForce, IISConstrForce, IISSOSForce, IISQConstrForce, and IISGenConstrForce attributes control how the Irreducible Infeasible Subsystem (IIS) algorithm handles each type of constraint. With these attributes you can force specific constraints or bounds to be part of the IIS, even if the resulting subsystem is not minimal. Similarly, you can exclude constraints or bounds from the IIS.

  • The MaxVio attribute provides the maximum (unscaled) constraint violation for the computed solution.

  • The PoolIgnore attribute is used to choose variables that should be ignored when checking whether two solutions differ in the solution pool.

New callback functionality The following features have been added to the callback framework in Gurobi 9.5:

  • The CB_WORK callback value allows you to monitor the Work metric from within a callback (see the Callback Codes section for more information).

  • Callbacks can now be used to programmatically track the progress of the IIS algorithm. See the Callback Codes section for the description of the new where value IIS and the new what values IIS_CONSTRMIN, IIS_CONSTRMAX, IIS_CONSTRGUESS, IIS_BOUNDMIN, IIS_BOUNDMAX and IIS_BOUNDGUESS.

  • Callbacks can now be used for exiting the NoRel Heuristic: The new Proceed method (e.g., Model.cbProceed in Python) allows you to transition from the NoRel heuristic to the standard MIP search.

  • Lazy Constraints in the NoRel Heuristic: Lazy constraints are now supported in the NoRel heuristic. You will receive solution callbacks and be given the opportunity to cut off those solutions with lazy constraints.

New file formats

We added two new file formats for writing the explicit dual of a linear program:

  • .dlp: used for writing the dual formulation of an LP in LP file format, and
  • .dua: used for writing the dual formulation of an LP in MPS file format.

Norm General Constraint

Our existing general constraint feature allows you to add common higher-level constraints using a convenient shorthand. This release includes a new vector norm constraint, which allows you to set one decision variable in your optimization model equal to the norm of a list of decision variables. A number of norms are supported: the 0-norm, 1-norm, 2-norm, and the infinity-norm. See the general constraint section for more information.

Tuning Tool

We added a number of additional controls to our tuning tool, including control over termination (using parameters TuneTargetMIPGap and TuneTargetTime), and control over how runtimes from multiple trials are aggregated (using parameter TuneMetric).

Behavior changes affecting all APIs

Formatting changes to the solution JSON format

In past releases, literals corresponding to floating-point and integer attributes were formatted as strings (i.e., enclosed in quotes). Starting with this release, all number literals are formatted as numbers, in accordance with the JSON specification. For example, the SolutionInfo section of a JSON solution file now appears as:

   "SolutionInfo" : {
      "BarIterCount" : 6,
      "BoundVio" : 0,
      "ConstrVio" : 0,
      "IterCount" : 5,
      "ObjVal" : -4.6475314285714285e+02,
      "Runtime" : 2.8498172760009766e-03,
      "Status" : 2,

Using the JSON solution file without setting tags

We changed a default behavior of the JSON solution file. Before this release, if none of the variables had been tagged through the VTag attribute, no variable solution information would be included in the file. Starting with this release, if no VTag attributes have been set, the JSON solution data will contain names and solution values for all variables with non-zero solution values.

Parameter changes

The units for the NodefileStart parameter have been changed from GiB (<span>$</span>1024^3<span>$</span> bytes) to GB (<span>$</span>1000^3<span>$</span> bytes).

The StartNodeLimit parameter now behaves in a slightly different way. If you solve a model, modify it, and then solve the modified model, Gurobi uses the incumbent solution of the first solve as a MIP start for the second. This is usually done by fixing the integer variables to their respective values and then solving an LP to find values for the continuous variables. With Gurobi 9.5, in default settings of the StartNodeLimit parameter, if the model has just a few integer variables and many continuous variables, the continuous variables are fixed as well and the solution is just checked for feasibility. This change was made to avoid a potentially very expensive LP solve on the original model. To recover the old behavior, you can set the StartNodeLimit parameter to a non-default value.

Attribute changes

The Fingerprint attribute will (likely) take a different value than it did in older versions, but now it is platform independent. Thus, for example, Fingerprint will now be identical on Windows and Linux for the same model.

API method changes

The useSolution methods

can now also be called from the callback when the where flag has values MIP or MIPSOL. This allows you, for example, to directly pass a new solution to Gurobi from within a MIPSOL callback. In previous versions, you had to temporarily store the modified solution in your own data structures and then pass it to Gurobi only during the next MIPNODE callback.

Changes in the log

Gurobi now displays all parameter changes in the log (when logging is enabled).

Changes in gurobipy

Specifying dependencies when installing from

Since version 9.1 gurobipy can be installed through pip from While the core funcionality of gurobipy does not have any dependencies on other Python packages, the matrix-friendly API (the classes MVar, MConstr, MLinExpr, ...) relies on NumPy and SciPy. This "optional dependency" is now reflected in the configuration. Specifying pip install gurobipy[matrixapi] indicates that you intend to use the matrix API and that NumPy and SciPy should be installed as well. Similarly, you can add gurobipy[matrixapi] to a requirements.txt file in order to guarantee that these dependencies are installed even if they are not explicitly mentioned.

Type hints for gurobipy

Type hints are now available for most of the gurobipy classes and functions. They are not part of the gurobipy extension itself, but are distributed as a separate extension available on Use the command pip install gurobipy-stubs in order to install them alongside of the gurobipy extension.

Indexing of MVar and MConstr objects

The indexing behaviour of the MVar and MConstr classes has changed. Selecting a single element from such objects now returns the corresponding scalar Object of type Var or Constr. In version 9.1, such indexing would return an MVar or MConstr object of shape (1,). With this change these two ndarray-like classes behave more like NumPy ndarrays.


import gurobipy as gp
m = gp.Model()
x = m.addMVar(3)  # An MVar object of shape (3,)
mc = m.addConstr(x >= 1)  # An MConstr object of shape (3,)
print(x[1])  # NEW: This is a Var object
print(mc[1]) # NEW: This is a Constr object

You can use slicing if you want the old behavior:

print(x[1:2]) # Not changed, still an MVar of shape (1,)
print(mc[1:2]) # Not changed, still an MConstr of shape (1,)

Changes in the Matlab and R APIs

The env argument to Matlab and R API functions has been deprecated. This argument was previously used to provide the data required to connect to a Compute Server or to Gurobi Instant Cloud. This information should now be passed through parameters in the params struct.

For example, the new signature of the "gurobi" function is gurobi(model, params). To update an program that uses the env argument, just set the appropriate parameters in params to match the fields you previously used in env. The following table shows the correspondence between the field names of the deprecated env argument and Gurobi parameters:

env params
router CSRouter
password ServerPassword
group CSGroup
priority CSPriority
timeout CSQueueTimeout
accessid CloudAccessID
secretkey CloudSecretKey
pool CloudPool

A client code to solve a model on a Compute Server with MATLAB should now read:

m.A = sparse(0,0);  % Just a minimal model struct for demonstration
params.Method = 2;  % Use barrier method (for demonstration)
params.ComputeServer = '';  % Set server name
params.ServerPassword = 'pass';  % Set password
gurobi(m, params);  % Solve model on server with barrier

Similarly, for R the client code to solve a model on a Compute Server should read:

m <- list(A = matrix(0))  # Just a minimal model struct for demonstration
params <- list()
params$Method <- 2  # Use barrier method (for demonstration)
params$ComputeServer <- "";  # Set server name
params$ServerPassword <- "pass";  # Set password
gurobi(m, params);  # Solve model on server with barrier

In summary, here are the new signatures for all Matlab and R API functions:

gurobi(model, params)
gurobi_feasrelax(model, relaxobjtype, minrelax, penalties, params)
gurobi_iis(model, params)
gurobi_read(model, filename, params)
gurobi_relax(model, params)
gurobi_write(model, filename, params)

Changes in the Java API

Gurobi 9.5 adds two new methods to the Java API:

These can be used to pipe all log output through a user callback function.

Compute Server, Cluster Manager, and Instant Cloud

Detailed release notes for Compute Server, Cluster Manager, and Instant Cloud can be found here