a topological cyclic sorting algorithm based on depth-first search (dfs)
Please ★ this repo if you found it useful ★ ★ ★
- works with cycles in the graph
- detects overlapping cycles
- loosly based on depth-first search (dfs)
npm install --save trailduck
const trailDuck = new TrailDuck({
A: {
children: ['B', 'D', 'E']
},
B: { children: ['C'] },
C: { children: ['A'] },
D: { children: ['E'] },
E: { children: ['A'] }
});
console.log('cycles', trailDuck.cycles);
console.log('ordered', trailDuck.ordered);
console.log('tree', trailDuck.tree);
Submit an issue
Contribute a screenshot
Review the guidelines for contributing
Jam Risser © 2018
Review the changelog
- Jam Risser - Author
A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.
Add some fuel if you'd like to keep me going!