Skip to content

a topological cyclic sorting algorithm based on depth-first search (dfs)

License

Notifications You must be signed in to change notification settings

clayrisser/trailduck

Repository files navigation

trailduck

GitHub stars

a topological cyclic sorting algorithm based on depth-first search (dfs)

Please ★ this repo if you found it useful ★ ★ ★

Features

  • works with cycles in the graph
  • detects overlapping cycles
  • loosly based on depth-first search (dfs)

Installation

npm install --save trailduck

Dependencies

Usage

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);

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Liberapay

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!

Liberapay receiving Liberapay patrons

Releases

No releases published

Packages

No packages published