Graph Search: Exercise

  • Identify reachable vertices in a graph from a source vertex.

Exercise Identify the set of vertices reachable from ss and from xx, in the following graph:

Solution
  • The set of vertices reachable from ss is {s,u,v}\{s, u, v\}.
  • The set of vertices reachable from xx is {x}\{x\}.