Question about problem modifications in Gurobi

There are two ways of changing the RHS of a constraint in Gurobi, one is to directly use MOI.set(model, MOI.ConstraintSet(), ci, new_set) and the other one would be to make a MOI.modify(model, c, MOI.ScalarConstantChange(...)). Does anybody know if those two approaches are equivalent performance-wise? Does it make a big difference making updates one way or the other?

In general, you should prefer modifying the constraint set. Gurobi normalizes the function constant into the RHS of the constraint. But a benchmark should point out which is faster.

1 Like