Graph Theory Algorithms for Competitive Programming, taught in C++ by Google software engineers Prateek Narang and Apaar Kamal, is built around a simple idea: the same graph algorithms behind maps, social networks, and build tools also show up constantly in coding contests.
Two Parts, Two Goals
Part I covers the core concepts — graph storage, BFS/DFS, cycle detection, topological sorting, Union-Find, minimum spanning trees (Prim, Kruskal), and shortest-path algorithms (Dijkstra, Bellman-Ford, Floyd-Warshall) — enough on its own for everyday coding work. Part II goes further into contest-specific territory: flood fill, multisource BFS, strongly connected components, Euler tours, lowest common ancestor, articulation points, and network flow.
How You Practice
- Guided lessons paired with more than 80 coding problems
- Step-by-step build-up from basic graph representation to advanced algorithms
- A structure that lets you stop after Part I if contests aren't the goal
94 lessons in total, mixing theory with code so each algorithm is something you implement, not just read about.