Consequences of DFS (cont.)
Definition: a topological ordering (sort) of the vertices of a directed graph is an order v1,..., vn such that there is no edge (vi,vj) of G with j < i.
Application: tasks to be performed sequentially, with precedence constraints: if the pair (Ti, Tj) is a constraint then task i must be performed before task j.
Goal: find ordering (schedule) s.t. all constraints obeyed.