I am constructing a boost graph. For every connected component in the graph, I would like to propagate a unique ID value for every vertex in that connected component. I am wondering if there is a way to do this using Boost
's BFSVisitor
Concept?
I am guessing this can be done using the examine_edge
function (http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/BFSVisitor.html), but I am having a hard time figuring out implementing a class like that. Any insights/links to examples would greatly help!
connected_components()
. It's second argument is a writable property map, where integer labels will be written. – taketwo