Graph Algorithms
A premium, interview-focused graph course. Every problem teaches the pattern first, then the algorithm, then a clean Java 17 implementation — with dry runs and interview guidance. You will progress from modelling a grid as a graph all the way to advanced techniques like union-find, Dijkstra, and articulation points.
25
Curated lessons
10
Learning modules
9h 38m
Est. study time
11
Target companies
What you'll learn
- Model grids, matrices, and relationships as graphs and traverse them with DFS and BFS.
- Choose the right shortest-path tool for the edge weights: BFS, Dijkstra, or Bellman-Ford.
- Apply union-find with path compression for near-constant-time grouping and cycle detection.
- Recognise topological-sort, bipartite, and advanced-graph patterns under interview pressure.
Your progress
0 / 25
problems completed
25 available now · keep going!
Mark lessons complete as you work through them. Progress is saved on this device and syncs to your account when you sign in.
Learning roadmap
Work top to bottom — each module builds on the last.
- 1
Graph Traversal
DFS / BFS over grids and adjacency listsThe foundation: model a grid or adjacency list as a graph and visit every node exactly once with DFS or BFS.
5/5 problems1h 27m - 2
Connected Components
Component counting with DFS or Union-FindCount and group nodes that are reachable from one another — the first place Union-Find competes with DFS/BFS.
3/3 problems1h 3m - 3
Cycle Detection
Cycle detection via Union-Find / DFS parent trackingDecide whether an undirected graph contains a cycle — the core check behind trees, forests, and safe merges.
2/2 problems35m - 4
Topological Sort
Kahn's BFS / DFS topological orderingOrder the nodes of a DAG so every edge points forward — the dependency-resolution pattern interviewers love.
4/4 problems1h 35m - 5
Union Find
Disjoint Set Union (path compression + union by rank)Disjoint Set Union with path compression and union by rank — near-constant-time grouping and equivalence.
3/3 problems1h 3m - 6
Shortest Path
BFS / Dijkstra / Bellman-Ford shortest pathsFrom unweighted BFS to Dijkstra and Bellman-Ford — pick the right shortest-path tool for the edge weights.
4/4 problems1h 59m - 7
Minimum Spanning Tree
Minimum Spanning Tree (Prim / Kruskal)Connect every node at minimum total cost with Prim's or Kruskal's algorithm.
1/1 problems30m - 8
Grid Graphs
Multi-source BFS on gridsMulti-source BFS on a grid — spreading fronts, distances, and simultaneous starts.
1/1 problems22m - 9
Bipartite Graph
2-colouring with BFS / DFSTwo-colour a graph to prove it has no odd cycle — conflict-free partitioning.
1/1 problems24m - 10
Advanced Graphs
Tarjan's bridges (DFS discovery + low-link)Tarjan's bridges and articulation points — the discovery-time / low-link technique for critical edges.
1/1 problems40m
Modules
10 themed modules from fundamentals to advanced.
Graph Traversal
The foundation: model a grid or adjacency list as a graph and visit every node exactly once with DFS or BFS.
Connected Components
Count and group nodes that are reachable from one another — the first place Union-Find competes with DFS/BFS.
Cycle Detection
Decide whether an undirected graph contains a cycle — the core check behind trees, forests, and safe merges.
Topological Sort
Order the nodes of a DAG so every edge points forward — the dependency-resolution pattern interviewers love.
Union Find
Disjoint Set Union with path compression and union by rank — near-constant-time grouping and equivalence.
Shortest Path
From unweighted BFS to Dijkstra and Bellman-Ford — pick the right shortest-path tool for the edge weights.
Minimum Spanning Tree
Connect every node at minimum total cost with Prim's or Kruskal's algorithm.
Grid Graphs
Multi-source BFS on a grid — spreading fronts, distances, and simultaneous starts.
Bipartite Graph
Two-colour a graph to prove it has no odd cycle — conflict-free partitioning.
Advanced Graphs
Tarjan's bridges and articulation points — the discovery-time / low-link technique for critical edges.
Full curriculum
25 problems and 0 concept lessons in learning order.
- 1Number of IslandsGraph TraversalMedium
- 2Flood FillGraph TraversalEasy
- 3Max Area of IslandGraph TraversalMedium
- 4Clone GraphGraph TraversalMedium
- 5Find if Path Exists in GraphGraph TraversalEasy
- 6Number of Connected Components in an Undirected GraphConnected ComponentsMedium
- 7Number of ProvincesConnected ComponentsMedium
- 8Count Unreachable Pairs of Nodes in an Undirected GraphConnected ComponentsMedium
- 9Graph Valid TreeCycle DetectionMedium
- 10Redundant ConnectionCycle DetectionMedium
- 11Course ScheduleTopological SortMedium
- 12Course Schedule IITopological SortMedium
- 13Alien DictionaryTopological SortHard
- 14Parallel CoursesTopological SortMedium
- 15Accounts MergeUnion FindMedium
- 16Most Stones Removed with Same Row or ColumnUnion FindMedium
- 17Satisfiability of Equality EquationsUnion FindMedium
- 18Shortest Path in Binary MatrixShortest PathMedium
- 19Network Delay TimeShortest PathMedium
- 20Cheapest Flights Within K StopsShortest PathMedium
- 21Path With Minimum EffortShortest PathMedium
- 22Min Cost to Connect All PointsMinimum Spanning TreeMedium
- 23Rotting OrangesGrid GraphsMedium
- 24Is Graph Bipartite?Bipartite GraphMedium
- 25Critical Connections in a NetworkAdvanced GraphsHard