I have $m$ sets $A_1,\ldots,A_m$ and a binary variable $x_{ij}\in\{0,1\}$ for $i\in I$ and $j\in\bigcup_{k=1}^mA_k$. I would like to express these constraints:
- If $x_{ij}=1$ for $j\in A_k$, then $x_{ij}=0$ for all $j\notin A_k$.
Can I write these as linear constraints?
Yes, you can via the following constraints:
$$\sum_{j\in\bigcup_{k=1}^mA_k} x_{ij} \le 1 \; ~~~~~~~ \forall i \in I $$ $$ x_{ij} \in \{0,1\} ~~~~~~~~\forall i \in I, \forall j \in \bigcup_{k=1}^mA_k x_{ij} $$
The first set of constraints will force the sum of the $x_{ij}$ to be below 1. This means, when for a fixed $i$ one $x_{ij}$ is 1, then all other $x_{ij}$ will be set to zero.
The constraints allow that for a given $i$ all $x_{ij}$ are zero. If you want to have exactly one $x_{ij}=1$ for a given $i$, then you can replace $\le$ above with =.