dijkstra.sp {RBGL} | R Documentation |
dijkstra's shortest paths
dijkstra.sp(x,init.ind=1) # now x assumed to be Bioconductor graph graphNEL sp.between(g,start,finish) # now x assumed to be Bioconductor graph graphNEL
x |
instance of class graphNEL from Bioconductor graph class |
g |
instance of class graphNEL from Bioconductor graph class |
init.ind |
index (1 based) of where to start search |
start |
character atom: node name for start of path |
finish |
character atom: node name for end of path |
calls to boost dijkstra shortest paths
list of two vectors of nodes, shortest distance to each node, and penultimate node of shortest path, and of the staring node, assumes 1-based counting
Very preliminary
VJ Carey <stvjc@channing.harvard.edu>
dd <- fromGXL(file(system.file("XML/dijkex.gxl",package="RBGL"))) dijkstra.sp(dd) dijkstra.sp(dd,2) ospf <- fromGXL(file(system.file("XML/ospf.gxl",package="RBGL"))) dijkstra.sp(ospf,6) sp.between(ospf, "RT6", "RT1") if (interactive()) # see an error for query on nonexistent path sp.between(ospf,"N10", "N13")