Description Usage Arguments Value Examples
View source: R/graph.utility.R
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.
1 | graph.levels(g, root = "00")
|
g |
an object of class |
root |
name of the root node ( |
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.
1 2 3 | data(graph);
root <- root.node(g);
lev <- graph.levels(g, root=root);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.