\HeaderA{tsort}{topological sort of vertices of a digraph}{tsort}
\keyword{graphs}{tsort}
\begin{Description}\relax
returns vector of zero-based indices of vertices
of a DAG in topological sort order
\end{Description}
\begin{Usage}
\begin{verbatim}
tsort(x) # now x assumed to be Bioconductor graph graphNEL
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] instance of class graphNEL from Bioconductor graph class
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
calls to the topological\_sort algorithm of BGL.  will check in BGL
whether the input is a DAG and return a vector of
zeroes (of length length(nodes(x))) if it is not.  Thus this function can be used to check for
cycles in a digraph.
\end{Details}
\begin{Value}
a numerical vector enumerating vertices in the
topological sort sequence, 0-based
\end{Value}
\begin{Author}\relax
VJ Carey <stvjc@channing.harvard.edu>
\end{Author}
\begin{Examples}
\begin{ExampleCode}
 data(FileDep)
 tsind <- tsort(FileDep)
 tsind
 FD2 <- FileDep
 # now introduce a cycle
 FD2 <- addEdge("bar_o", "dax_h", FD2, 1)
 tsort(FD2)
 \end{ExampleCode}
\end{Examples}

