@graphty/algorithms / index / PathWalkError
Class: PathWalkError ​
Defined in: errors.ts:137
Thrown when a shortest path cannot be walked back from its predecessor array: the walk met a missing or out-of-range predecessor before the source ("gap"), or took more than nodeCount - 1 steps without reaching it ("cycle").
A CPU search never produces such an array; an accelerator's result can (a kernel bug, a lost device, a buffer read too early). The error surfaces it instead of hanging or returning a wrong path, and nothing recomputes the path on the CPU.
Extends ​
Error
Constructors ​
Constructor ​
new PathWalkError(
source,target,reason):PathWalkError
Defined in: errors.ts:147
Builds the error and its message.
Parameters ​
source ​
number
The search's source node index
target ​
number
The node index the walk started from
reason ​
"cycle" | "gap"
"gap" or "cycle", as above
Returns ​
PathWalkError
Overrides ​
Error.constructor
Properties ​
code ​
readonlycode:AlgorithmErrorCode="E_BAD_PATH"
Defined in: errors.ts:139
name ​
readonlyname:"PathWalkError"="PathWalkError"
Defined in: errors.ts:138
Overrides ​
Error.name
reason ​
readonlyreason:"cycle"|"gap"
Defined in: errors.ts:150
"gap" or "cycle", as above
source ​
readonlysource:number
Defined in: errors.ts:148
The search's source node index
target ​
readonlytarget:number
Defined in: errors.ts:149
The node index the walk started from