0
$\begingroup$

For $x \in \{0,1\}$, I want to express $x = 1 \Leftrightarrow \exists k: y_k = 2$ where $y_k \in \{0,1,2\}$, i.e. $x \leq 0.5\max_k\{y_k\}$ using binary decision variables but I can't figure out how to do it.

$x \geq 0.5(y_k-1)$ ensures $x=1$ if $y_k = 2$, but I need if and only if.

Can anyone help?

$\endgroup$
1
  • $\begingroup$ I'll answer my own question in a while. $\endgroup$ Mar 9, 2015 at 12:20

1 Answer 1

0
$\begingroup$

You can try to split x in 3 parts, like $x_1,x_2,x_3 \in \{0,1\}^3$, set $x=x_1+x_2+x_3$ and put the following constraint with $y_k \in \{0,1,2 \}$ : $$ 0 ≤ x ≤ 1 $$ $$ x_k ≥ (y_k-1), \ \forall k $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .