dag.sp
DAG shortest paths using boost C++
Algorithm for the singlesource shortestpaths problem on a weighted, directed acyclic graph (DAG)
 Keywords
 graphs
Usage
dag.sp(g,start=nodes(g)[1])
Arguments
 g
 instance of class graph
 start
 source node for start of paths
Details
These functions are interfaces to the Boost graph library C++ routines for singlesource shortestpaths on a weighted directed acyclic graph. Choose appropriate shortestpath algorithms carefully based on the properties of the input graph. See documentation in Boost Graph Library for more details.
Value

A list with elements:
 distance
 The vector of distances from
start
to each node ofg
; includesInf
when there is no path fromstart
.  penult
 A vector of indices
(in
nodes(g)
) of predecessors corresponding to each node on the path from that node back tostart
. For example, if the element one of this vector has value10
, that means that the predecessor of node1
is node10
. The next predecessor is found by examiningpenult[10]
.  start
 The start node that was supplied in the call to
dag.sp
.
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, LieQuan Lee, and Andrew Lumsdaine; (AddisonWesley, Pearson Education Inc., 2002), xxiv+321pp. ISBN 0201729148
See Also
bellman.ford.sp
, dijkstra.sp
, johnson.all.pairs.sp
, sp.between
Examples
con < file(system.file("XML/conn2.gxl",package="RBGL"), open="r")
dd < fromGXL(con)
close(con)
dag.sp(dd)
dag.sp(dd,nodes(dd)[2])
Community examples
Looks like there are no examples yet.