Preliminaries
We consider directed bipartite graphs of the form $G = (V,V',E)$, in which the nodes are partitioned into $V = \{1,\ldots,n\}$ and $V'=\{1',\ldots,n'\}$, with $|V|=|V'|=n$, and $E\subseteq (V\times V')\cup (V'\times V)$ is the set of directed arcs.
The "stacking operation" $\otimes$ between two directed bipartite graphs of this form $G_1$, $G_2$ (having the same number of nodes) returns the directed tripartite graph $G_1\otimes G_2$ obtained by merging nodes $\{1',\ldots,n'\}$ of $G_1$ with nodes $\{1,\ldots,n\}$ of $G_2$, as shown in the figure below (where $n=5$). Operation $\otimes$ can be naturally extended to stack $h$- and $k$-partite graphs, for all $h,k\geq 2$, as shown in the fourth column of the same figure; the resulting graph is an $(h+k-1)$-partite graph.
Problem
I am trying to find the complexity of the following problem:
Instance: $m$ bipartite graphs $G_1=(V,V',E_1),\ldots,G_m=(V,V',E_m)$ defined as above, each with $2n$ nodes.
Question: is there a sequence $i_1,\ldots,i_p\in\{1,\ldots,m\}$, with $p\in\mathbb{N}$, such that graph $\bigotimes_{j=1}^p G_{i_j}$ contains a cycle?
Example
$G_1$ and $G_2$ form a no-instance for this problem. On the other hand, $G_1$, $G_2$ and $G_3$ (see figure below) form a yes-instance, since graph $G_1\otimes G_3\otimes G_1\otimes G_1\otimes G_2\otimes G_1\otimes G_3$ contains a cycle (highlighted in red in the figure).
What I already know
It is not hard to show that the problem can be solved in polynomial time when there are exactly two arcs for each graph $G_i$, using the following algorithm:
- create a directed graph $\mathcal{G}$ with $m$ nodes and such that there is an arc from node $i$ to node $j$ if and only if, given $s,t,p,q\in\{1,\ldots,n\}$ such that $E_i = \{(s,t'),(p',q)\}$, then there exist $u,r\in\{1,\ldots,n\}$ such that $E_j = \{(t,u'),(r',p)\}$ (here $E_i$ and $E_j$ indicate the arc sets of graphs $G_i$ and $G_j$, respectively);
- denote by $V_s$ (start-nodes) the set of all the nodes $i$ in $\mathcal{G}$ such that there exist $p,q,r\in\{1,\ldots,n\}$ for which $E_i=\{(p,q'),(r',p)\}$;
- denote by $V_e$ (end-nodes) the set of all the nodes $i$ in $\mathcal{G}$ such that there exist $p,q,r\in\{1,\ldots,n\}$ for which $E_i=\{(p,q'),(q',r)\}$;
- find if there exists a path from a node in $V_s$ to any node in $V_e$. $G_1,\ldots,G_m$ form a yes-instance of the problem if and only if at least one of such paths exists.
I am not sure whether this procedure can be extended to a polynomial algorithm also when considering graphs without a fixed number of arcs, since the number of nodes in $\mathcal{G}$ can be higher than $m$ in this case. For instance, the graph $\mathcal{G}$ associated to the example above is
1_1 -> 3_1 -> 1_2 -> 1_3 -> 2 -> 1_4 -> 3_2
which has $7>m=3$ nodes.
Question
Is the complexity of the general problem (in which the number of arcs in each graph $G_i$ is not fixed) known? Any reference on similar problems would be useful.