icon picker
Graphs

Step 1: Graph Basics + BFS/DFS Foundations

Build intuition around graph traversal and adjacency list representation.

Step 2: Topological Sorting (Kahn’s Algo + DFS)

Used in DAGs (Directed Acyclic Graphs) — key for scheduling and ordering problems.
Minimum Number of Vertices to Reach All Nodes
Sort Items by Groups Respecting Dependencies

Step 3: Detecting Cycles (Directed + Undirected)

Essential for checking validity in graphs (safe states, deadlocks, etc.)
Detect Cycle in a Directed Graph (Course Schedule II) —

Step 4: Shortest Path Algorithms (BFS, Dijkstra, Bellman-Ford, 0-1 BFS)

Critical for routing, cost-based traversal.
Shortest Path in Binary Matrix —
Dijkstra: Network Delay Time —
Dijkstra: Cheapest Flights Within K Stops —
Bellman Ford: Cheapest Flights Within K Stops —
0-1 BFS: Shortest Path with Alternating Colors —

Step 5: Union Find (Disjoint Set Union - DSU)

Powerful for connectivity queries, cycle detection, Kruskal’s MST.
Number of Connected Components in Undirected Graph —
Satisfiability of Equality Equations —

Step 6: Minimum Spanning Tree (Prim’s & Kruskal’s)

Find lowest cost to connect all nodes — vital for networking problems.
Minimum Cost to Connect All Points —
Connecting Cities With Minimum Cost —
Optimize Water Distribution in a Village —
Critical Connections in a Network —

Step 7: Backtracking + Graphs Hybrid

Graph traversal + permutations, cycles, etc.

Step 8: DP on Graphs (Memoized DFS)

Some problems are best solved via topological + memoization (DAGs mostly).
Longest Increasing Path in a Matrix —
All Paths From Source to Target —

Step 9: Advanced Graph Problems (Hard-Level)

Prepare for FAANG and top-tier interviews with these.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.