Skip to content

DijkstraStep = { kind: "settle"; vertex: number; distance: number; } | { kind: "relax"; from: number; to: number; weight: number; distance: number; improved: boolean; }

Defined in: packages/graph/src/dijkstra.ts:16

One event of a shortest-path search, in the order it happened.

  • settle: a vertex left the frontier with its final distance.
  • relax: the edge from → to, costing weight, offers to the total distance through from; improved is true when that beat the best distance known for to. An edge into an already settled vertex is priced and checked but not reported, since it cannot improve.