Package org.jgrapht.graph
Class DirectedSubgraph<V,E>
java.lang.Object
org.jgrapht.graph.AbstractGraph<V,E>
org.jgrapht.graph.Subgraph<V,E,DirectedGraph<V,E>>
org.jgrapht.graph.DirectedSubgraph<V,E>
- All Implemented Interfaces:
Serializable,DirectedGraph<V,,E> Graph<V,E>
- Direct Known Subclasses:
DirectedWeightedSubgraph
public class DirectedSubgraph<V,E>
extends Subgraph<V,E,DirectedGraph<V,E>>
implements DirectedGraph<V,E>
A directed graph that is a subgraph on other graph.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDirectedSubgraph(DirectedGraph<V, E> base, Set<V> vertexSubset, Set<E> edgeSubset) Creates a new directed subgraph. -
Method Summary
Modifier and TypeMethodDescriptionincomingEdgesOf(V vertex) Returns a set of all edges incoming into the specified vertex.intinDegreeOf(V vertex) Returns the "in degree" of the specified vertex.intoutDegreeOf(V vertex) Returns the "out degree" of the specified vertex.outgoingEdgesOf(V vertex) Returns a set of all edges outgoing from 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, vertexSetMethods inherited from class org.jgrapht.graph.AbstractGraph
assertVertexExist, containsEdge, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSetsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Details
-
DirectedSubgraph
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. Ifnullthen all vertices are included.edgeSubset- edges to in include in the subgraph. Ifnullthen all the edges whose vertices found in the graph are included.
-
-
Method Details
-
inDegreeOf
Description copied from interface:DirectedGraphReturns 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:
inDegreeOfin interfaceDirectedGraph<V,E> - Parameters:
vertex- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
- See Also:
-
incomingEdgesOf
Description copied from interface:DirectedGraphReturns a set of all edges incoming into the specified vertex.- Specified by:
incomingEdgesOfin interfaceDirectedGraph<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.
- See Also:
-
outDegreeOf
Description copied from interface:DirectedGraphReturns 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:
outDegreeOfin interfaceDirectedGraph<V,E> - Parameters:
vertex- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
- See Also:
-
outgoingEdgesOf
Description copied from interface:DirectedGraphReturns a set of all edges outgoing from the specified vertex.- Specified by:
outgoingEdgesOfin interfaceDirectedGraph<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.
- See Also:
-