@graph-algorithm/topological-sorting

1.0.0 • Public • Published

🍢 @graph-algorithm/topological-sorting

Topological sorting algorithms for JavaScript. See docs.

⚠️ The code requires regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

// Sort anything that can be iterated over with `for (const [u, v] of ...)`
import {sorted} from '@graph-algorithm/topological-sorting';
sorted(["ab", "bc"]); // abc

// Add a comparison function to break ties.
import {increasing} from '@total-order/primitive';
sorted(["ab", "cd"], increasing); // abcd

import {decreasing} from '@total-order/primitive';
sorted(["ab", "cd"], decreasing); // cdab

License Version Tests Dependencies Dev dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

Package Sidebar

Install

npm i @graph-algorithm/topological-sorting

Weekly Downloads

2

Version

1.0.0

License

AGPL-3.0

Unpacked Size

470 kB

Total Files

14

Last publish

Collaborators

  • raskat
  • aureooms