BFSBaum
BFSBaum, or BFS tree, is the spanning tree obtained when a breadth-first search is executed on a graph G starting from a designated root vertex r. As BFS progresses, vertices are discovered in nondecreasing distance from r, and for every vertex v that is first encountered via a predecessor u, the edge (u, v) becomes part of the BFS tree. The root has no parent, and the collection of such tree edges connects all vertices reachable from r, forming a spanning tree of the root's connected component.
Key properties: the distance from r to any vertex in the BFS tree equals the length of
Algorithmic notes: constructing a BFS tree requires a queue to manage the frontier, and an array or
Applications: BFS trees are used to compute single-source shortest paths in unweighted graphs, test reachability and