Background:
Given a set of vertices and conditions, in order to see if all the conditions can be met, I want to reduce it to a circulation problem such that all the conditions in the original problem can be met if and only if a feasible circulation exists in the reduction to a circulation.
For example, Suppose you have a set of nodes $A = \{A_1, ..., A_n\}$ and nodes $B = \{B_1, ..., B_k\}$. We want to pair these nodes up $e.g.(A_i, B_j)$, such that each $B_j$ can be paired up with at most $3$ distinct nodes in $A$. Each $A_i$ can only paired with nodes in a specific subset $S_i \subseteq B$. Furthermore, each node $A_i$ must be a part of at least $l_i$ pairs, but a maximum of $m_i$ pairs. Finally, we must have exactly $M$ pairs.
To determine if we can find $M$ pairs that satisfy all of the above constraints, we can reduce this to a circulation problem, and determine if a feasible circulation exists. For example, we could build a circulation by connecting the nodes in $A$ and $B$ according to the given subsets $S_i$. Then, from each node in $B$, we can have an outgoing edge of capacity $3$ to denote that it can be a part of at most 3 distinct pairs. We can have an edge of capacity $m_i$ and lower bound of $l_i$ going into node $A_i$ to denote that it must be a part of at least $l_i$ pairs, but no more than $m_i$. And finally, we can create source and sink vertices with demand and supply $H$ and $-H$ so that we have exactly $M$ pairings.
Problem:
The above reduction is straight forward, because the dependency between the sets of nodes is well defined, and what I would describe as "acyclic". But I am having trouble with reducing problems that have "cyclic" dependencies.
As an example of what I am describing to be an "acyclic" dependency, suppose you have three sets of nodes $A, B, C$, where $A$ and $B$ have some dependency/relationships and $B$ and $C$ have some relationship, but $A$ and $C$ do not have any relation. In this case, we can again build a reduction by creating appropriate edges between $A$ and $B$, and $B$ and $C$.
However, in some scenarios, we have what I would describe as a "cyclic" dependency, where $A$ and $B$ have dependencies, $B$ and $C$ have dependencies, and $C$ and $A$ have dependencies. In this scenario, I am having trouble understanding how to build a reduction.
An example:
Given three sets of nodes $A = \{A_1, .., A_n\}, B = \{B_1, .., B_j\}, C = \{C_1, .., C_k\}$ suppose we want to figure out if we can make exactly $M$ triplets in the form $(a,b,c)$, s.t. $a \in A, b \in B, c \in C$. But as before, each node $A_i \in A$ can only be in triplets with some subset $S^A_i \subseteq B$. Similarly, each node $B_j \in B$ can only be in triplets with some subset $S^B_j \subseteq C$. Finally, each node $C_k \in C$ can only be in triplest with some subset $S^C_k \subseteq A$.
In this case, I don't think that connecting $A \rightarrow B$ and $B \rightarrow C$ according to $S^A$ and $S^B$ would work, because it does not capture the dependencies between $A$ and $C$.
But simply adding another set of connections $C \rightarrow A$ according to $S^C$ also wouldn't work as far as I can tell, because as you move from $C$ to $A$, there is no way to "remember" the dependency that you obeyed when going from $B$ to $C$ (if that makes any sense...).
In this situation, how would one solve the above using a reduction to a feasible circulation/network flow?
Thank you!