Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set of vertex-disjoint cycles so that each vertex belongs to a cycle

Here I have a directed graph G. I need to to determine whether there exists a set of vertex-disjoint cycles so that each vertex belongs to a cycle.

I'm not sure if this can be done in polynomial time or if its NP-Complete? Can anyone atleast point me in the right direction?

like image 677
jtaylor Avatar asked Oct 21 '25 04:10

jtaylor


1 Answers

Split each vertex into an "in" vertex and an "out" vertex. Then a vertex-disjoint cycle cover corresponds to a perfect matching on this graph. You can find out the answer to your question as fast as you can find perfect matchings (i.e. polynomial time)

like image 150
Hunter Avatar answered Oct 26 '25 19:10

Hunter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!