Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL: counting connected components subgraph
From: Gábor Szuromi (kukkerman_at_[hidden])
Date: 2009-11-25 08:07:27


On second thought Prim's algorithm computes only the spanning tree of
the component the starting vertex belongs to. So instead you can use
the edge list returned by Kruskal's algorithm to mark tree edges and
then use filtered_graph to hide non-marked edges and transform the
original graph into a forest without creating a new graph. The
predecessor map can be used to identify the root node of trees.

Gabe


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