0.2.2 • Published 6 years ago

trailduck v0.2.2

Weekly downloads
906
License
MIT
Repository
github
Last release
6 years ago

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