 to
calculate the shortest distances to each vertex, but perhaps we also wanted to
record the tree of shortest paths. One way to do this is to record the
predecessor (parent) for each node in the shortest-paths tree.
<p>It would be nice if we could avoid rewriting Dijkstra's algorithm, and just
add that little bit extra needed to record the predecessors <a href="#1">[1]</a>. In the STL, this
kind of extensibility is provided by functors, which are optional parameters to
each algorithm. In the BGL this role 