Does the digraph have a topological order?
true
if the digraph has a topological order (or equivalently, if the digraph
is a DAG), and false
otherwise.
Returns a topological order if the digraph has a topologial order, and empty collection otherwise.
a topological order of the vertices (as an interable) if the digraph has a topological order (or equivalently, if the digraph is a DAG), and empty collection otherwise.
The the rank of given vertex in the topological order; -1 if the digraph is not a DAG.
vertex
the position of the vertex in a topological order of the digraph; -1 if the digraph is not a DAG.
Generated using TypeDoc
Represents a data type for determining a topological order of a directed acyclic graph (DAG). Recall, a digraph has a topological order if and only if it is a DAG. The hasOrder operation determines whether the digraph has a topological order, and if so, the order operation returns one.
For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.