powered by
These functions calculate properties that are dependent on the overall topology of the graph.
node_dominator(root, mode = "out")node_topo_order(mode = "out")
node_topo_order(mode = "out")
A vector of the same length as the number of nodes in the graph
The node to start the dominator search from
How should edges be followed. Either 'in' or 'out'
'in'
'out'
node_dominator(): Get the immediate dominator of each node. Wraps igraph::dominator_tree().
node_dominator()
igraph::dominator_tree()
node_topo_order(): Get the topological order of nodes in a DAG. Wraps igraph::topo_sort().
node_topo_order()
igraph::topo_sort()
# Sort a graph based on its topological order create_tree(10, 2) %>% arrange(sample(graph_order())) %>% mutate(old_ind = seq_len(graph_order())) %>% arrange(node_topo_order())
Run the code above in your browser using DataLab