Strongly Connected Components¶
A strongly connected component of a directed graph G=(V, E) is a maximal set of vertices C\subseteq V, such that for every pair of vertices u and v in C, they are reachable from each other.
Strongly connected components are: $$ {a,b,e},{c,d},{f,g},{h} $$
DFS and Transpose of a graph¶
DFS often works as a subroutine in another algorithm
- Classifying edges
- Topological sort
- Strongly Connected Components
Transpose of a graph:
Given a graph G = (V, E)
- Its transpose graph is
G^T=(V,E^T),where\\
E^T=\{(u,v):(v,u)\in E\}
- Transpose graph G^T has the same vertex set as G, but has a different edge set from G, where directions of the edges are reversed.
G and G^T has exactly the same strongly connected components.
- Vertices u and v are reachable from each other in G if and only if they are reachable from each other in G^T
Algorithm¶
1 2 3 4 5 6 7 |
|
Running Example¶
Last update:
February 20, 2019