Class UndirectedSubgraph<V,​E>

    • Constructor Detail

      • UndirectedSubgraph

        public UndirectedSubgraph​(UndirectedGraph<V,​E> base,
                                  java.util.Set<? extends V> vertexSubset,
                                  java.util.Set<? extends E> edgeSubset)
        Creates a new undirected subgraph.
        Parameters:
        base - the base (backing) graph on which the subgraph will be based.
        vertexSubset - vertices to include in the subgraph. If null then all vertices are included.
        edgeSubset - edges to in include in the subgraph. If null then all the edges whose vertices found in the graph are included.
      • UndirectedSubgraph

        public UndirectedSubgraph​(UndirectedGraph<V,​E> base,
                                  java.util.Set<? extends V> vertexSubset)
        Creates a new undirected induced subgraph.
        Parameters:
        base - the base (backing) graph on which the subgraph will be based.
        vertexSubset - vertices to include in the subgraph. If null then all vertices are included.
      • UndirectedSubgraph

        public UndirectedSubgraph​(UndirectedGraph<V,​E> base)
        Creates a new undirected induced subgraph with all vertices included.
        Parameters:
        base - the base (backing) graph on which the subgraph will be based.
    • Method Detail

      • degreeOf

        public int degreeOf​(V vertex)
        Returns the degree of the specified vertex. A degree of a vertex in an undirected graph is the number of edges touching that vertex.
        Specified by:
        degreeOf in interface UndirectedGraph<V,​E>
        Parameters:
        vertex - vertex whose degree is to be calculated.
        Returns:
        the degree of the specified vertex.