
Le 09/03/2012 03:07, Leo Hidd a écrit :
As for the compressed_sparse_row_graph, I can't get it working. I do the following:
typedef std::pair
Edge; typedef property < edge_weight_t, double > Edge_Cost; typedef compressed_sparse_row_graph no_property, // Vertex properties
Edge_Cost // Edge properties
csr_graph_t; typedef boost::graph_traits < csr_graph_t >::vertex_descriptor vertex_descriptor;
Edge* edge_list = new Edge [2*NbOfEdges];//then I fill it Edge_Cost* edge_weight_list = new Edge_Cost[2*NbOfEdges];//then I fill it csr_graph_t Graph_Boost (edges_are_unsorted, edge_list, edge_list+2*NbOfEdges, edge_weight_list, NbOfVertices); vertex_descriptor* p = new vertex_descriptor[num_vertices(Graph_Boost)]; double* d = new Scalar[num_vertices(Graph_Boost)]; dijkstra_shortest_paths_no_color_map(Graph_Boost,
0,
predecessor_map(p).
distance_map(d));
but it gives me a compilation error (related to the use of the dijkstra function) saying that none of the 6 overloads of boost::get, including:
boost::detail::csr_edge_index_map
boost::getboost::directedS,boost::no_property,Edge_Cost,boost::no_property,size_t,Vert...(boost::edge_index_t,const boost::compressed_sparse_row_graph &)
could anyone give me a hand on this here? Do any of you have an working example using compressed_sparse_row_graph graph type for SSSP with dijkstra_shortest_paths, for example?