Week 13 — Advanced Graphs

Month 3 — Graphs & DP Deep · Week 1 of 4

5 problems, p66–p70. Topics: Minimum Spanning Tree (Kruskal + Prim), bipartite graphs (2-coloring), bridges & articulation points (Tarjan), constrained topological sort over inferred edges (Alien Dictionary), and Eulerian paths (Hierholzer). Each lifts you out of “BFS/DFS” comfort zone into algorithms with subtle invariants and named papers.

Why this week

Weeks 11–12 covered foundational graphs (BFS, DFS, Dijkstra, Bellman-Ford, Union-Find). This week is the named-algorithm tier: MST, Tarjan, Hierholzer. Each has a one-paragraph correctness proof you must be able to state. Senior+ interviews ask for these by reputation — even when not strictly required.

Schedule (Mon–Fri)

DayProblemFocusDifficulty
Monp66 — Min Cost to Connect All PointsMST: Kruskal (sort + DSU) vs Prim (heap)Medium
Tuep67 — Is Graph Bipartite?2-coloring via BFS / DFS, odd-cycle witnessMedium
Wedp68 — Critical Connections in a NetworkTarjan’s bridge algorithm: disc + lowHard
Thup69 — Alien DictionaryChar graph from adjacent word diffs + topo sort + cycleHard
Frip70 — Reconstruct ItineraryHierholzer’s algorithm (Eulerian path)Hard

Readiness gate (move to Week 14 when)

  • Implement Kruskal and Prim cold; explain when each is preferred.
  • State Tarjan’s bridge invariant: low[v] = min(disc[v], low[child], disc[neighbor through back-edge]).
  • Construct edge cases for Alien Dictionary: prefix-violation (["abc","ab"] → “”), cycle.
  • Explain Hierholzer: why DFS with post-order append yields the Eulerian path.
  • Solve all 5 cold in their target windows (25–40 min each).