BFS, DFS, topological sort, and cycle detection — the fundamental patterns for exploring connected structures.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Graph traversal algorithms visit every reachable node in a graph. BFS explores level-by-level (shortest path in unweighted graphs). DFS goes deep before backtracking (topological sort, cycle detection, connected components). These form the basis for pathfinding, dependency resolution, and network analysis.