0b6eec8b |
\name{extractPath}
\alias{extractPath}
|
5f234638 |
\title{convert a dijkstra.sp predecessor structure into the path joining two nodes }
|
164a6511 |
|
0b6eec8b |
\description{
determine a path between two nodes in a graph,
|
5f234638 |
using output of \code{\link{dijkstra.sp}}.
|
0b6eec8b |
}
|
164a6511 |
|
0b6eec8b |
\usage{
extractPath(s, f, pens)
}
|
164a6511 |
|
0b6eec8b |
\arguments{
|
931d8b3a |
\item{s}{ index of starting node in nodes vector
|
0b6eec8b |
of the graph from which \code{pens} was derived}
|
931d8b3a |
\item{f}{ index of ending node in nodes vector }
\item{pens}{ predecessor index vector as returned
|
5f234638 |
in the \code{preds} component of \code{\link{dijkstra.sp}} output}
|
0b6eec8b |
}
|
164a6511 |
\references{
Boost Graph Library ( www.boost.org/libs/graph/doc/index.html )
The Boost Graph Library: User Guide and Reference Manual;
by Jeremy G. Siek, Lie-Quan Lee, and Andrew Lumsdaine;
(Addison-Wesley, Pearson Education Inc., 2002), xxiv+321pp.
ISBN 0-201-72914-8
}
|
c2a22f7c |
\value{numeric vector of indices of nodes along shortest path}
|
164a6511 |
\author{Vince Carey <stvjc@channing.harvard.edu>}
|
0b6eec8b |
|
7fc3105c |
\seealso{ \code{\link[e1071:shortestPaths]{allShortestPaths}}}
|
0b6eec8b |
\examples{
data(FileDep)
|
5f234638 |
dd <- dijkstra.sp(FileDep)
|
0b6eec8b |
extractPath(1,9,dd$pen)
}
\keyword{ models }
|