DijkstraConfig<E>Configuration for finding a shortest path with Dijkstra's algorithm.
When to use
Use when configuring dijkstra to find a shortest path between two existing
node indices with non-negative edge costs.
Details
Specifies the source and target node indices, plus a cost function that maps each edge's data to a non-negative numeric weight.
Gotchas
dijkstra throws a GraphError when either endpoint does not exist or when
the cost function returns a negative weight.
export interface interface DijkstraConfig<E>Configuration for finding a shortest path with Dijkstra's algorithm.
When to use
Use when configuring dijkstra to find a shortest path between two existing
node indices with non-negative edge costs.
Details
Specifies the source and target node indices, plus a cost function that maps
each edge's data to a non-negative numeric weight.
Gotchas
dijkstra throws a GraphError when either endpoint does not exist or when
the cost function returns a negative weight.
DijkstraConfig<function (type parameter) E in DijkstraConfig<E>E> {
DijkstraConfig<E>.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
DijkstraConfig<E>.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
DijkstraConfig<E>.cost: (edgeData: E) => numbercost: (edgeData: EedgeData: function (type parameter) E in DijkstraConfig<E>E) => number
}