Skip to main content

Indicator function constraints with three conditions

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    In your case you could use the following formulation

    \[\begin{align*}
    b_0 = 1 &\rightarrow u \leq 0\\
    b_0 = 1 &\rightarrow w = 0.5 - u\\
    b_1 = 1 &\rightarrow u_{aux} = u\\
    b_1 = 1 &\rightarrow w = 0.5 - u_{aux} + 0.5v\\
    b_1 = 0 &\rightarrow u_{aux} = 0\\
    b_2 = 1 &\rightarrow u \geq 1\\
    b_2 = 1 &\rightarrow w = 0\\
    b_0 + b_1 + b_2 &= 1\\
    v &= u_{aux}^2\\
    b_i &\in \{0,1\}, u_{aux} \in [0,1], v \in [0,1]
    \end{align*}\]

    The constraints with \(\rightarrow\) are indicator constraints. Note that your model is nonconvex, thus you will have to set the NonConvex parameter. Note that the auxiliary variable \{v\} is needed to avoid the product \(u_{aux}^2 \cdot b_1\). Variable \(w\) holds the value of your function \(L(u)\).

    0

Post is closed for comments.