trailduck

0.2.2 • Public • Published

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

Package Sidebar

Install

npm i trailduck

Weekly Downloads

4

Version

0.2.2

License

MIT

Unpacked Size

17.2 kB

Total Files

8

Last publish

Collaborators

  • codejamninja