topological sorting
an ordering of the vertices of the directed graph for which each edge is directed from earlier to later in the ordering
an ordering of the vertices of the directed graph for which each edge is directed from earlier to later in the ordering