A way to sort the vertices of a directed acyclic graph based on their dependencies.
Note: A topological sort is only possible for a directed acyclic graph (DAG) as there should not be any cycles in it. It provides a linear ordering of the vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering.