I have a directed acyclic graph, and two binary decision variables:
- $a_{ij}$, which is equal to one when the corresponding edge between the nodes $i$ and $j$ of the graph is selected, and zero otherwise.
- $a_{i}$, which is equal to one when the corresponding node $i$ of the graph is selected, and zero otherwise.
I want to express the following constraint: if the edge between the nodes $i$ and $j$ is selected, then both of the nodes, $i$ and $j$, are selected as well. I.e.:
- if $a_{ij}=1$, then $a_{i}=1$ and $a_{j}=1$
- else if $a_{ij}=0$, then $a_{i}=0$ and/or $a_{j}=0$.
I could easily express this with the following equation: $a_{ij} = a_{i} * a_{j}$
However, since I have to model the particular problem as a binary integer linear programming model, all of the constraints have to be linear.
Is there a way to express the particular constraint linearly?
Please also note, that $n_i$ represents the number of immediate child nodes of node $i$ in the graph (in case this could facilitate the linear formulation of the particular constraint).