Detailed Release Notes for Gurobi 9.5.2

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 (and corresponding CentOS distribution), 8 GCC $\ge$ 4.8 Use libgurobi_g++5.2.a for newer C++ compilers
  SUSE Enterprise Linux 12, 15    
  Ubuntu 18.04, 20.04    
  Amazon Linux 2    
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, 7.3 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 (x64_86) and Apple (arm64) processors.

Additional Supported Platform Information

Gurobi 9.5.2 supports the following language/platform versions:

Language Version
Python 2.7, 3.7, 3.8, 3.9, 3.10
MATLAB R2019a-R2022a
R 4.2
JDK 8, 11, 17
.NET Core 3.1, 6.0

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:

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:

New attributes The following attributes are new in Gurobi 9.5:

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

New file formats

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

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 ($1024^3$ bytes) to GB ($1000^3$ 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 setSolution and 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 PyPI.org

Since version 9.1 gurobipy can be installed through pip from PyPI.org. 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 setup.py 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 PyPI.org. 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.

Example:

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 = 'myserver.mycompany.com';  % 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 <- "myserver.mycompany.com";  # 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