Class PrimMinimumSpanningTree<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.shortestpath.PrimMinimumSpanningTree<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
com.google.common.base.Function<Graph<V,
,E>, Graph<V, E>> Function<Graph<V,
E>, Graph<V, E>>
public class PrimMinimumSpanningTree<V,E>
extends Object
implements com.google.common.base.Function<Graph<V,E>,Graph<V,E>>
For the input Graph, creates a MinimumSpanningTree
using a variation of Prim's algorithm.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPrimMinimumSpanningTree
(com.google.common.base.Supplier<? extends Graph<V, E>> supplier) Creates an instance which generates a minimum spanning tree assuming constant edge weights.PrimMinimumSpanningTree
(com.google.common.base.Supplier<? extends Graph<V, E>> supplier, com.google.common.base.Function<? super E, Double> weights) Creates an instance which generates a minimum spanning tree using the input edge weights. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
treeFactory
-
weights
-
-
Constructor Details
-
PrimMinimumSpanningTree
Creates an instance which generates a minimum spanning tree assuming constant edge weights.- Parameters:
supplier
- used to create the tree instances
-
PrimMinimumSpanningTree
public PrimMinimumSpanningTree(com.google.common.base.Supplier<? extends Graph<V, E>> supplier, com.google.common.base.Function<? super E, Double> weights) Creates an instance which generates a minimum spanning tree using the input edge weights.- Parameters:
supplier
- used to create the tree instancesweights
- the edge weights to use for defining the MST
-
-
Method Details