I need a functions thats find a cycle in an undirected graph (boost) and returns its vertices and edges. It needs only return the vertices/edges of one cycle in the graph.
My question is – what is the best way to do this using with boost? I am not experienced using it.
I need a functions thats find a cycle in an undirected graph (boost) and
Share
If you want to find a cycle, then using depth first search should do just fine. The DFS visitor has a back_edge function. When it’s called, you have an edge in the cycle. You can then walk the predecessor map to reconstruct the cycle. Note that:
strong_componentsfunction, to find, well, strong components