This is an EventVisitor that records
the predecessor (or parent) of a vertex in a predecessor property
map. This is particularly useful in graph search algorithms where
recording the predecessors is an efficient way to encode the search
tree that was traversed during the search. The predecessor recorder is
typically used with the on_tree_edge or
on_relax_edge events and cannot be used with vertex events.
predecessor_recorder can be used with graph algorithms by
wrapping it with an algorithm-specific adaptor, such as bfs_visitor and dfs_visitor. Also, this event
visitor can be combined with other event visitors using
std::pair to form an EventVisitorList.
Algorithms such as Dijkstra's and breadth-first search will not assign
a predecessor to the source vertex (which is the root of the search
tree). It is often useful to initialize the source vertex's
predecessor to itself, thereby identifying the root vertex as the only
vertex which is its own parent. When using an algorithm like
depth-first search that creates a forest (multiple search trees) it
is useful to initialize the predecessor of every vertex to itself. This
way all the root nodes can be distinguished.