メインコンテンツへスキップ

Indicator function constraints with three conditions

回答済み

コメント

1件のコメント

  • 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

サインインしてコメントを残してください。