graph.levels {HEMDAG} | R Documentation |
Build graph levels
Description
Group a set of nodes in according to their maximum depth in the graph. Firstly, it inverts the weights of the graph and then it applies the Bellman Ford algorithm to find the shortest path, achieving in this way the longest path.
Usage
graph.levels(g, root = "00")
Arguments
g |
an object of class |
root |
name of the class that it is on the top-level of the hierarchy ( |
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
data(graph);
root <- root.node(g);
lev <- graph.levels(g, root=root);
[Package HEMDAG version 2.7.4 Index]