Command Palette

Search for a command to run...

Module 37

Advanced Graph Algorithms

Strongly connected components, bridges and articulation points, bipartite checks, Euler paths, maximum flow and A* search.

Advanced 3 lessons 7 problems ~45 min of lessons

The core graph modules answered reachability, ordering and shortest paths. This module covers the structural questions that come up in harder interviews and real systems: which nodes form mutually reachable groups, which single link or server would split a network, whether a graph can be two-coloured, how to use every edge exactly once, how much can flow from a source to a sink, and how a good heuristic speeds up shortest-path search.

Most of these build on one idea: DFS discovery times plus the "lowest reachable discovery time" (low-link) of each subtree.

Best after: Depth-First Search, Shortest Paths

Where this shows up in real systems

Part 1

Learn the ideas

Part 2

Solve the problems

Work through them in order. Each one shows the pattern it teaches.

  1. Tarjan's bridge-finding with disc and low arrays.

  2. The node version of low-link: a child that can't climb above its parent.

  3. Kosaraju's two passes.

  4. Two-colouring with BFS, checking every component.

  5. Hierholzer's algorithm: post-order over consumed edges gives an Euler path.

  6. Edmonds-Karp: BFS augmenting paths in the residual graph.

  7. Search over board states: BFS, or A* with a Manhattan-distance heuristic.