astar-algorithm
An almost universal implementation of A* search algorithm in JavaScript.
Requirements
- ECMAScript 2015+
Usage
// 1)const astar = // 2)let callbacks = // It should return id / key / hash for a node { // return {String} or what you want } // It should check: is a node is the goal? { // return {Boolean} } // It should return an array of successors / neighbors / children { // return {Array} of nodes } // g(x). It should return the cost of path between two nodes { // return {Number} } // h(x). It should return the cost of path from a node to the goal { // return {Number} } // 3)let path =
See more examples there.