graph type used in BGL function "connected_components()"
Hi,
I have a question about the graph type used in BGL function
"connected_components()".
When I define the graph type to be:
adjacency_list
Qiaofeng Yang wrote:>
I have a question about the graph type used in BGL function "connected_components()".
When I define the graph type to be: adjacency_list
Everything is OK. When I change the graph type to be: adjacency_list
I got a lot of compilation error messages. Anybody knows why is so? Was "connected_components()" only implemented on one particular implementaton of graphs like vecS?
If you want to use list as containter for vertices, you must provide also vertex_index map, needed by connected_components algorithm. Regards, Janusz
On Apr 9, 2005, at 9:14 PM, Qiaofeng Yang wrote:
Hi,
I have a question about the graph type used in BGL function "connected_components()".
When I define the graph type to be: adjacency_list
Everything is OK. When I change the graph type to be: adjacency_list
I got a lot of compilation error messages. Anybody knows why is so? Was "connected_components()" only implemented on one particular implementaton of graphs like vecS?
connected_components can work with either graph, but with the listS graph you'll need to either (1) supply a vertex_index property map that goes from vertices to indices or (2) supply a color_map. The example dijkstra-example-listS.cpp illustrates how to build and use a vertex_index property map. Doug
participants (3)
-
Doug Gregor
-
Janusz Piwowarski
-
Qiaofeng Yang