Learn R Programming

HEMDAG (version 2.1.3)

children: Build children

Description

Compute the children for each node of a graph

Usage

build.children(g)

get.children.top.down(g, levels)

get.children.bottom.up(g, levels)

Arguments

g

a graph of class graphNEL. It represents the hierarchy of the classes

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.children returns a named list of vectors. Each component corresponds to a node \(x\) of the graph and its vector is the set of its children

get.children.top.down returns a named list of character vectors. Each component corresponds to a node \(x\) of the graph (i.e. parent node) and its vector is the set of its children. The nodes are ordered from root (included) to leaves.

get.children.bottom.up returns a named list of character vectors. Each component corresponds to a node \(x\) of the graph (i.e. parent node) and its vector is the set of its children. The nodes are ordered from leaves (included) to root.

See Also

graph.levels

Examples

Run this code
# NOT RUN {
data(graph);
root <- root.node(g);
children <- build.children(g);
lev <- graph.levels(g, root=root);
children.tod <- get.children.top.down(g,lev);
children.bup <- get.children.bottom.up(g,lev);
# }

Run the code above in your browser using DataLab