adjacency_list directed to undirected conversion
Hi All, I have a directed adjacency_list graph for which I would like to identify connected components (ignoring the directed-ness). After poking around the BGL docs it seems that my best option is to role my own algo or build a edge_list graph from the original graph and run connected_components. Basically I want to identify disjoint subgraphs starting with a directed graph. Any advice is appreciated. thanks Sean
Sean Kelly wrote:
Hi All,
I have a directed adjacency_list graph for which I would like to identify connected components (ignoring the directed-ness). After poking around the BGL docs it seems that my best option is to role my own algo or build a edge_list graph from the original graph and run connected_components. Basically I want to identify disjoint subgraphs starting with a directed graph. Any advice is appreciated.
I consider a directed_to_undirected_graph adaptor would be useful. -- Regards, Janusz
Hi Guys, On Apr 26, 2006, at 3:42 AM, Janusz Piwowarski wrote:
Sean Kelly wrote:
Hi All,
I have a directed adjacency_list graph for which I would like to identify connected components (ignoring the directed-ness). After poking around the BGL docs it seems that my best option is to role my own algo or build a edge_list graph from the original graph and run connected_components. Basically I want to identify disjoint subgraphs starting with a directed graph. Any advice is appreciated.
I consider a directed_to_undirected_graph adaptor would be useful.
That does sound useful... note that you'd probably need the underlying graph to be bidirectional (provide both out-edges and in-edges). Cheers, Jeremy
On Apr 25, 2006, at 12:16 PM, Sean Kelly wrote:
I have a directed adjacency_list graph for which I would like to identify connected components (ignoring the directed-ness). After poking around the BGL docs it seems that my best option is to role my own algo
To do this, you could use the incremental connected components algorithms in the BGL. Those work equally well on directed and undirected graphs. Doug
participants (4)
-
Douglas Gregor
-
Janusz Piwowarski
-
Jeremy Siek
-
Sean Kelly