Sign in

TOPOLOGICAL SORTING

In the Directed Acyclic Graph, the Topological sort is a way of the linear ordering of vertices in such a way that for every directed edge (x, y), vertex x will come before y in the ordering.

Topological sorting is possible if and only if the graph has no directed cycles i.e., it is a Directed Acyclic Graph (DAG). There may exist multiple topological orderings for a given DAG. The ordering of the nodes is called topological ordering.

It has been seen that graph having a directed cycle is the only restriction for having a topological sort.

Suppose…

Gauri Gurav

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store