module documentation
Provides shortest_path_distances and shortest_path_tree functions for computing shortest paths in a weighted graph.
Function | shortest |
Compute shortest-path distances from src to reachable vertices of g. |
Function | shortest |
Reconstruct shortest-path tree rooted at vertex s, given distance map D. |
Compute shortest-path distances from src to reachable vertices of g.
Graph g can be undirected or directed, but must be weighted such that e.element() returns a numeric weight for each edge e.
Return dictionary mapping each reachable vertex to its distance from src.