A build that never starts
transcript
Step two needs step one. Step three needs step two. But step one needs step three. Can this build ever start? Watch what happens to the queue.
Step zero has in degree zero. It queues up. Take it. Step one drops to one, and not to zero. The queue is empty. Only one step is placed. Steps one, two and three wait for each other.
Now remove the rule that closes the loop. Zero goes first. Then one becomes ready. Then two, then three. All four are placed.
Kahn's loop always ends. But a short order is not an answer. Compare the length with n. Every step must be placed. A cycle leaves some behind. Then no valid order exists. Fewer means a cycle.
Stuck steps wait for each other. No step can go first. Report the cycle, not a half build. Ask someone to break one rule. Full breakdown in the lecture.