Hyperlinkv0.8.0-beta.28

Graph

Graph.DijkstraConfiginterfaceeffect/Graph.ts:3146
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.

Source effect/Graph.ts:31465 lines
export interface DijkstraConfig<E> {
  source: NodeIndex
  target: NodeIndex
  cost: (edgeData: E) => number
}
Referenced by 1 symbols