Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2008-06-27 00:48:03


Vladimir Prus wrote:
> Abde Ali Kagalwalla wrote:
>
>> Hi,
>>
>> I want to use the BFS to detect cycles in a graph I constructed using
>> bundled vertex properties. I want a feature that as soon as I detect a
>> cycle, I can do some processing on the cycle path and then go back to look
>> for other cycles in the main graph.
>
> So, you want to do something for each cycle in the graph? Not for each
> strongly connected component? There are algorithms for enumerate all
> cycles in a graph, but those algorithms are not included in BGL, and
> a far from easy.

Maybe I'm missing something, but isn't this as easy as hooking back_edge
on a DFSVisitor and using depth_first_search?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net