kruskal: Given a weight matrix, generate its maximum weight forest
Description
The function lists the edges of an forest generated by Kruskal's algorithm given its weight matrix
in which each weight should be symmetric but may be negative.
The forest is a spanning tree if the elements of the matrix take positive values.
Usage
kruskal(W)
Arguments
W
a matrix.
Value
A matrix object of size n x 2 for matrix size n x n in which each row expresses an edge
when the vertexes are expressed by 1 through n.
References
[1] Suzuki. J. ``The Bayesian Chow-Liu algorithms", In the sixth European workshop on Probabilistic Graphical Models, pp. 315-322, Granada, Spain, Sept.2012.