Algorithms to Identify All the Cycle Bases in a UnDirected Graph

前端 未结 4 1869
梦谈多话
梦谈多话 2020-12-08 17:29

I have an undirected graph with Vertex V and Edge E. I am looking for an algorithm to identify all the cycle bases in that graph.

I think

4条回答
  •  猫巷女王i
    2020-12-08 18:06

    The standard way to detect a cycle is to use two iterators - for each iteration, one moves forward one step and the other two. Should there be a cycle, they will at some point point to each other.

    This approach could be extended to record the cycles so found and move on.

提交回复
热议问题