
On Feb 15, 2005, at 5:24 PM, gast128 wrote:
Sometimes this boost::graph stuff even suprises me from time to time. For example feeding a depth_search with a graph and vecS type vertex storage will work if the color map is not specified. However changing this to listS, and one gets a crash.
With listS, you'll need to create and maintain a mapping from vertices to index values, e.g., add a property<vertex_index_t, std::size_t> to the vertex properties, and be sure to set these properties to numbers in the range [0, num_vertices(g)). For instance, with graph g of type Graph: graph_traits<Graph>::vertex_iterator vi, vi_end; std::size_t i = 0; for(tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi, ++i) put(vertex_index, g, *vi, i); Doug