Known issues in Gurobi 12.0.0#

Incorrect handling of duplicate indices in setObjectiveN#

In the Python, C++, Java, and .NET APIs, passing a LinExpr / GRBLinExpr object containing duplicate variables to setObjectiveN gives an incorrect result. For example, the following code:

x = model.addVar()
y = model.addVar()
expr = x + x + y
model.setObjectiveN(expr, 0)

incorrectly sets the first objective to \(x + y\). A workaround, if you cannot ensure that like terms are collected in the expression passed to setObjectiveN, is to create an intermediate variable to use as the objective:

x = model.addVar()
y = model.addVar()
z = model.addVar(lb=-GRB.INFINITY)
expr = x + x + y
model.addConstr(z == expr)
model.setObjectiveN(z, 0)

Missing symbols in shared library libgurobi120#

Exported symbols for the C functions GRBloadenv and GRBemptyenv are missing from the shared libraries libgurobi120.so, libgurobi120.dll and libgurobi120.dylib.

In order to safeguard applications against accidental use of incompatible version combinations of Gurobi header and library, these functions are provided in Gurobi 12.0.0 only as version-aware header defines by including the C header gurobi_c.h. Most applications include this header file and hence are unaffected by this issue. But trying to load symbols for these two functions directly from the library, (e.g., through dlsym, Python’s ctypes module, or any other language’s FFI) will result in an error, reporting that the symbols cannot be found.

The missing symbols will be added back to the library with the next technical release. As a workaround for this release, please change your application code to use the analogous but undocumented functions

int GRBloadenvinternal(GRBenv **envP, const char *logfile,
                       int major, int minor, int tech);
int GRBemptyenvinternal(GRBenv **envP, int major, int minor, int tech);

while supplying the values 12, 0 and 0 for the three additional parameters appearing in these signatures. For example, in plain C code you would call these functions like this:

GRBenv *env   = NULL;
int     error = 0;

error = GRBloadenvinternal(&env, "", 12, 0, 0);
GRBenv *env   = NULL;
int     error = 0;

error = GRBemptyenvinternal(&env, 12, 0, 0);

Other issues#

  • The file ReleaseNotes.html in the root directory of the distribution incorrectly refers to the 12.0.0 version as beta3.

  • In gurobipy, some invalid usages of Model.addConstr for nonlinear constraints create a trivially infeasible model, instead of raising an exception when the constraint is added. For example:

    import gurobipy as gp
    
    env = gp.Env()
    model = gp.Model(env=env)
    x = model.addVar()
    model.addConstr(x ** 3 == 1)  # Should raise an exception
    model.optimize()              # Results in INFEASIBLE status
    

    Future releases will raise an exception for this invalid addConstr call.