Skip to content

@graphty/algorithms / index / dijkstra

Function: dijkstra() ​

dijkstra(g, sourceNode, options?): SsspResult

Defined in: indexed/dijkstra.ts:133

Dijkstra over an adjacency view, with the predecessor recorded as the relaxing ARC so a parallel edge on the path is identified exactly.

Parameters ​

g ​

AdjacencyView

The adjacency to search

sourceNode ​

NodeRef

The node to start from: its index, or { id }

options? ​

SsspOptions = {}

Cutoff and per-arc weight override

Returns ​

SsspResult

The distances, the predecessor arcs, and the two path accessors