22

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. ^^

Peng Zhang
  • 1,453
  • 9
  • 19

1 Answers1

25

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.

David Eppstein
  • 50,990
  • 3
  • 170
  • 278
  • 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
  • 1
    Did you read the article I linked to? I see no mention of Euler tours there. – David Eppstein Nov 15 '13 at 21:35
  • 1
    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
  • 2
    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 07:28
  • 1
    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. – Thomas Ahle Nov 18 '13 at 14:15
  • 1
    Sweet! I love this new reduction. Works perfectly. Thanks :) – Thomas Ahle Nov 20 '13 at 11:04
  • 1
    For values of "new" meaning published in 1954... You're welcome, anyway. Sorry for the confusion re the other reduction. – David Eppstein Nov 20 '13 at 19:14
  • That approach can apparently also be used to find optimal k-regular spanners, albeit not necessarily connected ones. – Manfred Weis Jan 16 '19 at 10:55
  • 1
    @ManfredWeis What is a k-regular spanner? Usually, graph spanners preserve paths, so they have to be connected. It seems that the approach can find k-regular spanning subgraphs, is that what you mean? – Thomas Ahle Dec 13 '19 at 10:35
  • 1
    @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
  • @ManfredWeis Right. And that's actually pretty cool, since finding a regular subgraph is NP hard for $k\ge 3$(!) https://www.sciencedirect.com/science/article/pii/0012365X84901134 – Thomas Ahle Dec 14 '19 at 13:29
  • @ThomasAhle that can't be true for simple undirected graphs, see e.g. An Algorithm for Calculating k-Factors by Meijer, Nunez-Rodriguez, and D. Rappaport; Tutte als provided a reduction to the matching problem. – Manfred Weis Dec 14 '19 at 16:04
  • Just want to note down for anyone who reads this in the future that the original reduction does work for directed graphs, but indeed fails for undirected ones. – inavda Feb 02 '22 at 00:41
  • I didn't get the construction... Can you explain it using an example, say K_3 (complete 3 vertex graph)? – nutella_eater May 13 '22 at 14:46