百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

javascript-astar

> 编程语言
开源

JavaScript 中的 A* 搜索/路径寻找算法

1.4K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

JavaScript 中的 A* 搜索/路径寻找算法

javascript-astar

An implementation of the A* Search Algorithm in JavaScript

See a demo at http://www.briangrinstead.com/files/astar/

Sample Usage

If you want just the A* search code (not the demo visualization), use code like this http://gist.github.com/581352

…

A few notes about weight values:

  1. A weight of 0 denotes a wall.
  2. A weight cannot be negative.
  3. A weight cannot be between 0 and 1 (exclusive).
  4. A weight can contain decimal values (greater than 1).

Original (slower) implementation

The original version of the algorithm used a list, and was a bit clearer but much slower. It was based off the original blog post. The code is available at: https://github.com/bgrins/javascript-astar/tree/0.0.1/original-implementation.

The newest version of the algorithm using a Binary Heap. It is quite faster than the original. http://www.briangrinstead.com/blog/astar-search-algorithm-in-javascript-updated Binary Heap taken from http://eloquentjavascript.net/appendix2.html (license: http://creativecommons.org/licenses/by/3.0/)

Running the test suite

If you don't have grunt installed, follow the grunt getting started guide first.

Pull down the project, then run:

	npm install
	grunt

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •JavaScript

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言