lec0427-GraphTraversals

lec0427-GraphTraversals - Announcements MP 7 available EC...

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

Announcements: MP 7 available. EC Due 12/01, 11:59p. Due 12/08, 11:59p. Final exam, 5/11, 7-10p. Locations tba via Exams page. Today: Graph Traversal n vertices, m edges • no parallel edges • no self-loops • Bounds are big-O Edge List Adjacency List Adjacency Matrix Space n + m n + m n 2 incidentEdges( v ) m deg( v ) n areAdjacent ( v, w ) m min(deg( v ), deg( w )) 1 insertVertex( o ) 1 1 n 2 insertEdge( v, w, o ) 1 1 1 removeVertex( v ) m deg( v ) n 2 removeEdge( e ) 1 1 1

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

View Full Document
Graphs – traversal Objective: Visit every vertex and every edge, in the graph, Purpose: We can search for interesting substructures in the graph, Contrast graph traversal to BST traversal: •Ordered •Obvious start
Graphs: Traversal - DFS http://www.cs.duke.edu/csed/jawaa2/examples/DFS.html http://www.student.seas.gwu.edu/~idsv/idsv.html http://www.youtube.com/watch?v=8qrZ1clEp-Y Ariadne, Theseus, and the Minotaur

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

View Full Document
Algorithm DFS(G) Input: graph G Output: labeling of the edges of G as discovery edges and
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 12

lec0427-GraphTraversals - Announcements MP 7 available EC...

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

View Full Document
Ask a homework question - tutors are online