Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clayrisser/trailduck
a topological cyclic sorting algorithm based on depth-first search (dfs)
https://github.com/clayrisser/trailduck
algorithm depth-first-search dfs directec first graph search sort sorting topological topological-sort
Last synced: 11 days ago
JSON representation
a topological cyclic sorting algorithm based on depth-first search (dfs)
- Host: GitHub
- URL: https://github.com/clayrisser/trailduck
- Owner: clayrisser
- License: mit
- Created: 2018-10-01T00:39:41.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-07-12T10:25:30.000Z (over 1 year ago)
- Last Synced: 2024-04-26T06:22:08.164Z (7 months ago)
- Topics: algorithm, depth-first-search, dfs, directec, first, graph, search, sort, sorting, topological, topological-sort
- Language: JavaScript
- Size: 1.24 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# trailduck
[![GitHub stars](https://img.shields.io/github/stars/codejamninja/trailduck.svg?style=social&label=Stars)](https://github.com/codejamninja/trailduck)
> a topological cyclic sorting algorithm based on depth-first search (dfs)
Please ★ this repo if you found it useful ★ ★ ★
![](assets/trailduck.png)
## Features
* works with cycles in the graph
* detects overlapping cycles
* loosly based on depth-first search (dfs)## Installation
```sh
npm install --save trailduck
```## Dependencies
* [NodeJS](https://nodejs.org)
## Usage
```js
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](https://github.com/codejamninja/trailduck/issues/new)
## Screenshots
[Contribute](https://github.com/codejamninja/trailduck/blob/master/CONTRIBUTING.md) a screenshot
## Contributing
Review the [guidelines for contributing](https://github.com/codejamninja/trailduck/blob/master/CONTRIBUTING.md)
## License
[MIT License](https://github.com/codejamninja/trailduck/blob/master/LICENSE)
[Jam Risser](https://codejam.ninja) © 2018
## Changelog
Review the [changelog](https://github.com/codejamninja/trailduck/blob/master/CHANGELOG.md)
## Credits
* [Jam Risser](https://codejam.ninja) - Author
## Support on Liberapay
A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.
[Add some fuel](https://liberapay.com/codejamninja/donate) if you'd like to keep me going!
[![Liberapay receiving](https://img.shields.io/liberapay/receives/codejamninja.svg?style=flat-square)](https://liberapay.com/codejamninja/donate)
[![Liberapay patrons](https://img.shields.io/liberapay/patrons/codejamninja.svg?style=flat-square)](https://liberapay.com/codejamninja/donate)