I have the following constraint that I need to write in an optimization problem but I failed to do it.
Let $x_{ij}$ be a binary variable. So that:
$$ x_{ij} = \begin{cases} 1, & \text{if $i$ and $j$ are in the same group}\\ 0, & \text{otherwise} \end{cases} $$
Now I need to write the constraint that if $x_{ij}=1$ and $x_{ik}=1$ then $x_{jk}=1$.
I wrote it as follows: $x_{jk}=x_{ij}\cdot x_{ik}$. But this is obviously wrong because when $x_{jk}=1$ and $x_{ij}=0$ and $x_{ik}=0$ I will get $1=0$.