Application 2: Strongly Connected Components
Explore how to identify strongly connected components in directed graphs using graph traversal methods. Understand the process and correctness of Kosaraju's algorithm, which uses forward and backward depth-first searches to decompose graphs. Learn how this decomposition helps analyze graph structure and solve related problems.
We'll cover the following...
In this lesson, we use graph traversal to separate a directed graph into its strongly connected components. Such a decomposition can reveal useful information on the graph structure and can be the first step for more involved graph algorithms.
Strongly connected components
Recall that a directed graph is called strongly connected when any pair of nodes can reach each other. Even if the whole graph is not strongly connected, it can be split up into parts called its strongly connected components (SCCs).
The following illustration shows a graph with three strongly connected components, marked in green, red, and blue, respectively.
For example, the nodes and are in the same SCC, as we can reach node from node and also reach node from node (via node ). On the other hand, nodes and are in distinct SCCs: although we can go from node to node , there is no way to go from node to node .
After identifying strongly connected components in a graph , we can contract them to form a new graph , called the contracted component graph of . The nodes of the contracted component graph are the SCCs of . There is an edge between SCCs and ...