BGL: how to count and get the connected components in the spanning_tree

Hello, I am trying to get connected components in the MST. I have some undirected graph: ----------- BEGIN SNIP ------------------------ typedef adjacency_list < vecS, vecS, undirectedS, no_property, property < edge_weight_t, MyFloat > > Graph; typedef property_map<Graph, edge_weight_t>::type EdgeWeightMap; Graph graphFOF; ... Fill the graph.. //Get the MST property_map < Graph, edge_weight_t >::type weight = get(edge_weight, graphFOF); std::vector < Edge > spanning_tree; std::cout << "Building MST:." ; kruskal_minimum_spanning_tree(graphFOF, std::back_inserter(spanning_tree)); std::cout << " .. done " << std::endl; // // Here is problem: How to use MST edges for filtering the graphFOF?? positive_edge_weight<EdgeWeightMap> filter(meanW, get(edge_weight, graphFOF)); filtered_graph<Graph, positive_edge_weight<EdgeWeightMap> > fg(graphFOF, filter); std::vector<int> component(num_vertices(fg)); int num = connected_components(fg, &component[0]); ------------END SNIP--------------------------- How to count and get the connected components in the spanning_tree? Thank you beforehand. Arman. -- View this message in context: http://www.nabble.com/BGL%3A-how-to-count-and-get-the-connected-components-i... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (1)
-
arm2arm