Description Usage Arguments Details Value References See Also Examples
sort
calculates the topological ordering of graph, that is sorts it.
1 2 |
x |
causality graph that you wish to calculate the topological ordering of |
decreasing |
logical value to determine whether or the not sort should
be in decreasing order. default is |
... |
additional parameters that can be sent through sort generic |
sort.causality.graph
generates a topological ordering of the
given graph
by using a depth first search as described in CLRS.
A topological sort (or ordering) is a linear ordering of nodes in a PDAG.
That is if we have x --> y, then x < y in the sort.
This ordering is not unique; a PDAG may have multiple valid orderings.
A character vector that contains the nodes of the graph ordered
according to their topological order. In the event that graph
is
cyclic, a warning is issued and NULL
is returned.
Cormen, Thomas H., et al. Introduction to Algorithms. The MIT Press, 2014.
sort
is used in various causality
functions, including
as.dag
, is.cyclic
/is.acyclic
,
and as.pattern
1 2 3 4 | sort(sachs.dag)
# sort also works with pdags/patterns
sort(as.pattern(sachs.dag))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.