In this video, we solve the “Planets and Kingdoms” problem from the CSES Problem Set using **Kosaraju's Algorithm** to find **Strongly Connected Components (SCCs)** in a directed graph.
This is a classic and fundamental problem in Graph Theory where we classify each planet into a distinct kingdom such that within a kingdom, every planet is reachable from every other.
🔥 What You’ll Learn:
- How to implement Kosaraju’s Algorithm
- Two-pass DFS: first on original graph, then on reversed graph
- How to find SCCs and assign components
- Applications of SCCs in real-world problems
📘 Problem Link: https://cses.fi/problemset/task/1683/
📚 Topic Tags: Graphs, Kosaraju, DFS, SCCs, Competitive Programming
💡 Great practice for mastering Graph Traversals and Strong Connectivity concepts!
📄 𝐍𝐨𝐭𝐞𝐬: https://github.com/yash7xm/cp_notes/tree/master/cses/graphs
#Kosaraju #GraphTheory #SCC #CompetitiveProgramming #DFS #CSES
Download
0 formats
No download links available.
Planets and Kingdoms (CSES) | Kosaraju’s Algorithm explained for Strongly Connected Components (SCC) | NatokHD