Who goes first in a build?
transcript
A build has many steps. Publish needs the tests. Tests need the compiled code. So who goes first? Let us count what each step waits for.
Count the arrows pointing at each step. That is its in degree. Only step zero waits for nothing. It joins the queue. Take it. It goes first in the order.
Remove its arrows. Steps one and two drop to zero. Both join the queue. Take step one. Step four reaches zero, and queues up. Take two. Then step three reaches zero. Take four and three. Step five reaches zero. Take five. All six steps are in order.
A step with in degree zero waits for nothing. So it can safely go next. Removing it leaves a smaller graph. The same rule applies again. Each step enters the queue once.
A step with in degree zero is safe. Take it, and lower the others. Repeat until the queue is empty. Full breakdown in the lecture.