[Boost.Graph] Unreachable nodes and dijkstra_shortest_paths
Hello. How does the distance_map container looks like if you apply the dijkstra_shortest_paths algorithm on a graph, and the graph is not connected? So how does the entry d[i] looks like if it is not possible to reach node i from the start node of the dijkstra_algorithm? I couldn't find this information in the online manual, the case of the predecessor_map is described there but not the one of the distance map. Regards Ewgenij -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
On 7/16/07, Ewgenij Sokolovski
Hello. How does the distance_map container looks like if you apply the dijkstra_shortest_paths algorithm on a graph, and the graph is not connected? So how does the entry d[i] looks like if it is not possible to reach node i from the start node of the dijkstra_algorithm? I couldn't find this information in the online manual, the case of the predecessor_map is described there but not the one of the distance map.
Hi Ewgenij, Every entry in the distance map is initialized with std::numeric_limits<D>::max(), where D is the value type held by the distance map. You can override this by supplying the parameter "inf" described in the documentation. Regards, Aaron
participants (2)
-
Aaron Windsor
-
Ewgenij Sokolovski