V
- E
- public class MinimumSpanningForest<V,E> extends Object
Modifier and Type | Field and Description |
---|---|
protected Forest<V,E> |
forest |
protected Graph<V,E> |
graph |
protected Map<E,Double> |
weights |
Constructor and Description |
---|
MinimumSpanningForest(Graph<V,E> graph,
org.apache.commons.collections4.Factory<Forest<V,E>> factory,
V root,
Map<E,Double> weights)
Creates a Forest from the supplied Graph and supplied Factory, which
is used to create a new, empty Forest.
|
MinimumSpanningForest(Graph<V,E> graph,
Forest<V,E> forest,
V root)
Creates a minimum spanning forest from the supplied graph, populating the
supplied Forest, which must be empty.
|
MinimumSpanningForest(Graph<V,E> graph,
Forest<V,E> forest,
V root,
Map<E,Double> weights)
Creates a minimum spanning forest from the supplied graph, populating the
supplied Forest, which must be empty.
|
Modifier and Type | Method and Description |
---|---|
Forest<V,E> |
getForest()
Returns the generated forest.
|
protected void |
updateForest(Collection<V> tv,
Collection<E> unfinishedEdges) |
public MinimumSpanningForest(Graph<V,E> graph, org.apache.commons.collections4.Factory<Forest<V,E>> factory, V root, Map<E,Double> weights)
graph
- the input graphfactory
- the factory to use to create the new forestroot
- the vertex of the graph to be used as the root of the forestweights
- edge weightspublic MinimumSpanningForest(Graph<V,E> graph, Forest<V,E> forest, V root, Map<E,Double> weights)
graph
- the Graph to find MST inforest
- the Forest to populate. Must be emptyroot
- first Tree root, may be nullweights
- edge weights, may be nullpublic MinimumSpanningForest(Graph<V,E> graph, Forest<V,E> forest, V root)
graph
- the Graph to find MST inforest
- the Forest to populate. Must be emptyroot
- first Tree root, may be nullprotected void updateForest(Collection<V> tv, Collection<E> unfinishedEdges)
Copyright © 2015. All rights reserved.