# Fixing MIP problem integer variables to get Duals

**URL:** <https://discourse.julialang.org/t/fixing-mip-problem-integer-variables-to-get-duals/82885>\
**Category:** Optimization (Mathematical)\
**Created:** [June 16, 2022, 3:30pm UTC](https://discourse.julialang.org/t/fixing-mip-problem-integer-variables-to-get-duals/82885 "2022-06-16T15:30:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Di11on](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/di11on/32/6352_2.png) [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Post date:** [June 16, 2022, 3:30pm UTC](https://discourse.julialang.org/t/fixing-mip-problem-integer-variables-to-get-duals/82885/1 "2022-06-16T15:30:06Z")

</div>

Hi folks,

We are solving large models iteratively. It’s a mip problem and to calculate duals, we fix the binary and integer variables and use unset\_binary() and then unset\_integer() to remove the constraints, then solve the resulting lp. However iterative calling unset\_binary and unset\_integer is taking a very long time, more time than it takes to actually solve the lp. Is there a more efficient way to do what we are trying to do?

E.g. I came across this in the documentation:

```julia

Delete the constraints associated with con_refs from the model model. Solvers may implement specialized methods for deleting multiple constraints of the same concrete type, i.e., when isconcretetype(eltype(con_refs)). These may be more efficient than repeatedly calling the single constraint delete method.

```

Can someone give me an example of one of these methods and how they might be used?

@odow ?

Thanks in advance

---

<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:** [June 16, 2022, 6:41pm UTC](https://discourse.julialang.org/t/fixing-mip-problem-integer-variables-to-get-duals/82885/2 "2022-06-16T18:41:50Z")

</div>

Have you tried [Models · JuMP](https://jump.dev/JuMP.jl/stable/manual/models/#Relax-integrality)?

Do you have the code or a reproducible example? What solver?
