I have an integer program with binary variables $x_{i,j,k}\in \{ 0,1 \}$.
For all $k$, I have that $\sum_i \sum_j =2$. I want to add a constraint that says if $x_{i_0,j,k}$ is equal to $1$ for some $i_0$ and a fixed $j$ and $k$, then $x_{i_1,j,k}$ must also equal to $1$ for some $i_1\neq i_0$ for the same fixed $j$ and $k$.
I'm unsure how to write this constraint, none of my ideas seem to get it right. Any ideas are welcomed and appreciated.
Here's one way do do it (which works even in the absence of the $\sum_i \sum_j x_{ijk} = 2$ constraints).
For each pair $(j,k)$, add a new integer variable $y_{jk}$, with the inequalities $y_{jk} \ge x_{ijk}$ for all $i$. Finally, add the constraint $$\sum_i x_{ijk} \ge 2y_{jk}. \quad (\star)$$ If there is no $i$ with $x_{ijk}=1$, then we can set $y_{jk}$ to $0$ without a problem and make $(\star)$ trivially satisfied. On the other hand, if there is at least one $i$ with $x_{ijk}=1$, then $y_{jk}$ must be $1$, and then $(\star)$ implies that there are at least two distinct $i$ with $x_{ijk}=1$.