Package dev.nm.graph

Interface Tree<V,​E extends HyperEdge<V>>

  • Type Parameters:
    V - vertex type
    E - edge type
    All Superinterfaces:
    Graph<V,​E>
    All Known Subinterfaces:
    Forest<V,​E>, RootedTree<V,​E>
    All Known Implementing Classes:
    SparseTree, VertexTree

    public interface Tree<V,​E extends HyperEdge<V>>
    extends Graph<V,​E>
    A tree is an undirected graph in which any two vertices are connected by exactly one simple path. Consequently, each vertex in a tree has only one parent.
    See Also:
    Wikipedia: Tree (graph theory)
    • Method Detail

      • parent

        V parent​(V v)
        Gets the unique parent of a vertex.
        Parameters:
        v - a vertex
        Returns:
        the parent of v