We are given two sets of terminals $A$ and $B$. For each $a\in A$, we are also given $R_a\subseteq B$. Let $|A|+|B|=n$.
We want to find a directed acyclic graph $G$ where $A$ and $B$ are subsets of the vertices, such that $a\in A$ can reach $b\in B$ if and only if $b\in R_a$. We want to optimize the number of edges.
I'm pretty sure this is studied somewhere, but I can't find the right keyword to search for it.