@Reference(authors="R. C. Prim", title="Shortest connection networks and some generalizations", booktitle="Bell System Technical Journal, 36 (1957)") public class PrimsMinimumSpanningTree extends Object
R. C. Prim
Shortest connection networks and some generalizations
In: Bell System Technical Journal, 36 (1957), pp. 1389–140
Modifier and Type | Class and Description |
---|---|
static interface |
PrimsMinimumSpanningTree.Adapter<T>
Adapter interface to allow use with different data representations.
|
static class |
PrimsMinimumSpanningTree.Array2DAdapter
Adapter for a simple 2d double matrix.
|
Modifier and Type | Field and Description |
---|---|
static PrimsMinimumSpanningTree.Array2DAdapter |
ARRAY2D_ADAPTER
Adapter class for double[][] matrixes.
|
Constructor and Description |
---|
PrimsMinimumSpanningTree() |
Modifier and Type | Method and Description |
---|---|
static int[] |
processDense(double[][] mat)
Process a k x k distance matrix.
|
static int[] |
processDense(Matrix mat)
Process a k x k distance matrix.
|
static <T> int[] |
processDense(T data,
PrimsMinimumSpanningTree.Adapter<T> adapter)
Run Prim's algorithm on a dense graph.
|
public static final PrimsMinimumSpanningTree.Array2DAdapter ARRAY2D_ADAPTER
public static int[] processDense(double[][] mat)
mat
- Distance matrixpublic static int[] processDense(Matrix mat)
mat
- Distance matrixpublic static <T> int[] processDense(T data, PrimsMinimumSpanningTree.Adapter<T> adapter)
data
- Data setadapter
- Adapter instance