Skip to content

@graphty/algorithms / index / walkPredEdges

Function: walkPredEdges() ​

walkPredEdges(g, predArc, source, targetNode): U32

Defined in: indexed/dijkstra.ts:110

Walk the predecessor arcs back from target and return the logical edges on the path.

Parameters ​

g ​

AdjacencyView

The adjacency the search ran on

predArc ​

U32

The search's predecessor-arc array

source ​

number

The search's source node index

targetNode ​

NodeRef

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

Returns ​

U32

Logical edge indices from source to target, or an empty array when unreached

Throws ​

PathWalkError when predArc has a gap or a cycle between target and source