Learn R Programming

hsm (version 0.2.0)

path.find: Find all path graphs originated from a given root.

Description

Recursively find all possible path graphs originated from a given root in DAG.

Usage

path.find(index, map)

Arguments

index

Index of a root node (a node whose index never appears in map[, 2]).

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.

Value

Returns a list of path graphs originated from root index, for which the ith element of the returned list is a vector of indices of nodes in the ith path graph.