build.descendants {HEMDAG} | R Documentation |
Build descendants
Description
Build descendants for each node of a graph.
Usage
build.descendants(g)
build.descendants.per.level(g, levels)
build.descendants.bottom.up(g, levels)
Arguments
g |
a graph of class |
levels |
a list of character vectors. Each component represents a graph level and the elements of any component correspond to nodes. The level 0 coincides with the root node. |
Value
build.descendants
returns a named list of vectors. Each component corresponds to a node x
of the graph, and its vector
is the set of its descendants including also x
.
build.descendants.per.level
returns a named list of vectors.
Each component corresponds to a node x
of the graph and its vector is the set of its descendants including also x
.
The nodes are ordered from root (included) to leaves.
build.descendants.bottom.up
returns a named list of vectors. Each component corresponds to a node x
of
the graph and its vector is the set of its descendants including also x
. The nodes are ordered from leaves to root (included).
Examples
data(graph);
root <- root.node(g);
desc <- build.descendants(g);
lev <- graph.levels(g, root=root);
desc.tod <- build.descendants.per.level(g,lev);
desc.bup <- build.descendants.bottom.up(g,lev);