1
$\begingroup$

Given a directed graph $G$ with non-singular adjacency matrix,

Q. Is there a directed subgraph $H$ in $G$ that can be represented as the union of disjoint cycles such that $H$ contains all nodes of $G$?

$\endgroup$
2
  • $\begingroup$ Do you want the cycles to be directed? $\endgroup$
    – KhashF
    Commented Apr 7 at 20:06
  • $\begingroup$ Yes, they are also directed sub-graph of $G$. $\endgroup$
    – ABB
    Commented Apr 7 at 20:13

2 Answers 2

3
$\begingroup$

There is an edge emanating from any vertex of $G$ because otherwise the corresponding row (or column, according to our convention for forming the adjacency matrix) would be zero. Label the vertices as $v_1,\dots,v_n$. According to the observation just made, for any $i$, we can pick an index $f(i)$ such that there is a directed edge from $v_i$ to $v_{f(i)}$—thus a function $f:\{1,\dots,n\}\rightarrow\{1,\dots,n\}$. There clearly exists an index $k$ and a positive integer $m$ such that $f^{\circ m}(k)=k$ and $k,f(k),\dots,f^{\circ (m-1)}(k)$ are pairwise distinct. Now $v_k,v_{f(k)},\dots,v_{f^{\circ (m-1)}(k)}$ is a directed cycle of $G$.

Update) The OP seems to be asking for a subgraph $H$ which is a disjoint union of directed cycles; and furthermore, contains all vertices of $G$. This harder question asks if every vertex of $G$ belong to a directed cycle. For this to hold, every vertex should belong to a directed cycle. My argument above shows that $G$ admits a directed cycle if no row of its adjacency matrix is zero. To show the stronger result that every vertex of $G$ belongs to a directed cycle, one should exploit the non-singularity of the adjacency matrix. Here is a simple argument based on the Cayley-Hamilton theorem: Denote the adjacency matrix by $A$—the entry $(i,j)$ is $1$ iff there is a directed edge from $v_i$ to $v_j$ ($i,j\in\{1,\dots,n\}$). By the Cayley-Hamilton theorem, there is a linear combination of $n\times n$ matrices $I,A,\dots,A^{n-1}$ which is zero and has $\pm\det(A)\neq 0$ as the coefficient of $I$. Considering entries $(i,i)$ ($1\leq i\leq n$ arbitrary), we deduce that for at least one of the matrices $A,\dots,A^{n-1}$ the entry at that position is non-zero. But if the entry $(i,i)$ of the $m^{\rm{th}}$ power of the adjacency matrix, $A^m$, is non-zero, then $v_i$ must lie on a directed cycle of length at most $m$.

Update 2) I am adding my comments to the solution following OP's request. The solution is really Fedor Petrov's. My solutions above were only partial.

There exist disjoint directed cycles containing all vertices of $G$ if and only if the adjacency matrix, $A$, has non-zero permanent (which is of course the case if the adjacency matrix is non-singular).

Writing $A$ as $[a_{ij}]_{1\leq i,j\leq n}$ where $a_{ij}$'s are non-negative integers, ${\rm{perm}}(A)\neq 0$ iff there exists a permutation $\sigma:\{1,\dots,n\}\rightarrow\{1,\dots,n\}$ with $a_{1\sigma(1)}\dots a_{n\sigma(n)}\neq 0$. The cyclic decomposition of $\sigma$ then yields the desired disjoint cycles. Conversely, any collection of disjoint cycles of the graph $G$ involving all $n$ vertices amounts to a permutation $\sigma$ of $\{1,\dots,n\}$ for which $a_{1\sigma(1)}\dots a_{n\sigma(n)}\neq 0$.

Finally, the OP asked about the algorithmic aspect of this problem. I came across the following from the Theoretical CS Stack Exchange: cstheory.stackexchange.com/a/32887. By Valiant's theorem, the problem of computing the permanent for a binary matrix is #P-complete. But the problem of deciding if ${\rm{perm}}(A)\neq 0$, or more generally, finding a permutation $\sigma$ with $a_{1\sigma(1)}\dots a_{n\sigma(n)}\neq 0$, has a polynomial-time solution because, as the link above outlines, it can be translated into the problem of finding a perfect matching in a bipartite graph.

$\endgroup$
4
  • $\begingroup$ If I understand correctly, you are trying to find a disjoint union of cycles containing all nodes of $g$. If so, how can we form other cycles? $\endgroup$
    – ABB
    Commented Apr 7 at 21:00
  • $\begingroup$ @ABB The way your question reads, it says subgraph. Do you want the subgraph to include all vertices of $G$? $\endgroup$
    – KhashF
    Commented Apr 7 at 22:30
  • $\begingroup$ Firstly, thank you very much for your insightful arguments and amendments. However, I believe the procedure is not yet complete. Both algorithms indicate that for a given node, one can definitely find a cycle containing it. I'm struggling to understand how one can arrange the set of disjoint cycles so that all nodes can feasibly be included in one of them. $\endgroup$
    – ABB
    Commented Apr 8 at 8:05
  • $\begingroup$ After finding the set of disjoint cycles containing all nodes of $G$, the desired subgraph $H$ is formed by the union of these disjoint cycles. $\endgroup$
    – ABB
    Commented Apr 8 at 8:13
4
$\begingroup$

Well, if $V=\{1,\ldots,n\}$, $(a_{ij})_{1\leqslant i,j\leqslant n}$ is the adjacency matrix, and it is non-singular, then its determinant (considered as a sum over permutations) has a non-zero term $\prod_i a_{i,\sigma(i)}$. It corresponds to a disjoint collection of cycles (these are cycles of the permutation $\sigma$ on $V$) which cover all vertices.

$\endgroup$
7
  • $\begingroup$ Great! Seems that your are addressing it by a known theorem in a paper or some text. Could you please let me know the reference? $\endgroup$
    – ABB
    Commented Apr 8 at 14:00
  • $\begingroup$ What do you mean? I refer to the definition of the determinant as a sum over permutations, nothing more $\endgroup$ Commented Apr 8 at 14:20
  • $\begingroup$ I mean that how can we explicitly address the algorithm leading us those disjoint cycles if the adjacency matrix $A$ is given? $\endgroup$
    – ABB
    Commented Apr 8 at 14:32
  • 1
    $\begingroup$ Continued) For an algorithm to find such a union, a search in the CS Stack Exchange brings up this: cstheory.stackexchange.com/a/32887. The problem of finding a permutation $\sigma$ with $a_{1\sigma(1)}\dots a_{n\sigma(n)}\neq 0$ can be translated into the problem of finding a perfect matching in a bipartite graph; this problem has polynomial time complexity ($a_ij$'s the entries of the adjacency matrix). Once you have such a permutation $\sigma$, its cyclic decomposition provides you with the desired cycles. $\endgroup$
    – KhashF
    Commented Apr 8 at 15:42
  • 1
    $\begingroup$ @Khashf Your approach is now complete, it would be great if you add the recent comment in your answer below. $\endgroup$
    – ABB
    Commented Apr 8 at 16:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .