Predecessor subgraph of BFS Q Predecessor subgraph of BFs is E 丌51 where Vx={v∈v:xlv]≠NL}U{s}and Er=(TVLD:::::: vEVr-s)
Pred b hf S decessor su bgrap h o f BF S s w r x v Pd b h f BFS i t y Pre decessor su bgrap h o f BFS is G π = ( Vπ , Eπ ), where u Vπ = { v ∈ V : π [ v] ≠ NIL } ∪ { s } an d Eπ = { ( π [ v], v): v ∈ Vπ − { s} }
Depth-first search Given a graph G=(v, E), depth-first search is to search deeper in the graph whenever possible. Edges are explored out of the most recently discovered vertex v that still has unexplored edges leaving it
Depth-f h irst search Gi en a graph Given a graph G = (V, E), depth-first search is to first search is to search deeper in the graph whenever possible. Edges are explored out of the most recently discovered are explored out of the most recently discovered vertex v that still has unexplored edges leaving it. u v w x y x
Depth-first search example x TOP→ S
Depth-f hl irst search example / u v w 11/12 12/12 12/12 12/12 12/12 12/12 x y x TOP u S
Depth-first search example 2 x xTOP→v L S
Depth-f hl irst search example / u v w 11/12 12/12 12/12 12/12 12/12 12/12 x y x TOP v u S
Depth-first search example 2 3/ 7OP→→ x yyUS
Depth-f hl irst search example / u v w 11/12 12/12 12/12 12/12 13/12 12/12 x y x TOP v y u S