Topological Sorting
 


 

INPUT                                               OUTPUT 

Input Description: A directed, acyclic graph G=(V,E) (also known as a partial order or poset).



Problem: Find a linear ordering of the vertices of V such that for each edge (i,j) \in E, vertex i is to the left of vertex j

(c) Shilpa Sayura Foundation 2006-2017