Skip to content
/ topo-sort Public

Simple and fast implementation of topological sorting. No dependencies. A circular graph will throw an error with circular nodes info.

License

Notifications You must be signed in to change notification settings

liy/topo-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Must not add any null, undefined or empty string node.

var TopoSort = require('topo-sort');

var tsort = new TopoSort();
tsort.add('a', ['b', 'c']);
tsort.add('d', ['a', 'b', 'c']);
// Output d,a,c,b
var l = tsort.sort();

About

Simple and fast implementation of topological sorting. No dependencies. A circular graph will throw an error with circular nodes info.

Resources

License

Stars

Watchers

Forks

Packages

No packages published