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")

Thank you for your advise in advance. ^^

  • 9
    $\begingroup$ There is an easy reduction to matching. Well known exercise in algorithms. $\endgroup$ Commented Oct 11, 2011 at 4:27
  • 3
    $\begingroup$ Is this your problem: en.wikipedia.org/wiki/Vertex_cycle_cover ? $\endgroup$ Commented Nov 15, 2013 at 17:58
  • 1
    $\begingroup$ @ThomasAhle Thanks, I was unaware of that wiki page. It is called 'disjoint cycle cover' mentioned in that wiki page. $\endgroup$
    – Peng Zhang
    Commented Mar 21, 2014 at 9:43

1 Answer 1


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.

  • 1
    $\begingroup$ Did you read the article I linked to? I see no mention of Euler tours there. $\endgroup$ Commented Nov 15, 2013 at 21:35
  • 1
    $\begingroup$ 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.. $\endgroup$ Commented Nov 15, 2013 at 23:17
  • 2
    $\begingroup$ 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? $\endgroup$ Commented Nov 18, 2013 at 7:28
  • 1
    $\begingroup$ I read the section in 'Algorithmic graph theory' as well, and they also seem to just imply that the matching obviously gives a 2-factor. Even though the matching obviously could 'collapse' into a 1-factor. $\endgroup$ Commented Nov 18, 2013 at 14:15
  • 1
    $\begingroup$ Sweet! I love this new reduction. Works perfectly. Thanks :) $\endgroup$ Commented Nov 20, 2013 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.