The ready set
transcript
Some tasks in a build must come before others. Which task can go first? Keep track of the ready ones. Here is how.
Count the rules into each task. A count of zero means ready. Ready tasks join the ready set.
Nodes one, two and four are ready. Take node one, then node two. Take node four. It frees two more. Then zero, three and five follow.
Which node leaves first is the order. How many are in the set is the choices. Nodes left over wait on each other.
Several nodes can be ready together. The problem names which goes first. Often it is the smallest id. Sometimes critical steps go first.
A queue takes nodes in the order they joined. A heap takes the smallest id first.
Count what each node waits for. Keep a ready set. Read the order from it, one node at a time. Full breakdown in the lecture.