org.jgrapht.graph

## Class UndirectedSubgraph<V,E>

- java.lang.Object
- - org.jgrapht.graph.AbstractGraph<V,E>
  - - org.jgrapht.graph.Subgraph<V,E,UndirectedGraph<V,E>>
    - - org.jgrapht.graph.UndirectedSubgraph<V,E>

- All Implemented Interfaces:
    Serializable, Graph<V,E>, UndirectedGraph<V,E>
  Direct Known Subclasses:
    UndirectedWeightedSubgraph

      public class UndirectedSubgraph<V,E>
      extends Subgraph<V,E,UndirectedGraph<V,E>>
      implements UndirectedGraph<V,E>

  An undirected graph that is a subgraph on other graph.
  See Also:
    `Subgraph`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UndirectedSubgraph(UndirectedGraph<V,E> base, Set<V> vertexSubset, Set<E> edgeSubset)` Creates a new undirected subgraph.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `degreeOf(V vertex)` Returns the degree of the specified vertex.

    - ### Methods inherited from class org.jgrapht.graph.Subgraph

      `addEdge, addEdge, addVertex, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getBase, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeEdge, removeEdge, removeVertex, setEdgeWeight, vertexSet`

    - ### Methods inherited from class org.jgrapht.graph.AbstractGraph

      `assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSets`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.jgrapht.Graph

      `addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet`

- - ### Constructor Detail

    - #### UndirectedSubgraph

          public UndirectedSubgraph(UndirectedGraph<V,E> base,
                            Set<V> vertexSubset,
                            Set<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.

  - ### Method Detail

    - #### degreeOf

          public int degreeOf(V vertex)

      Description copied from interface: `UndirectedGraph`
      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.
      See Also:
        `UndirectedGraph.degreeOf(Object)`

Copyright © 2016. All rights reserved.