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

徘徊边缘 提交于 2021-02-07 20:56:59

问题


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?


回答1:


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)



来源:https://stackoverflow.com/questions/23121799/set-of-vertex-disjoint-cycles-so-that-each-vertex-belongs-to-a-cycle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!