error in remove_edge() of subgraph

Hi all, I tried a clustering recursively cut the graph based on betweenness_centrality and form the connected components into subgraphs of the original big graph. It's convenient to use subgraph("graph.create_subgraph()"), but the trick is that whenever "remove_edge(e, subgraph)", the subgraph and its ancestor graph is not affected(not like what the doc says). Code sketch is like this: vector<double> edge_centrality(no_of_edges); EdgeCentralityMap ec_map(edge_centrality.begin(), get(edge_index, subgraph)); indirect_cmp<EdgeCentralityMap, std::less<centrality_type> > cmp(ec_map); brandes_betweenness_centrality(subgraph, edge_centrality_map(ec_map)); edgeDescriptor e = *max_element(edges(subgraph).first, edges(subgraph).second, cmp); centrality_type max_centrality = get(ec_map, e); std::cerr<<"max_centrality is "<<max_centrality<<std::endl; remove_edge(e, subgraph); std::cerr<<"after removal the subgraph has "<<num_edges(subgraph)<<" edges."<<std::endl; The last error-reporting sentence lets me find that the edge e is not removed from subgraph at all. Even I tried to remove e from graph("remove_edge(subgraph.local_to_global(e), graph)"), it also fails. I hope somebody could have a check on it. So i gave up the subgraph and directly create graphs(real graph) from the components of the ancestor graph. It worked out. Thanks, Yu
participants (1)
-
Yu Huang