Source: wikibot/topological-sorting
= Topological sorting
{wiki=Topological_sorting}
Topological sorting is a linear ordering of the vertices of a directed acyclic graph (DAG) such that for every directed edge \\( u \\rightarrow v \\), vertex \\( u \\) comes before vertex \\( v \\) in the ordering. This concept is particularly useful in scenarios where there is some dependency or precedence represented by the directed edges.