PathResult<E>Result of a shortest path computation.
When to use
Use to read the successful source-to-target shortest path returned by path-finding algorithms, including the ordered node indices, total distance, and traversed edge data.
Details
Contains the node-index path, the total numeric distance, and the edge data encountered along the path.
Gotchas
costs contains original edge data, not the numeric output of the cost
function unless the edge data is numeric.
export interface interface PathResult<E>Result of a shortest path computation.
When to use
Use to read the successful source-to-target shortest path returned by
path-finding algorithms, including the ordered node indices, total distance,
and traversed edge data.
Details
Contains the node-index path, the total numeric distance, and the edge data
encountered along the path.
Gotchas
costs contains original edge data, not the numeric output of the cost
function unless the edge data is numeric.
PathResult<function (type parameter) E in PathResult<E>E> {
readonly PathResult<E>.path: Array<NodeIndex>path: interface Array<T>Array<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>
readonly PathResult<E>.distance: numberdistance: number
readonly PathResult<E>.costs: E[]costs: interface Array<T>Array<function (type parameter) E in PathResult<E>E>
}