Strongly Connected Components

Mutual reachability in directed graphs. Kosaraju and Tarjan algorithms. The condensation DAG.

45 lessons
130 min

Lessons

1. Intro

(Why this section matters)

3m

2. What is an SCC?

(Mutual reachability)

3m

3. Why Find SCCs?

(Compression and structure)

3m

4. Kosaraju's Algorithm - Intuition

(Two DFS passes)

3m

5. Kosaraju's Algorithm - Steps

(Implementation outline)

3m

6. Kosaraju Example

(4-node directed graph)

3m

7. Kosaraju - Implementation

(C++ code)

3m

8. Quiz: Kosaraju's First DFS

Knowledge check

2m1 problems

9. Tarjan's Algorithm - Intuition

(Single DFS with low-link)

3m

10. Tarjan's Algorithm - Steps

(Discovery and low-link)

3m

11. Tarjan Example

(Same 4-node graph)

3m

12. Tarjan - Implementation

(C++ code)

3m

13. Kosaraju vs Tarjan

(When to use which)

3m

14. Quiz: Tarjan's Low-Link Values

Knowledge check

2m1 problems

15. The Condensation Graph

(DAG of SCCs)

3m

16. Building the Condensation Graph

(Implementation)

3m

17. Application: Dependency Analysis

Package managers, build sys...

3m

18. Application: 2-SAT Connection

(Boolean satisfiability)

3m

19. Quiz: Condensation Graph

Knowledge check

2m1 problems

20. Problem - Planets and Kingdoms (CSES 1683)

(CSES 1683 intro)

3m1 problems

21. Planets and Kingdoms - Approach

(SCC detection)

3m

22. Planets and Kingdoms - Implementation

(C++ code)

3m1 problems

23. Problem - Coin Collector (CSES 1686)

(CSES 1686 intro)

3m1 problems

24. Coin Collector - Approach

(SCC + DAG DP)

3m

25. Coin Collector - Implementation

(C++ code)

3m1 problems

26. Problem - Flight Routes Check (CSES 1682)

(CSES 1682 intro)

3m1 problems

27. Flight Routes Check - Approach

(SCC count)

3m

28. Flight Routes Check - Implementation

(C++ code)

3m1 problems

29. Quiz: SCC Problem Solving

Knowledge check

2m1 problems

30. Edge Cases for SCC Problems

(Self-loops and single nodes)

3m

31. Common SCC Mistakes

(Debugging tips)

3m

32. SCC in Undirected Graphs?

(Why it doesn't apply)

3m

33. When to Use SCC

(Problem recognition)

3m

34. Practice Problem 1

(SCC detection)

3m

35. Practice Problem 2

(Condensation graph DP)

3m

36. Practice Problem 3

(Reachability check)

3m

37. SCC and Bridges/Articulation Points

(Different concepts)

3m

38. SCC in Real-World Graphs

(Web, social, citation)

3m

39. Time Complexity Summary

(Both algorithms)

3m

40. Space Complexity Summary

(Memory usage)

3m

41. SCC and Cycle Detection

(Finding directed cycles)

3m

42. SCC and Topological Sort

(No direct connection)

3m

43. Quiz: SCC and Cycle Detection

Knowledge check

2m1 problems

44. SCC Templates

(Code references)

3m

45. Section Recap

(What you learned)

3m

Practice Problems

1.
3.
CheckpostsCodeforcesmedium
5.
SchemeCodeforceshard

Ready to start learning?

Access all 45 lessons with interactive content and progress tracking.