{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Graphs 1.6 - Depth-First Search Explore every edge starting...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Last Updated: 4/1/10 10:16 AM CSE 2011 Prof. J. Elder - 26 - Depth-First Search ± Explore every edge, starting from different vertices if necessary. ± As soon as vertex discovered, explore from it. ± Keep track of progress by colouring vertices: ² Black: undiscovered vertices ² Red: discovered, but not finished (still exploring from it) ² Gray: finished (found everything reachable from it).
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Last Updated: 4/1/10 10:16 AM CSE 2011 Prof. J. Elder - 27 - DFS Example on Undirected Graph D B A C E D B A C E D B A C E discovery edge back edge A finished A unexplored unexplored edge A being explored
Image of page 2
Last Updated: 4/1/10 10:16 AM CSE 2011 Prof. J. Elder - 28 - Example (cont.) D B A C E
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon