Learn R Programming

spa (version 2.0)

floyd: Shortest Path Distances

Description

‘uDist’ Computing shortest path distance (hop count) for an unweighted similarity graph where 1=edge and 0=no edge (i.e. invoke knnGraph with weight=FALSE)

‘floyd’ Floyd's algorithm (SLOW) for computing shortest path distances (weighted hop count) for distance weighted graphs (i.e. invoke knnGraph with weight=TRUE).

Usage

floyd(x,verbose=FALSE)
uDist(g, k)

Arguments

x
the adjacency n by n matrix (distance weighted)
verbose
print the progress for Floyd's algorithm
g
the adjacency n by n matrix (unweighted)
k
input parameter for determining the maximum distance to compute (a distance of greater than k is taken as infinity)

Value

D
Distance Matrix n by n

Details

These implementations are not yet optimized for large data sets (>5000 observations)

See Also

spa knnGraph epsGraph