public class MST extends Object
Double.NEGATIVE_INFINITY
the edge will not be used.Constructor and Description |
---|
MST() |
Modifier and Type | Method and Description |
---|---|
static int[][] |
kruskal(double[][] weights)
Does Kruskals algorithm and finds the maximal spanning
tree (MST).
|
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).