\HeaderA{extractPath}{convert a dijkstra.sp predecessor structure into the path joining two nodes}{extractPath}
\keyword{models}{extractPath}
\begin{Description}\relax
determine a path between two nodes in a graph,
using output of \code{\LinkA{dijkstra.sp}{dijkstra.sp}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
extractPath(s, f, pens)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{s}] index of starting node in nodes vector
of the graph from which \code{pens} was derived
\item[\code{f}] index of ending node in nodes vector 
\item[\code{pens}] predecessor index vector as returned
in the \code{preds} component of \code{\LinkA{dijkstra.sp}{dijkstra.sp}} output
\end{ldescription}
\end{Arguments}
\begin{Author}\relax
Vince Carey <stvjc@channing.harvard.edu>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{allShortestPaths}{allShortestPaths}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(FileDep)
dd <- dijkstra.sp(FileDep)
extractPath(1,9,dd$pen)
\end{ExampleCode}
\end{Examples}

