lexicographical.topological.sort {HEMDAG} | R Documentation |
Lexicographical topological sorting
Description
Nodes of a graph are sorted according to a lexicographical topological ordering.
Usage
lexicographical.topological.sort(g)
Arguments
g |
an object of class |
Details
A topological sorting is a linear ordering of the nodes such that given an edge from u
to v
, the node u
comes before
node v
in the ordering. Topological sorting is not possible if the graph g
contains self-loop.
To implement the topological sorting algorithm we applied the Kahn’s algorithm.
Value
A vector in which the nodes of the graph g
are sorted according to a lexicographical topological order.
Examples
data(graph);
T <- lexicographical.topological.sort(g);
[Package HEMDAG version 2.7.4 Index]