# DijkstraStep

> **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](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/graph/src/dijkstra.ts#L16)

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.
