floyd.warshall.all.pairs.sp {RBGL} | R Documentation |
compute shortest paths for all pairs of nodes
floyd.warshall.all.pairs.sp(g)
g |
graph object with edge weights given |
Compute shortest paths between every pair of vertices for a dense graph.
The result is given as a distance matrix.
For a sparse matrix, use johnson.all.pairs.sp
instead.
See documentation on these algorithms in Boost Graph Library for more details.
matrix of shortest path lengths, read from row node to col node
Li Long <li.long@isb-sib.ch>
Boost Graph Library by Siek et al.
coex <- fromGXL(file(system.file("XML/conn.gxl", package="RBGL"), open="r")) floyd.warshall.all.pairs.sp(coex)