Skip to content

@graphty/algorithms / index / BellmanFordResult

Interface: BellmanFordResult ​

Defined in: indexed/bellman-ford.ts:13

Result of the index-based Bellman-Ford: the SSSP result plus the negative-cycle flag.

Extends ​

Properties ​

dist ​

readonly dist: NumericVector

Defined in: indexed/dijkstra.ts:23

Distance per node; +Infinity for unreached nodes.

Inherited from ​

SsspResult.dist


hasNegativeCycle ​

readonly hasNegativeCycle: boolean

Defined in: indexed/bellman-ford.ts:19

True when a negative cycle is reachable from the source. dist and predArc then hold the state after nodeCount - 1 rounds, which are not shortest paths, and a path accessor may throw PathWalkError on a predecessor chain that loops.


predArc ​

readonly predArc: U32

Defined in: indexed/dijkstra.ts:25

The ARC that relaxed each node; INVALID_INDEX for the source and for unreached nodes.

Inherited from ​

SsspResult.predArc

Methods ​

pathEdges() ​

pathEdges(target): U32

Defined in: indexed/dijkstra.ts:36

LOGICAL EDGE indices along that path, one fewer than pathTo; this is what graphty-element's isInPath writes through. Empty when target is unreached.

Parameters ​

target ​

NodeRef

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

Returns ​

U32

Inherited from ​

SsspResult.pathEdges


pathTo() ​

pathTo(target): U32

Defined in: indexed/dijkstra.ts:30

Node indices from the source to target inclusive; empty when target is unreached.

Parameters ​

target ​

NodeRef

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

Returns ​

U32

Inherited from ​

SsspResult.pathTo