primDistance {locationgamer} | R Documentation |
Minimum spanning tree using Prim's algorithm
Description
Minimum spanning tree using Prim's algorithm
Usage
primDistance(distMatrix)
Arguments
distMatrix |
A square matrix containing the distances between all vertexes of a network |
Value
A matrix with rows describing which vertex is connected to which other vertex.
Examples
distMatrix <- matrix(c(0,10,20,30,10,0,40,60,20,40,0,30,30,60,30,0),
nrow = 4, ncol = 4, byrow = TRUE)
primDistance(distMatrix)
[Package locationgamer version 0.1.0 Index]