
On Mon, 12 Mar 2012, Leo Hidd wrote:
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 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?
It looks like you may not be passing your weight map into dijkstra_shortest_paths. If that isn't the problem, what are the exact types the compiler says that you are trying to pass to boost::get? Where is dijkstra_shortest_paths_no_color_map is it failing (which line, and which instantiation stack)? -- Jeremiah Willcock