DFS/BFS Tree

BFS tree (page 16/21)

Definition: the BFS tree is the subgraph made of:

  • all vertices such that
  • all edges , for as above (except )
  • How do we create a BFS tree? Using the algorithm above and having those properties hold. ahh just use the parent[w] thing

Page (16/21)

The BFS tree is a tree.

  • Note that the BFS tree is not always unique then

Subclaims

  • The levels in the queue are non-decreasing
  • For all vertices , if there is an edge , then

Shortest path from BFS Tree (18/21)

For all :

  • there is a path in iff there is a path in
  • if so, the path in is a shortest path and