Are there MIP solvers that allow certain constraints to be toggled based on the value of a binary variable? My current situation is that I'm approximating the desired behavior by using constraints of the form $$A_{i}x\leq b_i + C\delta_{i}$$ where $x$ and $\delta$ are decision variables, $\delta_{i}\in{0,1}$, and $C$ is a large constant. Thus, constraint $i$ is relaxed when binary variable $\delta_i=1.$ This solution isn't ideal because there is no guarantee that the constant $C$ is large enough to relax the constraints. Moreover, there appear to be numerical issues with the Gurobi solver when choosing too large a value for $C$.

I am not well-versed in how MIPs are solved. Is the solution method amenable to an approach where the constraints are entirely removed from the problem whenever $\delta_i=1$?

As I mentioned, I'm currently using Gurobi as a solver. I'm mainly interested in keeping the constraints affine because this leads to my problem being a mixed integer linear program.

  • $\begingroup$ Would $f_i(x) \le \delta_i f_i(x)$ work? If $\delta_i=0$, then the inequality reads $f_i(x)\le 0$. If $\delta_i=1$, then the inequality is $f_i(x)\le f_i(x)$, which is always satisfied. $\endgroup$ Feb 9 at 23:43
  • $\begingroup$ That makes sense. However, I'm interested in keeping the constraints affine in the decision variables. I've edited to clarify. $\endgroup$
    – ai1013
    Feb 10 at 15:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.