Calculate the order in which nodes in the dag should be traversed during the backward pass(leaves to roots)
Useful links