Topological Sorting

There's a total of 1 articles.


Topological sorting of a graph

Topological sorting of a graph

Topological sorting is a linear ordering of the vertices of a directed acyclic graph (DAG) such that for every directed edge (u, v), vertex u comes before vertex v in the ordering. In other words, it is a way to order the vertices of a DAG such that there are no directed cycles.


In this article I implement the topological sorting algorithm as well as an example of how to use it to find the shortest path in a directed acyclic graph.