Finding all cycles in an undirected graph

前端 未结 2 1891
情话喂你
情话喂你 2021-01-12 00:11

If I have an undirected graph, how can I get a list of all cycles?

For example, from the following graph, I would want the cycles:

(a,b,d,e,c)
(a,b,c         


        
2条回答
  •  无人及你
    2021-01-12 00:18

    this is not possible in polynomial time as if possible then we could use this to find all cycles and hence cycle of largest length which implies we can solve hamiltonian cycle problem completely in polynomial time.

提交回复
热议问题