Learn R Programming

pegas (version 0.8-2)

mst: Minimum Spanning Tree

Description

This function computes a minimum spanning tree using Kruskal's algorithm.

Usage

mst(d)

Arguments

d
a distance matrix, either as an object of class "dist", or a (square symmetric) matrix.

Value

References

Kruskal, J. B., Jr. (1956) On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, 7, 48--50.

See Also

haploNet

Examples

Run this code
data(woodmouse)
d <- dist.dna(woodmouse, "n")
(r <- mst(d))
plot(r)

Run the code above in your browser using DataLab