A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Strongly Connected Components

College Depth 77 in the knowledge graph ☐ I know this ☆ Set as goal
1topic build on this
415prerequisites beneath it
See this on the map →
Directed Graphs and DigraphsGraph Paths, Cycles, and Connectivity+1 more→→Graph Condensation and Metagraph
directed-graphs connectivity components

Core Idea

A strongly connected component (SCC) is a maximal subset of vertices where every vertex is reachable from every other vertex following directed edges. Partitioning a digraph into SCCs reveals its underlying structure and identifies cycles.

Explainer

From your prerequisite on directed graphs, you know that a digraph's edges have direction — getting from A to B doesn't mean you can get from B to A. This asymmetry creates a richer notion of connectivity than in undirected graphs. A strongly connected component (SCC) is a maximal group of vertices where mutual reachability holds: from any vertex in the group, you can follow directed edges to reach every other vertex in the group. "Maximal" means you can't add any more vertices to the group while preserving this mutual reachability.

Think of a social network where edges represent "can directly contact." An SCC is a clique of mutual accessibility — a set of people who can all communicate with each other along the directed links. Vertices outside each other's SCCs have one-way or no reachability. A digraph always decomposes into SCCs, and this decomposition is unique: every vertex belongs to exactly one SCC (even if it's a trivial SCC of size 1, a vertex that can't reach itself).

The two classic algorithms — Kosaraju's and Tarjan's — both run in O(V+E) time using depth-first search from your graph connectivity background. Kosaraju's is conceptually clean: run DFS on the original graph, recording finish times; then run DFS on the *reversed* graph in decreasing finish-time order. Each DFS tree in the second pass is exactly one SCC. The key insight is that reversing all edges swaps "reachable from" with "can reach" — so the two passes together identify exactly the mutual-reachability clusters.

Once you've found all SCCs, you can build the condensation digraph: collapse each SCC to a single super-vertex and keep the inter-SCC edges. The condensation is always a DAG (directed acyclic graph) — if it had a cycle, those SCCs would merge into one larger SCC, contradicting maximality. This DAG view is powerful: it reveals the large-scale flow structure of the original graph, which is the first step toward topological sorting and understanding which parts of a system can influence other parts without possibility of feedback.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Literal Equations → Slope-Intercept Form → Point-Slope Form → Writing Linear Equations → Parallel and Perpendicular Line Slopes → Graphing Linear Equations → Piecewise Functions → Step Functions → Composition of Functions → Inverse Functions → Radical Functions and Graphs → Rational Exponents → Exponential Functions and Graphs → Logarithms Introduction → Big-O Notation and Asymptotic Analysis → Depth-First Search (DFS) → Strongly Connected Components

Longest path: 78 steps · 415 total prerequisite topics

Prerequisites (3)

Leads To (1)