Showing posts with label Stack. Show all posts
Showing posts with label Stack. Show all posts

Tuesday, 18 May 2010

Algorithms – Depth/Breadth First Search

We have seen some of the key concepts to Graphs; What a node is, an edge – as well as definitions for Digraphs and Undirected Graphs – and other bits ‘n’ bobs :) .

But one question stills looms; How do we traverse a Graph?

Here we shall look at two of the key traversing algorithms for Graphs:

  • Depth First Search (DFS), and
  • Breadth First Search (BFS).