On Wed, Nov 19, 2008 at 12:39 PM, r89
Yes, I tried using add_vertex and add_edge and it works fine. But I assume that add_vertex and add_edge is much slower than using graph_t myGraph(array, edge_array + num_arcs, weights, num_nodes);
Is this true or not? Does anyone have experience on that? My graph has over 10^6 edges.
It's possible to make it just as fast using some details of BGL. There is a feature request for .reserve() functionality to be added to BGL, but for now you can just do this: graph.m_vertices.reserve(max_junctions); graph.m_edges.reserve(max_edges); // for directed graphs, also do in_edges graph.m_vertices[i].m_out_edges.reserve(num_edges); With those I can load graphs with close to 2.5 million edges in about 8 seconds (not *too* bad considering the graph is coming from a database). --Michael Fawcett