Description Usage Arguments Value See Also Examples
Compute the children for each node of a graph.
1 2 3 4 5 |
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. |
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.
1 2 3 4 5 6 | 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);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.