I’m experiencing a bug where it appears the constant in the objective function doesn’t get updated using Gurobi, here is a quick example:
model = Model(() -> Gurobi.Optimizer(env))
@variable(model, x[1:2])
@constraint(model, [0, -1] .<= x .<= [1, 0])
exprs = [x[1]-1; x[2]+1]
expr = exprs[1]
@objective(model, Max, expr)
optimize!(model)
objective_value(model) # gives correct answer of 0
expr = exprs[2]
@objective(model, Max, expr)
optimize!(model)
objective_value(model) # gives me -1 but should be +1
When I run the same thing using HiGHS this doesn’t happen. Does anyone else see this behavior?