Kahn’s algorithm keeps an in-degree counter per vertex. A vertex with in-degree 0 has no unfinished prerequisites and is ready.
In-degree
The number of edges pointing into a vertex; in dependency graphs, how many prerequisites it still waits for.
Kahn’s algorithm keeps an in-degree counter per vertex. A vertex with in-degree 0 has no unfinished prerequisites and is ready.