Class DirectedSubgraph<V,​E>

    • Constructor Detail

      • DirectedSubgraph

        public DirectedSubgraph​(DirectedGraph<V,​E> base,
                                java.util.Set<? extends V> vertexSubset,
                                java.util.Set<? extends E> edgeSubset)
        Creates a new directed 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 include in the subgraph. If null then all the edges whose vertices found in the graph are included.
      • DirectedSubgraph

        public DirectedSubgraph​(DirectedGraph<V,​E> base,
                                java.util.Set<? extends V> vertexSubset)
        Creates a new directed 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.
      • DirectedSubgraph

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

      • inDegreeOf

        public int inDegreeOf​(V vertex)
        Returns the "in degree" of the specified vertex. An in degree of a vertex in a directed graph is the number of inward directed edges from that vertex. See http://mathworld.wolfram.com/Indegree.html.
        Specified by:
        inDegreeOf in interface DirectedGraph<V,​E>
        Parameters:
        vertex - vertex whose degree is to be calculated.
        Returns:
        the degree of the specified vertex.
      • incomingEdgesOf

        public java.util.Set<E> incomingEdgesOf​(V vertex)
        Returns a set of all edges incoming into the specified vertex.
        Specified by:
        incomingEdgesOf in interface DirectedGraph<V,​E>
        Parameters:
        vertex - the vertex for which the list of incoming edges to be returned.
        Returns:
        a set of all edges incoming into the specified vertex.
      • outDegreeOf

        public int outDegreeOf​(V vertex)
        Returns the "out degree" of the specified vertex. An out degree of a vertex in a directed graph is the number of outward directed edges from that vertex. See http://mathworld.wolfram.com/Outdegree.html.
        Specified by:
        outDegreeOf in interface DirectedGraph<V,​E>
        Parameters:
        vertex - vertex whose degree is to be calculated.
        Returns:
        the degree of the specified vertex.
      • outgoingEdgesOf

        public java.util.Set<E> outgoingEdgesOf​(V vertex)
        Returns a set of all edges outgoing from the specified vertex.
        Specified by:
        outgoingEdgesOf in interface DirectedGraph<V,​E>
        Parameters:
        vertex - the vertex for which the list of outgoing edges to be returned.
        Returns:
        a set of all edges outgoing from the specified vertex.