Pattern2 visualizers
Graphs / Topo Sort Pattern Visualizers
The Graphs / Topo Sort pattern is a recurring algorithmic shape that appears across coding interviews and competitive problems. Use it when the problem geometry matches its trigger conditions — recognizing the pattern collapses what looks like a hard problem into a familiar template. These visualizers trace Graphs / Topo Sort step-by-step on classics such as Kahn's Algorithm (BFS Topo Sort), Topological Sort - DFS, so you can internalize the moves before you ever need them under pressure.
Graphs
Kahn's Algorithm (BFS Topo Sort)
Computes a Topological Sort of a DAG using BFS by systematically removing nodes with 0 incoming edges. Unreachable nodes indicate a cycle.
Open visualizer →
Graphs
Topological Sort - DFS
Orders a Directed Acyclic Graph (DAG) linearly such that for every directed edge U -> V, node U comes before V. DFS solves this natively using a post-order stack process.
Open visualizer →