Defined in: packages/graph/src/dijkstra.ts:28
Where a shortest-path search starts, where it may stop, and what an edge costs.
Properties
Section titled “Properties”sources
Section titled “sources”
readonlysources:Iterable<number>
Defined in: packages/graph/src/dijkstra.ts:30
Start vertices, all at distance 0.
target?
Section titled “target?”
readonlyoptionaltarget?:number
Defined in: packages/graph/src/dijkstra.ts:32
One requested destination. When targets is also set, the search waits for all requested destinations.
targets?
Section titled “targets?”
readonlyoptionaltargets?:Iterable<number,any,any>
Defined in: packages/graph/src/dijkstra.ts:34
Stop once all these vertices and target, if supplied, settle. Duplicates are ignored.
readonlyoptionalcost?: (from,to,weight) =>number
Defined in: packages/graph/src/dijkstra.ts:42
The cost of walking one edge, in place of its stored weight. Called with
the edge’s endpoints and stored weight (1 when unweighted), once for
every edge out of each expanded vertex. The last requested target
settles without expansion. The callback must return a non-negative
number and leave the graph unchanged. Infinity skips the edge.
Parameters
Section titled “Parameters”number
number
weight
Section titled “weight”number
Returns
Section titled “Returns”number
trace?
Section titled “trace?”
readonlyoptionaltrace?:DijkstraStep[]
Defined in: packages/graph/src/dijkstra.ts:48
Receives a DijkstraStep for each settle and relaxation, in order,
so a caller can replay the search. Omitted, the search allocates no step
objects. A relaxation’s weight is the cost the search used, after cost.