path(
result,target):Int32Array<ArrayBufferLike> |undefined
Defined in: packages/graph/src/path.ts:22
The vertices of the path a search found from a source to target, source
first, or undefined when the search never reached target. O(path length).
Parameters
Section titled “Parameters”result
Section titled “result”target
Section titled “target”number
Returns
Section titled “Returns”Int32Array<ArrayBufferLike> | undefined
Throws
Section titled “Throws”With code INVALID_VERTEX when target is outside the result.
Example
Section titled “Example”path(breadthFirstSearch(graph, { sources: [0] }), 5) // Int32Array [0, 2, 5]