graphtransliterator-ts


graphtransliterator-ts / parentsOf

Function: parentsOf()

parentsOf<T, N, E>(graph, childId): number[]

Defined in: Graphs.ts:189

Returns an ordered array of parent node identifiers feeding into a child target node. Achieves high performance by leveraging the pre-compiled O(1) predecessors lookup index.

Ordering: Sorted ascending by numeric NodeId values.

Type Parameters

T

T

N

N

E

E

Parameters

graph

DirectedGraph<T, N, E>

childId

number

Returns

number[]