AstarConfig<E, N>Configuration for finding a shortest path with the A* algorithm.
When to use
Use when configuring astar for point-to-point shortest-path searches where
node data can provide a heuristic estimate toward the target.
Details
Specifies the source and target node indices, an edge-cost function, and a heuristic that estimates the remaining cost from a node to the target.
export interface interface AstarConfig<E, N>Configuration for finding a shortest path with the A* algorithm.
When to use
Use when configuring astar for point-to-point shortest-path searches where
node data can provide a heuristic estimate toward the target.
Details
Specifies the source and target node indices, an edge-cost function, and a
heuristic that estimates the remaining cost from a node to the target.
AstarConfig<function (type parameter) E in AstarConfig<E, N>E, function (type parameter) N in AstarConfig<E, N>N> {
AstarConfig<E, N>.source: NodeIndexsource: type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex
AstarConfig<E, N>.target: NodeIndextarget: type NodeIndex = numberNode index for node identification using plain numbers.
When to use
Use when storing or passing the stable identifier of a graph node between
Graph operations.
Details
addNode allocates node identifiers from the graph's next node index.
Gotchas
A NodeIndex is an identifier, not an array offset. Removed node identifiers
are not reused.
NodeIndex
AstarConfig<E, N>.cost: (edgeData: E) => numbercost: (edgeData: EedgeData: function (type parameter) E in AstarConfig<E, N>E) => number
AstarConfig<E, N>.heuristic: (sourceNodeData: N, targetNodeData: N) => numberheuristic: (sourceNodeData: NsourceNodeData: function (type parameter) N in AstarConfig<E, N>N, targetNodeData: NtargetNodeData: function (type parameter) N in AstarConfig<E, N>N) => number
}