ancestor.find: Find ancestor nodes for a node in directed acyclic graph.

Description Usage Arguments Value

Description

Recursively finds all ancestor nodes in DAG for node with the given index.

Usage

1
ancestor.find(index, map, n.nodes)

Arguments

index

Index of the node currently at.

map

Matrix of n.edges-by-2 dimension, where n.edges is the number of directed edges in DAG. The first column has indices of nodes that edges directing from, whereas the second column gives the indices of nodes the corresponding edges directing towards.

n.nodes

Number of nodes in DAG.

Value

Returns a length-n.nodes vector of binary values for which 1 indicates the corresponding node is an ancestor node and 0 indicates it is not.


hsm documentation built on May 2, 2019, 7:24 a.m.