View source: R/structural.properties.R
| topo_sort | R Documentation |
A topological sorting of a directed acyclic graph is a linear ordering of its nodes where each node comes before all nodes to which it has edges.
topo_sort(graph, mode = c("out", "all", "in"))
graph |
The input graph, should be directed |
mode |
Specifies how to use the direction of the edges. For
“ |
Every DAG has at least one topological sort, and may have many. This function returns a possible topological sort among them. If the graph is not acyclic (it has at least one cycle), a partial topological sort is returned and a warning is issued.
A vertex sequence (by default, but see the return.vs.es
option of igraph_options()) containing vertices in
topologically sorted order.
Tamas Nepusz ntamas@gmail.com and Gabor Csardi csardi.gabor@gmail.com for the R interface
Other structural.properties:
bfs(),
component_distribution(),
connect(),
constraint(),
coreness(),
degree(),
dfs(),
distance_table(),
edge_density(),
feedback_arc_set(),
girth(),
is_acyclic(),
is_dag(),
is_matching(),
k_shortest_paths(),
knn(),
reciprocity(),
subcomponent(),
subgraph(),
transitivity(),
unfold_tree(),
which_multiple(),
which_mutual()
g <- sample_pa(100)
topo_sort(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.