Class MinimumSpanningForest2<V,​E>

  • Type Parameters:
    V -
    E -

    public class MinimumSpanningForest2<V,​E>
    extends java.lang.Object
    For the input Graph, creates a MinimumSpanningTree using a variation of Prim's algorithm.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected edu.uci.ics.jung.graph.Forest<V,​E> forest  
      protected edu.uci.ics.jung.graph.Graph<V,​E> graph  
      protected org.apache.commons.collections4.Transformer weights  
    • Constructor Summary

      Constructors 
      Constructor Description
      MinimumSpanningForest2​(edu.uci.ics.jung.graph.Graph<V,​E> graph, edu.uci.ics.jung.graph.Forest<V,​E> forest, org.apache.commons.collections4.Factory<? extends edu.uci.ics.jung.graph.Graph<V,​E>> treeFactory, org.apache.commons.collections4.Transformer<E,​java.lang.Double> weights)
      create a forest from the supplied graph, populating the supplied Forest, which must be empty.
      MinimumSpanningForest2​(edu.uci.ics.jung.graph.Graph<V,​E> graph, org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Forest<V,​E>> factory, org.apache.commons.collections4.Factory<? extends edu.uci.ics.jung.graph.Graph<V,​E>> treeFactory, org.apache.commons.collections4.Transformer<E,​java.lang.Double> weights)
      create a Forest from the supplied Graph and supplied Factory, which is used to create a new, empty Forest.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      edu.uci.ics.jung.graph.Forest<V,​E> getForest()
      Returns the generated forest.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • graph

        protected edu.uci.ics.jung.graph.Graph<V,​E> graph
      • forest

        protected edu.uci.ics.jung.graph.Forest<V,​E> forest
      • weights

        protected org.apache.commons.collections4.Transformer weights
    • Constructor Detail

      • MinimumSpanningForest2

        public MinimumSpanningForest2​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                                      org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Forest<V,​E>> factory,
                                      org.apache.commons.collections4.Factory<? extends edu.uci.ics.jung.graph.Graph<V,​E>> treeFactory,
                                      org.apache.commons.collections4.Transformer<E,​java.lang.Double> weights)
        create a Forest from the supplied Graph and supplied Factory, which is used to create a new, empty Forest. If non-null, the supplied root will be used as the root of the tree/forest. If the supplied root is null, or not present in the Graph, then an arbitary Graph vertex will be selected as the root. If the Minimum Spanning Tree does not include all vertices of the Graph, then a leftover vertex is selected as a root, and another tree is created
        Parameters:
        graph -
        factory -
        weights -
      • MinimumSpanningForest2

        public MinimumSpanningForest2​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                                      edu.uci.ics.jung.graph.Forest<V,​E> forest,
                                      org.apache.commons.collections4.Factory<? extends edu.uci.ics.jung.graph.Graph<V,​E>> treeFactory,
                                      org.apache.commons.collections4.Transformer<E,​java.lang.Double> weights)
        create a forest from the supplied graph, populating the supplied Forest, which must be empty. If the supplied root is null, or not present in the Graph, then an arbitary Graph vertex will be selected as the root. If the Minimum Spanning Tree does not include all vertices of the Graph, then a leftover vertex is selected as a root, and another tree is created
        Parameters:
        graph - the Graph to find MST in
        forest - the Forest to populate. Must be empty
        weights - edge weights, may be null
    • Method Detail

      • getForest

        public edu.uci.ics.jung.graph.Forest<V,​E> getForest()
        Returns the generated forest.