Mental Model
We find an order to do tasks so that all prerequisites come before the task itself. We start with tasks that have no prerequisites and remove them step by step.
Analogy: Imagine you have to bake a cake but must first prepare ingredients. You start with tasks that need no preparation, then remove them from the list, unlocking the next tasks that depended on them.
Graph nodes with arrows showing dependencies: 5 -> 0 ← 4 ↓ ↑ 2 -> 3 -> 1 Nodes with no incoming arrows are ready to process first.
