main.m578 chars26 lines
This MATLAB function topologicalSort
takes an adjacency matrix graph
of a directed acyclic graph as input and computes the topological order of the nodes. It will display the nodes in a topological order, or throw an error if the input graph has a cycle.
gistlibby LogSnag