# Deleting containerized constraints

**URL:** <https://discourse.julialang.org/t/deleting-containerized-constraints/21971>\
**Category:** Optimization (Mathematical)\
**Created:** [March 17, 2019, 7:49pm UTC](https://discourse.julialang.org/t/deleting-containerized-constraints/21971 "2019-03-17T19:49:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [March 18, 2019, 1:37pm UTC](https://discourse.julialang.org/t/deleting-containerized-constraints/21971/2 "2019-03-18T13:37:58Z")

</div>

Please provide a minimum working example:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

In particular

- what solver are you using?
- how long does it take to rebuild the model vs delete the constraints?
- the way you are deleting in the loop is the correct syntax

> just to add, I know there is `set_coefficient` and the hack with `.fix` to change the RHS… but what’s the point of a high level modeling language if I need to aggregate up the coefficients and constants myself

Using `fix` to change the RHS is not a hack. It is the official way to change the RHS. Why?

- `@constraint(model, 2x + 1 <= 3)` Is the RHS `3` or `3-1=2`?
- `@constraint(model, 1 <= 2x + 1 <= 3)`. What is the RHS?

If you have lots of duplicate variables, it should be possible to restructure your code to simplify things.

---

_[View the full topic](https://discourse.julialang.org/t/deleting-containerized-constraints/21971)._
