Introduction
A Strongly Connected Component (SCC) in a directed graph is a maximal set of vertices where every vertex is reachable from every other vertex.
Example: In a social network where edges represent "follows," an SCC represents a group where everyone can see everyone else's content through some chain of follows.
Properties:
- Every vertex belongs to exactly one SCC
- SCCs partition the vertices of the graph
- The graph of SCCs (condensation graph) is always a DAG
Applications:
- Finding circular dependencies in software modules
- Analyzing strongly connected networks
- Computing the 2-SAT satisfiability problem
- Model checking in formal verification
Kosaraju's Algorithm
Kosaraju's algorithm finds all SCCs in time using two DFS passes.
Idea: If we process vertices in the right order, a single DFS from a vertex will visit exactly its SCC and nothing else.
Algorithm: