Performs Dijsktra's algorithm lazily, yielding one node visit at a time.

Can have a custom propagation function to determine which edges to follow, effectively pruning the search tree.

Can be set to be undirected, in which case it will also use incoming edges to traverse the graph, disregarding edge direction.

Weights must be non-negative.

Implements

Constructors

Properties

directed: boolean

Whether the search is to be considered directed or undirected.

propagate: ((edge: BaseEdge.Class<BaseEdge.Data, BaseEdge.ScratchData>) => boolean)

A function that determines whether to propagate a given edge.

weight: ((edge: BaseEdge.Class<BaseEdge.Data, BaseEdge.ScratchData>) => number)

A function that returns the weight of an edge. Must not return negative values.

Methods

  • Sets the search to be undirected. An undirected search may travel through edges in both directions, so it can also use incoming edges.

    Returns this

    This search instance, for chaining.