Skip to content

@graphty/algorithms / index / DfsResult

Interface: DfsResult ​

Defined in: indexed/dfs.ts:8

Result of the index-based DFS.

Properties ​

depth ​

readonly depth: U32

Defined in: indexed/dfs.ts:14

DFS-tree depth of every node, INVALID_INDEX for unvisited nodes.


order ​

readonly order: U32

Defined in: indexed/dfs.ts:10

The visited nodes in pre-order or post-order (see DfsOptions.order); length visitedCount.


parent ​

readonly parent: U32

Defined in: indexed/dfs.ts:12

DFS-tree parent of every node, INVALID_INDEX for the start node and for unvisited nodes.


predArc ​

readonly predArc: U32

Defined in: indexed/dfs.ts:21

The ARC each node was discovered through (colIdx[predArc[v]] === v), INVALID_INDEX for the start node and for unvisited nodes. arcToEdge[predArc[v]] is the tree edge, the exact one among parallel edges.


visitedCount ​

readonly visitedCount: number

Defined in: indexed/dfs.ts:16

How many nodes were visited.

Methods ​

pathEdges() ​

pathEdges(target): U32

Defined in: indexed/dfs.ts:32

LOGICAL EDGE indices of the tree edges along that path, one fewer than pathTo; empty when target was not visited.

Parameters ​

target ​

NodeRef

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

Returns ​

U32


pathTo() ​

pathTo(target): U32

Defined in: indexed/dfs.ts:26

Node indices along the DFS tree from the start to target inclusive; empty when target was not visited.

Parameters ​

target ​

NodeRef

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

Returns ​

U32