1 / 6

Hw. 6: Algorithm for finding strongly connected components.

Hw. 6: Algorithm for finding strongly connected components. Original digraph as drawn in our book and in class:. Nodes:. :. Edges:. Preorder label. Postorder label. Solid: tree edge Blue: back edge Green: cross edge. Reverse arrows on original digraph:.

lajos
Download Presentation

Hw. 6: Algorithm for finding strongly connected components.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hw. 6: Algorithm for finding strongly connected components. Original digraph as drawn in our book and in class: Nodes: : Edges: Preorder label Postorder label Solid: tree edge Blue: back edge Green: cross edge

  2. Reverse arrows on original digraph: Note: This is the same digraph with all of the arrows reversed. To find the connected components in this digraph we must now do a Depth First Search, beginning at the vertices with the highest Postorder value.

  3. Depth First Search beginning at vertices with the highest Postorder value: If we take a close look at our new edges, we see that the tree edges of the DFS beginning at vertices with the highest Postorder value form trees. This graph is in fact a forest.

  4. The last depth first search, drawn with only the tree edges: When the last graph is redrawn using only the tree edges from the last depth first search, the resulting graph is a forest. The trees that make up this forest are the strongly connected components of the original graph. Strongly Connected Component Strongly Connected Component Strongly Connected Component Strongly Connected Component

  5. To review: An algorithm to find the strongly connected components of a digraph. 1. Do a Depth First Search on graph, label vertices in Post Order. 2. Compute reverse directed graph (switch direction of all arrows). 3. Do a DFS on the reversed graph, starting at vertices with highest Post Order label. Continue until all of the reversed graph has been searched. 4. The results of the DFS on the reversed graph results in a forest. The trees of this forest are the strongly connected components of the original graph.

  6. Hw. 6>> Carmen Frerichs (252a-ao) I used gw_dfs* and gw_basic_graph_algorithms* to create the graphs that I used in my presentation.

More Related