parents: Build parents

Description Usage Arguments Value See Also Examples

Description

Compute the parents for each node of a graph.

Usage

1
2
3
4
5
6
7
get.parents(g, root = "00")

get.parents.top.down(g, levels, root = "00")

get.parents.bottom.up(g, levels, root = "00")

get.parents.topological.sorting(g, root = "00")

Arguments

g

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

root

name of the root node (def. root="00").

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

get.parents returns a named list of character vectors. Each component corresponds to a node x of the graph (i.e. child node) and its vector is the set of its parents (the root node is not included).

get.parents.top.down returns a named list of character vectors. Each component corresponds to a node x of the graph (i.e. child node) and its vector is the set of its parents. The nodes order follows the levels of the graph from root (excluded) to leaves.

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

get.parents.topological.sorting a named list of character vectors. Each component corresponds to a node x of the graph (i.e. child node) and its vector is the set of its parents. The nodes are ordered according to a topological sorting, i.e. parents node come before children node.

See Also

graph.levels

Examples

1
2
3
4
5
6
7
data(graph);
root <- root.node(g)
parents <- get.parents(g, root=root);
lev <- graph.levels(g, root=root);
parents.tod <- get.parents.top.down(g, lev, root=root);
parents.bup <- get.parents.bottom.up(g, lev, root=root);
parents.tsort <- get.parents.topological.sorting(g, root=root);

gecko515/HEMDAG documentation built on Oct. 18, 2019, 6:34 a.m.