This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: DFS on An Undirected Graph DFS can be used to find if an undirected graph is connected or not. DFS can also be used to find all the connected components. CS223 Advanced Data Structures and Algorithms 7 DFS on A Digraph DFS on A Digraph DFS(B): B,C,A,D,E,F; DFS(H): H,J,I; DFS(G): G. CS223 Advanced Data Structures and Algorithms 8 Strong Connected Components Strong Connected Components Perform DFS until all nodes are visited. Construct an auxiliary graph G r . Perform DFS on G r in the reverse order of the numbers. CS223 Advanced Data Structures and Algorithms 9 Strong Connected Components Strong Connected Components DFS(G): G; DFS(H): H,I,J; DFS(B): B,A,C,F; DFS(D): D; DFS(E): E. Strong Connected Components: (G), (H,I,J), (B,A,C,F),(D),(E) G r The spanning tree after the first DFS...
View
Full Document
 Spring '07
 Tang
 Algorithms, Graph Theory, Data Structures, CS223 Advanced Data

Click to edit the document details