Fixing MIP problem integer variables to get Duals

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:

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

Have you tried Models · JuMP?

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