GraphTraversal

GraphTraversal - CMSC 132: Object-Oriented Programming II...

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

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Department of Computer Science University of Maryland, College Park
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Graph Data Structures Many-to-many relationship between elements Each element has multiple predecessors Each element has multiple successors
Background image of page 2
3 Graph Definitions Node Element of graph State List of adjacent/neighbor/successor nodes Edge Connection between two nodes State Endpoints of edge A
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Graph Definitions Directed graph Directed edges Undirected graph Undirected edges
Background image of page 4
5 Graph Definitions Weighted graph Weight (cost) associated with each edge
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Graph Definitions Path Sequence of nodes n 1 , n 2 , … n k Edge exists between each pair of nodes n i , n i+1 Example A, B, C is a path A, E, D is not a path
Background image of page 6
7 Graph Definitions Cycle Path that ends back at starting node Example A, E, A A, B, C, D, E, A Simple path No cycles in path Acyclic graph No cycles in graph
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Graph Definitions Reachable Path exists between nodes Connected graph Every node is reachable from some node in graph Unconnected graphs
Background image of page 8
Graph Operations Traversal (search) Visit each node in graph exactly once
Background image of page 9

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

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

This note was uploaded on 12/04/2011 for the course CMSC 132 taught by Professor Padua-perez during the Spring '08 term at Maryland.

Page1 / 24

GraphTraversal - CMSC 132: Object-Oriented Programming II...

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

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