Package org.drip.graph.core
Class Forest<V>
java.lang.Object
org.drip.graph.core.Forest<V>
- Direct Known Subclasses:
KruskalForest
public class Forest<V>
extends java.lang.Object
Forest holds a Map of Trees indexed by the Starting Vertex Names. The References are:
- Bollobas, B. (1998): Modern Graph Theory Springer
- Eppstein, D. (1999): Spanning Trees and Spanners https://www.ics.uci.edu/~eppstein/pubs/Epp-TR-96-16.pdf
- Gross, J. L., and J. Yellen (2005): Graph Theory and its Applications Springer
- Kocay, W., and D. L. Kreher (2004): Graphs, Algorithms, and Optimizations CRC Press
- Wikipedia (2020): Spanning Tree https://en.wikipedia.org/wiki/Spanning_tree
- Module = Computational Core Module
- Library = Graph Algorithm Library
- Project = Graph Optimization and Tree Construction Algorithms
- Package = Vertexes, Edges, Trees, and Graphs
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description Forest()Forest Constructor -
Method Summary
Modifier and Type Method Description booleanaddTree(java.lang.String treeName, Tree<?> tree, Directed<?> graph)Add a Named Tree to the ForestbooleanconditionalMerge(Edge edge, Directed<?> graph)Conditionally Merge the Specified Source and Destination Trees of the EdgeTree<?>containingTree(java.lang.String vertexName)Retrieve the Tree that contains the specified Vertexjava.util.Map<java.lang.String,java.lang.String>containingTreeNameMap()Retrieve the Map of Containing Tree NamesbooleancontainsVertex(java.lang.String vertexName)Indicate if the Vertex is Contained in the Forestdoublelength()Retrieve the Length of the Forestjava.util.Map<java.lang.String,Tree<?>>treeMap()Retrieve the Map of Trees in the Forestjava.util.Set<java.lang.String>treeNameSet()Retrieve the Set of the Tree NamesbooleanunitVertexTree(java.lang.String vertexName, Directed<?> graph)Create and add a Unit Vertex Tree into the Forestjava.util.Set<java.lang.String>vertexSet()Retrieve the Set of VertexesMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Forest
public Forest()Forest Constructor
-
-
Method Details
-
treeMap
Retrieve the Map of Trees in the Forest- Returns:
- Map of Trees in the Forest
-
containingTreeNameMap
public java.util.Map<java.lang.String,java.lang.String> containingTreeNameMap()Retrieve the Map of Containing Tree Names- Returns:
- Map of Containing Tree Names
-
vertexSet
public java.util.Set<java.lang.String> vertexSet()Retrieve the Set of Vertexes- Returns:
- The Set of Vertexes
-
unitVertexTree
Create and add a Unit Vertex Tree into the Forest- Parameters:
vertexName- Vertex Namegraph- Parent Graph- Returns:
- TRUE - The Unit Vertex Tree successfully added into the Forest
-
addTree
Add a Named Tree to the Forest- Parameters:
treeName- The Tree Nametree- The Treegraph- The Graph- Returns:
- TRUE - The Keyed Tree successfully added to the Forest
-
treeNameSet
public java.util.Set<java.lang.String> treeNameSet()Retrieve the Set of the Tree Names- Returns:
- The Set of the Tree Names
-
containsVertex
public boolean containsVertex(java.lang.String vertexName)Indicate if the Vertex is Contained in the Forest- Parameters:
vertexName- The Vertex Name- Returns:
- TRUE - The Vertex is Contained in the Forest
-
containingTree
Retrieve the Tree that contains the specified Vertex- Parameters:
vertexName- The Vertex Name- Returns:
- Tree that contains the specified Vertex
-
conditionalMerge
Conditionally Merge the Specified Source and Destination Trees of the Edge- Parameters:
edge- The Edgegraph- The Graph- Returns:
- TRUE - The Source and the Destination Trees successfully conditionally merged
-
length
public double length()Retrieve the Length of the Forest- Returns:
- Length of the Forest
-