I have a Graph Represented With Following Code :
typedef adjacency_list < vecS, vecS, directedS, property < vertex_name_t, idType >, property < edge_weight_t, double > > graph_t;
I Have two Questions :
how to feed My Graph into Dijkstra Algorithm in Boost, I mean how to extract the Properties from My Graph (which is thousands of Vertices and Edges) to Feed Dijkstra Parameters.
The Output of The Algorithm in The Example is the Shortest Path between one node in The Graph, and The rest Nodes, so How I can Get Only The Shortest Path Between My Source and Target Node Only ? should I filter the Output result to build My Shortest Path Vector ?
//===========================================================================
MyAlgorithm::MyAlgorithm(graph_t AnyGraph, Vertex VSource){// Parameters Constructor
MyGraph = AnyGraph;
vector<Vertex> p(num_vertices(AnyGraph));
// for(auto j = p.begin(); j != p.end(); ++j)
// cout <<"P["<< *j<<"] = "<<p[*j]<<endl;
vector<double> d(num_vertices(AnyGraph));
// for(auto j2 = d.begin(); j2 != d.end(); ++(j2))
// cout <<"d ["<< *(j2)<<"] = "<<d[*(j2)]<<endl;
//===========================================================================
//Dijkstra_Algorithm
//===========================================================================
cout<<"Before\t"<<endl;
dijkstra_shortest_paths(AnyGraph, VSource,
predecessor_map(boost::make_iterator_property_map(p.begin(), get(boost::vertex_index, AnyGraph))).
distance_map(boost::make_iterator_property_map(d.begin(), get(boost::vertex_index, AnyGraph))));
cout<<"After\t"<<endl;
//===========================================================================
}// End of Parameters Constructor