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)
Other issues#
The file
ReleaseNotes.html
in the root directory of the distribution incorrectly refers to the12.0.0
version asbeta3
.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.Some multi-objective models may trigger an undocumented error with code 20000. The issue has been identified and should be fixed in an upcoming technical release. In the meantime, you should set MultiObjPre=0 to work around this issue.