Book Exercise Lanes
This module's exercise system is book-driven. Use these local chunks for targeted volume after you have already learned the concept from the guide.
How To Use This Page
- Finish the relevant concept page first.
- Solve at least one problem of your own from memory.
- Only then open the matching exercise lane.
- Implement every non-trivial algorithm from scratch once before relying on a library.
- Keep a mistake log with tags such as
bad model,wrong representation,ran Dijkstra on negative edges,missed residual edge,confused SCC with CC,forgot path compression, ormin cut double counted.
Lane 1: Representations and Traversals
Use this lane when your main gap is modeling, representation, BFS, DFS, SCC, or topological sort.
- ADM 1.7: Exercises
- ADM 5.11: Graph Traversal Exercises
- CLRS 20.1: Representations of Graphs
- CLRS 20.2: Breadth-First Search
- CLRS 20.3: Depth-First Search
- CLRS 20.4: Topological Sort
- CLRS 20.5: Strongly Connected Components
- Sedgewick: Elementary Graph Algorithms (Part 1)
- Competitive Programming: Graph
Target outcomes:
- 6 problems translating a verbal description into an explicit
(V, E, directed?, weighted?)model - 4 BFS or DFS implementations on new data shapes (grids, implicit graphs, etc.)
- 2 SCC computations with the condensation drawn explicitly
- 2 topological-sort applications (build order, course scheduling, cycle detection)
Lane 2: Shortest Paths
Use this lane when you can draw the graph but keep picking the wrong shortest-path algorithm or getting running times wrong.
- ADM 6.7: Weighted Graph Exercises
- ADM: Dialing for Documents war story
- CLRS 22.1: Bellman-Ford Algorithm
- CLRS 22.3: Dijkstra's Algorithm
- CLRS 22.5: Proofs of Shortest-Paths Properties
- CLRS 23.2: Floyd-Warshall Algorithm
- Competitive Programming: SSSP on weighted graphs
- Competitive Programming: SSSP with negative cycles (Part 1)
- Competitive Programming: All-Pairs Shortest Paths
Target outcomes:
- 6 Dijkstra runs by hand with PQ state written out at each step
- 3 Bellman-Ford runs, one of which detects a negative cycle
- 2 Floyd-Warshall runs on small graphs with hand-written
distmatrices - 2 algorithm-choice exercises where you justify the pick with a one-paragraph argument
Lane 3: Minimum Spanning Trees
Use this lane when you can run Kruskal and Prim but cannot prove why they are correct on a specific example.
- ADM 6.7: Weighted Graph Exercises
- ADM 6.2: Nothing But Nets war story
- ADM: Chapter Notes
- CLRS 21.1: Growing an MST
- CLRS 21.2: Kruskal and Prim
- Competitive Programming: Minimum Spanning Tree
Target outcomes:
- 4 Kruskal runs by hand, with cut-property argument for each added edge
- 3 Prim runs by hand, starting from different roots to confirm the MST is invariant
- 1 second-best MST computation
- 1 single-linkage clustering run on a small 2D dataset using Kruskal with early stopping
Lane 4: Network Flow and Matching
Use this lane when the problem is modeling - turning a non-flow-looking problem into a flow network.
- ADM 6.7: Weighted Graph Exercises
- ADM 6.5: Network Flows and Bipartite Matching
- CLRS 24.1: Flow Networks
- CLRS 24.2: Ford-Fulkerson Method
- CLRS 24.3: Maximum Bipartite Matching
- CLRS 25.1: Maximum Bipartite Matching Revisited
- Sedgewick: Network Flow
- Sedgewick: Matching
- Competitive Programming: Network Flow
- Competitive Programming: Graph matching
Target outcomes:
- 3 Ford-Fulkerson or Edmonds-Karp runs by hand, including residual graph state
- 3 modeling problems turned into explicit flow networks (matching, project selection, disjoint paths)
- 2 min-cut recoveries after a max-flow computation
- 1 bipartite-matching implementation built on top of your Edmonds-Karp solver
Self-Curated Problem Set
Build a custom set with these minimums:
- 5 modeling problems (real scenario -> explicit graph)
- 5 traversal-family problems (BFS, DFS, SCC, topological sort)
- 5 shortest-path problems across at least three algorithm choices
- 3 MST problems including at least one variant (bottleneck, second-best, clustering)
- 3 flow/matching problems at least one of which is not obviously flow-shaped
Completion Checklist
- Completed at least one lane in full
- Implemented BFS, DFS, Kosaraju, Dijkstra (heap), Bellman-Ford, Floyd-Warshall, Kruskal (union-find), Prim (heap), and Ford-Fulkerson at least once each, tested, and committed to your algorithms repo
- Logged at least 10 real mistakes and their corrections
- Wrote at least 6 sentence-form modeling justifications before coding
- Solved at least 3 problems by recognizing a non-obvious reduction (e.g., "this is really min-cut")
- Benchmarked at least 2 implementations against a reference and reconciled any discrepancy