gert-topo-sort
Topologically sort Gert graphs
Usage
var Graph = Graph;var TopoSort = ; var graph = directed: true vertices: 'Nap': 'Make Toast': 'Eat breakfast' 'Pour juice': 'Eat breakfast' 'Eat breakfast': 'Nap' ; // ['Pour juice', 'Make Toast', 'Eat breakfast', 'Nap']var morning = ;
API
TopoSort(graph)
Returns an array of topologically sorted vertex ids from the directed, acyclic graph
. If graph
is undirected or cyclic, TopoSort()
will throw an error.