# Partition a graph into node-disjoint cycles

Related problem: Veblen’s Theorem states that "A graph admits a cycle decomposition if and only if it is even". The cycles are edge disjoint, but not necessarily node disjoint. Put another way, "The edge set of a graph can be partitioned into cycles if and only if every vertex has even degree."

My Problem: I wonder has anybody studied the partition a graph into node-disjoint cycles. That is, partition the vertices $V$ of a graph $G$ into $V_1, V_2, \cdots, V_k$, and each subgraph induced by $V_i$ is hamiltonian.

Is it NP-hard or easy?

More related problem: Partition into triangle is NP-complete. (Page 68 of "Computers and intractability")

• There is an easy reduction to matching. Well known exercise in algorithms. – Chandra Chekuri Oct 11 '11 at 4:27
• Is this your problem: en.wikipedia.org/wiki/Vertex_cycle_cover ? – Thomas Ahle Nov 15 '13 at 17:58
• @ThomasAhle Thanks, I was unaware of that wiki page. It is called 'disjoint cycle cover' mentioned in that wiki page. – Peng Zhang Mar 21 '14 at 9:43

A partition into vertex-disjoint cycles is the same thing as a 2-regular subgraph, more commonly known as a 2-factor. It can be found (if it exists) in polynomial time by an algorithm based on matching. E.g. see this link.

ETA Nov 2013: It seems from comments below that the reduction from the source linked above is wrong. However, the statement that the problem can be reduced to perfect matching remains correct. The correct reduction is in W. T. Tutte (1954), "A short proof of the factor theorem for finite graphs", Canadian J. Math. 6: 347–352.

Replace each vertex $v$ with degree $d$ by a complete bipartite graph $G_v=K_{d,\,d-2}$, and represent each edge $uv$ of the original graph by an edge from one vertex of $G_u$ to one vertex of $G_v$ (on the side of the bipartition with $d$ vertices) in such a way that each vertex of $G_v$ on that side of the bipartition has exactly one such edge incident to it.

Then a perfect matching in the modified graph has to match the $d-2$ vertices on their side of the bipartition of $G_v$ with $d-2$ out of the $d$ vertices on the other side, leaving exactly two free vertices that need to be matched with their neighbors in other subgraphs $G_u$. In this way, the perfect matchings of the modified graph correspond 1-for-1 with cycle covers of the original graph.

• I don't get it. All the mentions I've found, of this algorithm, start by computing an euler tour. However there are lots of graphs that are cycle coverable without having an euler tour. Is it also in P if we don't require all edges to be used? – Thomas Ahle Nov 15 '13 at 18:54
• Did you read the article I linked to? I see no mention of Euler tours there. – David Eppstein Nov 15 '13 at 21:35
• It's just a bit hard to understand. When you construct $E'$ by changing each edge $(i,j)$ to an edge from $V$ to $V'$ ($(i,j')$) how do you know which end to put in $V$ and which to put in $V'$? The paper seems to "just take the second one", but it's not a directed graph.. – Thomas Ahle Nov 15 '13 at 23:17
• I mean, I could also convert every undirected edge into a directed edge in each direction, but then the matching might just give me a lot of "length 2" cycles, no? – Thomas Ahle Nov 18 '13 at 7:28
• @ThomasAhle apparently mixed up terms; what I meant is a $k$-regular spanning graph, a.k.a $k$-factor – Manfred Weis Dec 13 '19 at 22:04