Digraphs-handouts-2

# Digraphs-handouts-2 - Shortest Path 1:51 AM Directed Graphs...

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

Shortest Path 3/13/2006 1:51 AM 1 Directed Graphs 1 Directed Graphs JFK BOS MIA ORD LAX DFW SFO Directed Graphs 2 Outline and Reading (§6.4) Reachability (§6.4.1) ± Directed DFS ± Strong connectivity Transitive closure (§6.4.2) ± The Floyd - Warshall Algorithm Directed Acyclic Graphs (DAG’s) (§6.4.4) ± Topological Sorting

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

View Full Document
Shortest Path 3/13/2006 1:51 AM 2 Directed Graphs 3 Digraphs A digraph is a graph whose edges are all directed ± Short for “directed graph” Applications ± one -w ay streets ± flights ± task scheduling A C E B D Directed Graphs 4 Digraph Properties A graph G=(V,E) such that ± Each edge goes in one direction: ² Edge (a,b ) goes from a to b , but not b to a. If G is simple, m < n(n-1). If we keep in-edges and out-edges in separate adjacency lists, we can perform listing of of the sets of in-edges and out-edges in time proportional to their size. A C E B D
Shortest Path 3/13/2006 1:51 AM 3 Directed Graphs 5 Digraph Application Scheduling: edge (a,b ) means task a must be completed before b can be started The good life ics141 ics131 ics121 ics53 ics52 ics51 ics23 ics22 ics21 ics161 ics151 ics171 Directed Graphs 6 Directed DFS We can specialize the traversal algorithms (DFS and BFS) to digraphs by traversing edges only along their direction In the directed DFS algorithm, we have four types of edges ± discovery edges ± back edges ± forward edges ± cross edges A directed DFS starting at a vertex s determines the vertices reachable from s A C E B D

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

View Full Document
Shortest Path 3/13/2006 1:51 AM 4 Directed Graphs 7 Reachability DFS tree rooted at v: vertices reachable from v via directed paths A C E B D F A C E D A C E B D F Directed Graphs 8 Strong Connectivity Each vertex can reach all other vertices a d c b e f g
Shortest Path 3/13/2006 1:51 AM 5 Directed Graphs 9 Pick a vertex v in G.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/10/2009 for the course CS 401 taught by Professor Cs401 during the Spring '08 term at Illinois Tech.

### Page1 / 18

Digraphs-handouts-2 - Shortest Path 1:51 AM Directed Graphs...

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

View Full Document
Ask a homework question - tutors are online