dag.sp {RBGL} | R Documentation |
Algorithm for the single-source shortest-paths problem on a weighted, directed acyclic graph (DAG)
dag.sp(g,start=nodes(g)[1])
g |
instance of class graph |
start |
character: node name for start of path |
These functions are interfaces to the Boost graph library C++ routines for DAG shortest paths. Don't input cyclic graph.
A list with elements:
distance |
The vector of distances from start to each node
of g ; includes Inf when there is no path from start . |
penult |
A vector of indices
(in nodes(g) ) of predecessors corresponding to each node
on the path from that node back to start |
start |
The start node that was supplied in the call to
dag.sp . |
Li Long <li.long@isb-sib.ch>
dd <- fromGXL(file(system.file("XML/conn2.gxl",package="RBGL"))) dag.sp(dd) dag.sp(dd,nodes(dd)[2])