topo_sort_kahn | R Documentation |
Return a sorted vector of nodes id
topo_sort_kahn(g, random = FALSE)
g |
An igraph object of a DAG |
random |
Boolean, whether the order of selected nodes is randomised in the process |
A data frame with two columns: "id" is the names of nodes in g, and "id_num" is the topological ordering
df0 <- data.frame(from = c("a", "b"), to = c("b", "c"), stringsAsFactors = FALSE)
g0 <- igraph::graph_from_data_frame(df0, directed = TRUE)
topo_sort_kahn(g0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.