Kahn’s algorithm keeps an in-degree counter per vertex. A vertex with in-degree 0 has no unfinished prerequisites and is ready.