public class MST extends Object
Double.NEGATIVE_INFINITY
the edge will not be used.public static int[][] kruskal(double[][] weights)
weights
- the matrix of weights, weights.length
is the
number of nodes in the tree, weights[i][j]
is the
weight for edge (i,i+j+1)
, e.g., weights[0][0] is the weight for edge (0,1).