// Solving by Robinkin from Devonit # include
#include
USING NAMESPACE BOOST;
intmain (int, char * []) {typedef adjacency_list
Const int num_nodes = 5; enum nodes {a, b, c, d, e}; char name [] = "abcde"; Edge Edge_Array [] = {Edge (A, C), Edge (B, B), Edge (B, D), EDGE (B, E), EDGE (C, B), EDGE (C, D), EDGE (E), EDGE (E, A), Edge (E, B)}; int Weights [] = {1, 2, 1, 2, 7, 3, 1, 1, 1};
int num_arcs = sizeof (edge_array) / sizeof (Edge); graph_t g (edge_array, edge_array num_arcs, weights, num_nodes); property_map
Dijkstra_shortest_paths (g, s, predecessor_map (& P [0]). Distance_map (& D [0]));
Std :: cout << "<< std :: endl; graph_traits
// Output: distances and piers: distance (a) = 0, Parent (a) = adistance (b) = 6, Parent (b) = edistance (c) = 1, Parent (c) = adistance (d) = 4 , Parent (d) = cdistance (e) = 5, Parent (e) = d