Class IncomingNoReindexSparseDirectedSpecifics
- All Implemented Interfaces:
SparseGraphSpecifics
- Author:
- Dimitrios Michail
-
Field Summary
FieldsFields inherited from class org.jgrapht.opt.graph.sparse.specifics.NoIncomingNoReindexSparseDirectedSpecifics
NO_INCOMING, outIncidenceMatrix, source, target, UNMODIFIABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the degree of the specified vertex.Returns a set of all edges touching the specified vertex.incomingEdgesOf(Integer vertex) Returns a set of all edges incoming into the specified vertex.longinDegreeOf(Integer vertex) Returns the "in degree" of the specified vertex.protected voidBuild the index for the incoming edges.Methods inherited from class org.jgrapht.opt.graph.sparse.specifics.NoIncomingNoReindexSparseDirectedSpecifics
edgesCount, getAllEdges, getEdge, getEdgeSource, getEdgeTarget, getType, outDegreeOf, outgoingEdgesOf, verticesCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jgrapht.opt.graph.sparse.specifics.SparseGraphSpecifics
assertEdgeExist, assertVertexExist, containsEdge, containsVertex, edgeSet, getEdgeWeight, setEdgeWeight, vertexSet
-
Field Details
-
inIncidenceMatrix
Incidence matrix with incoming edges
-
-
Constructor Details
-
IncomingNoReindexSparseDirectedSpecifics
public IncomingNoReindexSparseDirectedSpecifics(int numVertices, int numEdges, Supplier<Stream<Pair<Integer, Integer>>> edges, boolean lazyIncomingEdges) Create a new graph from an edge list.- Parameters:
numVertices- the number of verticesnumEdges- the number of edgesedges- a supplier of an edge streamlazyIncomingEdges- whether to lazily support incoming edge traversals, only if actually needed by the user
-
-
Method Details
-
degreeOf
Description copied from interface:SparseGraphSpecificsReturns the degree of the specified vertex.A degree of a vertex in an undirected graph is the number of edges touching that vertex. Edges with same source and target vertices (self-loops) are counted twice.
In directed graphs this method returns the sum of the "in degree" and the "out degree".
- Specified by:
degreeOfin interfaceSparseGraphSpecifics- Overrides:
degreeOfin classNoIncomingNoReindexSparseDirectedSpecifics- Parameters:
vertex- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
-
edgesOf
Description copied from interface:SparseGraphSpecificsReturns a set of all edges touching the specified vertex. If no edges are touching the specified vertex returns an empty set.- Specified by:
edgesOfin interfaceSparseGraphSpecifics- Overrides:
edgesOfin classNoIncomingNoReindexSparseDirectedSpecifics- Parameters:
vertex- the vertex for which a set of touching edges is to be returned.- Returns:
- a set of all edges touching the specified vertex.
-
inDegreeOf
Description copied from interface:SparseGraphSpecificsReturns the "in degree" of the specified vertex.The "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.
In the case of undirected graphs this method returns the number of edges touching the vertex. Edges with same source and target vertices (self-loops) are counted twice.
- Specified by:
inDegreeOfin interfaceSparseGraphSpecifics- Overrides:
inDegreeOfin classNoIncomingNoReindexSparseDirectedSpecifics- Parameters:
vertex- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
-
incomingEdgesOf
Description copied from interface:SparseGraphSpecificsReturns a set of all edges incoming into the specified vertex.In the case of undirected graphs this method returns all edges touching the vertex, thus, some of the returned edges may have their source and target vertices in the opposite order.
- Specified by:
incomingEdgesOfin interfaceSparseGraphSpecifics- Overrides:
incomingEdgesOfin classNoIncomingNoReindexSparseDirectedSpecifics- 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.
-
indexIncomingEdges
protected void indexIncomingEdges()Build the index for the incoming edges.
-