\HeaderA{dag.sp}{DAG shortest paths using boost C++}{dag.sp}
\keyword{graphs}{dag.sp}
\begin{Description}\relax
Algorithm for the single-source shortest-paths problem on a weighted, directed acyclic graph (DAG)
\end{Description}
\begin{Usage}
\begin{verbatim}
dag.sp(g,start=nodes(g)[1])
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{g}] instance of class graph 
\item[\code{start}] source node for start of paths 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These functions are interfaces to the Boost graph library C++ routines
for single-source shortest-paths on a weighted directed acyclic graph.
Choose appropriate shortest-path algorithms carefully based on the properties
of the input graph.  See documentation in Boost Graph Library for more details.
\end{Details}
\begin{Value}
A list with elements:
\begin{ldescription}
\item[\code{distance}] The vector of distances from \code{start} to each node
of \code{g}; includes \code{Inf} when there is no path from \code{start}.
\item[\code{penult}] A vector of indices
(in \code{nodes(g)}) of predecessors corresponding to each node
on the path from that node back to \code{start}. For example, if the
element one of this vector has value \code{10}, that means that the
predecessor of node \code{1} is node \code{10}. The next predecessor is
found by examining \code{penult[10]}.
\item[\code{start}] The start node that was supplied in the call to
\code{dag.sp}.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Li Long <li.long@isb-sib.ch>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{bellman.ford.sp}{bellman.ford.sp}}, \code{\LinkA{dijkstra.sp}{dijkstra.sp}}, \code{\LinkA{johnson.all.pairs.sp}{johnson.all.pairs.sp}}, \code{\LinkA{sp.between}{sp.between}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
dd <- fromGXL(file(system.file("XML/conn2.gxl",package="RBGL"), open="r"))
dag.sp(dd)
dag.sp(dd,nodes(dd)[2])
\end{ExampleCode}
\end{Examples}

