File Exchange

image thumbnail

Topological sort

version (2.08 KB) by Jan Motl
Performs topological sort of a directed graph

1 Download

Updated 22 Feb 2016

View License

Topological sort orders nodes in a directed graph that way that for every directed edge uv from node u to node v, u comes before v in the ordering.
An interesting property of this topological sort is that this implementation permits existence of cycles in the graph.

The function is an implementation of an algorithm described in: "A Simple Algorithm for Automatic Layout of BPMN Processes" (

1) The graph is directed.
2) The graph has at least one node without any incoming link.
3) The edges are not weighted.

Cite As

Jan Motl (2020). Topological sort (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)


Flatten directory structure

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags