[prev] 61 [next]

Graph Traversal

A common class of graph algorithms involves
  • walking along edges and visiting vertices
  • recording e.g. path taken, vertices visited, etc.
isPath() is a simple instance of a graph traversal

A more useful traversal would be findPath()

  • show me a path from v to w, if one exists
Two approaches to graph traversal:   depth-first,   breadth-first.