import { type AStarOptions } from "https://deno.land/x/lazy_pathfinding@v1.1.1/directed/a_star.ts";
Properties
The starting node.
Returns a list of successors for a given node, along with the cost for moving from the node to the successor.
Returns an approximation of the cost from a given node to the goal. The approximation must not be greater than the real cost, or a wrong shortest path may be returned.
Checks whether the goal has been reached. It is not a node as some problems require a dynamic solution instead of a fixed node.
A function that returns a unique key for a node. Equal nodes must return keys
that are equal.
If the nodes are primitive values, are represented by persistent unique objects,
or are never encountered more than once, then the identity function (x => x
)
can be used here.
Otherwise, a custom function that converts the node to a string is
recommended. (JSON.stringify
can be used for this.)
In the future, if the Javascript Record and Tuple proposal is implemented, then this option may be changed to be optional with a default value set to the identity function, in order to make Record and Tuple nodes work as simply as possible.
This option lets custom functions for managing the Cost values be specified. This is not necessary to use if the Cost type is a number. This option is useful if you want a different type of Cost value, such as a tuple of numbers representing separate resource costs where 1 of an earlier index is worth more than any amount in further indexes.
Stop considering paths that have a cost greater than this value.