# Question about problem modifications in Gurobi

**URL:** <https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963>\
**Category:** Optimization (Mathematical)\
**Tags:** gurobi\
**Created:** [July 8, 2022, 6:03pm UTC](https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963 "2022-07-08T18:03:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![guilhermebodin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guilhermebodin/32/6982_2.png) [@guilhermebodin](https://discourse.julialang.org/u/guilhermebodin)\
**Post date:** [July 8, 2022, 6:03pm UTC](https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963/1 "2022-07-08T18:03:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 9, 2022, 8:02pm UTC](https://discourse.julialang.org/t/question-about-problem-modifications-in-gurobi/83963/2 "2022-07-09T20:02:40Z")

</div>

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.
