graph.levels: Build Graph Levels

Description Usage Arguments Value Examples

View source: R/graph.utility.R

Description

This function groups a set of nodes in according to their maximum depth in the graph. It first inverts the weights of the graph and then applies the Bellman Ford algorithm to find the shortest path, achieving in this way the longest path.

Usage

1
graph.levels(g, root = "00")

Arguments

g

an object of class graphNEL

root

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

Value

a list of the nodes grouped w.r.t. the distance from the root: the first element of the list corresponds to the root node (level 0), the second to nodes at maximum distance 1 (level 1), the third to the node at maximum distance 3 (level 2) and so on.

Examples

1
2
3
data(graph);
root <- root.node(g);
lev <- graph.levels(g, root=root);

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