Last chance! 50% off unlimited learning
Sale ends in
bellman.ford.sp(g,start=nodes(g)[1])
start
to each node
of g
; includes Inf
when there is no path from start
.nodes(g)
) of predecessors corresponding to each node
on the path from that node back to start
10
, that means that the
predecessor of node 1
is node 10
. The next predecessor is
found by examining penult[10]
.
bellman.ford.sp
.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
dag.sp
, dijkstra.sp
, johnson.all.pairs.sp
, sp.between
con <- file(system.file("XML/conn2.gxl",package="RBGL"), open="r")
dd <- fromGXL(con)
close(con)
bellman.ford.sp(dd)
bellman.ford.sp(dd,nodes(dd)[2])
Run the code above in your browser using DataLab