Skip to main content
Home

Built and signed on GitHub Actions

Pathfinding algorithms

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
82%
Published
a month ago (1.1.1)

@macil/pathfinding

This library implements several pathfinding and graph algorithms. This library works with Typescript and Javascript in both Deno and Node.

Where possible, this library does not need an entire graph to be provided to it ahead of time. Many functions allow nodes and edges to be provided by a successor function executed for each node encountered, meaning that graphs are lazily initialized which allows for procedural and infinite graphs to be used.

Algorithms

Directed graphs

  • A*: find the shortest path in a weighted graph using an heuristic to guide the process.
  • Dijkstra: find the shortest path in a weighted graph.

Undirected graphs

This project was ported from the Rust pathfinding library.

License

This code is released under a dual Apache 2.0 / MIT free software license.

Contributing

You are welcome to contribute by opening issues or submitting pull requests.

Implementations of additional similar graph algorithms, especially those in the Rust pathfinding library, are welcome.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.