lec13 - MIT OpenCourseWare http://ocw.mit.edu 6.006...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MIT OpenCourseWare http://ocw.mit.edu 6.006 Introduction to Algorithms Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms . Lecture 13 Searching II 6.006 Spring 2008 Lecture 13: Searching II: Breadth-First Search and Depth-First Search Lecture Overview: Search 2 of 3 Breadth-First Search Shortest Paths Depth-First Search Edge Classification Readings CLRS 22.2-22.3 Recall: graph search: explore a graph e.g., find a path from start vertices to a desired vertex adjacency lists: array Adj of | V | linked lists for each vertex u V, Adj[ u ] stores u s neighbors, i.e. { v V | ( u, v ) E } v- just outgoing edges if directed a b c a b c c c b a Adj Figure 1: Adjacency Lists 1 Lecture 13 Searching II 6.006 Spring 2008 . . . level s level 1 level 2 last level Figure 2: Breadth-First Search Breadth-first Search (BFS): See Figure 2 Explore graph level by level from S level = { s } level i = vertices reachable...
View Full Document

This note was uploaded on 09/24/2010 for the course CS 6.006 taught by Professor Erikdemaine during the Spring '08 term at MIT.

Page1 / 6

lec13 - MIT OpenCourseWare http://ocw.mit.edu 6.006...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online