Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

graph-algorithm/topological-sorting

Repository files navigation

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 GitHub issues Downloads

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

About

🍢 Topological sorting algorithms for JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.