- All Implemented Interfaces:
- it.unimi.dsi.lang.FlyweightPrototype<ImmutableUndirectedBigGraphAdapter>,- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
ImmutableGraph.
 
 This class is equivalent to ImmutableUndirectedGraphAdapter, except that nodes are
 instances of Long, and edges are instances of LongLongSortedPair.
 
If necessary, you can adapt a standard WebGraph graph using the suitable wrapper.
- Author:
- Sebastiano Vigna
- See Also:
- 
Field SummaryFields inherited from class org.jgrapht.webgraph.AbstractImmutableBigGraphAdapterimmutableGraph, m, nFields inherited from interface org.jgrapht.GraphDEFAULT_EDGE_WEIGHT
- 
Constructor SummaryConstructorsConstructorDescriptionImmutableUndirectedBigGraphAdapter(it.unimi.dsi.big.webgraph.ImmutableGraph immutableGraph) Creates an adapter for an undirected (i.e., symmetric) big immutable graph.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsEdge(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Returnstrueif this graph contains the specified edge.copy()intReturns the degree of the specified vertex.Set<it.unimi.dsi.fastutil.longs.LongLongSortedPair>edgeSet()Returns a set of the edges contained in this graph.Set<it.unimi.dsi.fastutil.longs.LongLongSortedPair>Returns a set of all edges touching the specified vertex.getEdgeSource(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Returns the source vertex of an edge.getEdgeTarget(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Returns the target vertex of an edge.doublegetEdgeWeight(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Returns the weight assigned to a given edge.getType()Get the graph type.Set<it.unimi.dsi.fastutil.longs.LongLongSortedPair>incomingEdgesOf(Long vertex) Returns a set of all edges incoming into the specified vertex.intinDegreeOf(Long vertex) Returns the "in degree" of the specified vertex.GraphIterables<Long,it.unimi.dsi.fastutil.longs.LongLongSortedPair> Access the graph using theGraphIterablesinterface.protected it.unimi.dsi.fastutil.longs.LongLongSortedPairmakeEdge(long x, long y) intoutDegreeOf(Long vertex) Returns the "out degree" of the specified vertex.Set<it.unimi.dsi.fastutil.longs.LongLongSortedPair>outgoingEdgesOf(Long vertex) Returns a set of all edges outgoing from the specified vertex.booleanremoveEdge(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Removes the specified edge from the graph.it.unimi.dsi.fastutil.longs.LongLongSortedPairremoveEdge(Long sourceVertex, Long targetVertex) Removes an edge going from source vertex to target vertex, if such vertices and such edge exist in this graph.booleanremoveVertex(Long v) Removes the specified vertex from this graph including all its touching edges if present.voidsetEdgeWeight(it.unimi.dsi.fastutil.longs.LongLongSortedPair e, double weight) Assigns a weight to an edge.Returns a set of the vertices contained in this graph.Methods inherited from class org.jgrapht.webgraph.AbstractImmutableBigGraphAdapteraddEdge, addEdge, addVertex, addVertex, containsEdge, containsEdgeFast, containsVertex, getAllEdges, getEdge, getEdgeSupplier, getVertexSupplierMethods inherited from class org.jgrapht.graph.AbstractGraphassertVertexExist, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSetsMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapht.GraphsetEdgeWeight
- 
Constructor Details- 
ImmutableUndirectedBigGraphAdapterpublic ImmutableUndirectedBigGraphAdapter(it.unimi.dsi.big.webgraph.ImmutableGraph immutableGraph) Creates an adapter for an undirected (i.e., symmetric) big immutable graph.It is responsibility of the caller that the provided graph has is symmetric (for each arc x → y there is an arc y → x). If this property is not true, results will be unpredictable. - Parameters:
- immutableGraph- a symmetric big immutable graph.
 
 
- 
- 
Method Details- 
makeEdgeprotected it.unimi.dsi.fastutil.longs.LongLongSortedPair makeEdge(long x, long y) - Specified by:
- makeEdgein class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
 
- 
containsEdgepublic boolean containsEdge(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Description copied from interface:GraphReturnstrueif this graph contains the specified edge. More formally, returnstrueif and only if this graph contains an edgee2such thate.equals(e2). If the specified edge isnullreturnsfalse.- Specified by:
- containsEdgein interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Parameters:
- e- edge whose presence in this graph is to be tested.
- Returns:
- trueif this graph contains the specified edge.
 
- 
edgeSetDescription copied from interface:GraphReturns a set of the edges contained in this graph. The set is backed by the graph, so changes to the graph are reflected in the set. If the graph is modified while an iteration over the set is in progress, the results of the iteration are undefined.The graph implementation may maintain a particular set ordering (e.g. via LinkedHashSet) for deterministic iteration, but this is not required. It is the responsibility of callers who rely on this behavior to only use graph implementations which support it.
- 
degreeOfDescription copied from interface:GraphReturns 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". 
- 
edgesOfDescription copied from interface:GraphReturns a set of all edges touching the specified vertex. If no edges are touching the specified vertex returns an empty set.
- 
inDegreeOfDescription copied from interface:GraphReturns 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 interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Parameters:
- vertex- vertex whose degree is to be calculated.
- Returns:
- the degree of the specified vertex.
 
- 
incomingEdgesOfDescription copied from interface:GraphReturns 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 interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- 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.
 
- 
outDegreeOfDescription copied from interface:GraphReturns the "out degree" of the specified vertex.The "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. 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:
- outDegreeOfin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Parameters:
- vertex- vertex whose degree is to be calculated.
- Returns:
- the degree of the specified vertex.
 
- 
outgoingEdgesOfDescription copied from interface:GraphReturns a set of all edges outgoing from 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:
- outgoingEdgesOfin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- 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.
 
- 
removeEdgepublic it.unimi.dsi.fastutil.longs.LongLongSortedPair removeEdge(Long sourceVertex, Long targetVertex) Description copied from interface:GraphRemoves an edge going from source vertex to target vertex, if such vertices and such edge exist in this graph. Returns the edge if removed ornullotherwise.- Specified by:
- removeEdgein interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- removeEdgein class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- sourceVertex- source vertex of the edge.
- targetVertex- target vertex of the edge.
- Returns:
- The removed edge, or nullif no edge removed.
 
- 
removeEdgepublic boolean removeEdge(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Description copied from interface:GraphRemoves the specified edge from the graph. Removes the specified edge from this graph if it is present. More formally, removes an edgee2such thate2.equals(e), if the graph contains such edge. Returnstrueif the graph contained the specified edge. (The graph will not contain the specified edge once the call returns).If the specified edge is nullreturnsfalse.- Specified by:
- removeEdgein interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- removeEdgein class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- e- edge to be removed from this graph, if present.
- Returns:
- trueif and only if the graph contained the specified edge.
 
- 
removeVertexDescription copied from interface:GraphRemoves the specified vertex from this graph including all its touching edges if present. More formally, if the graph contains a vertexusuch thatu.equals(v), the call removes all edges that touchuand then removesuitself. If no suchuis found, the call leaves the graph unchanged. Returnstrueif the graph contained the specified vertex. (The graph will not contain the specified vertex once the call returns).If the specified vertex is nullreturnsfalse.- Specified by:
- removeVertexin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- removeVertexin class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- v- vertex to be removed from this graph, if present.
- Returns:
- trueif the graph contained the specified vertex;- falseotherwise.
 
- 
vertexSetDescription copied from interface:GraphReturns a set of the vertices contained in this graph. The set is backed by the graph, so changes to the graph are reflected in the set. If the graph is modified while an iteration over the set is in progress, the results of the iteration are undefined.The graph implementation may maintain a particular set ordering (e.g. via LinkedHashSet) for deterministic iteration, but this is not required. It is the responsibility of callers who rely on this behavior to only use graph implementations which support it.- Specified by:
- vertexSetin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- vertexSetin class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Returns:
- a set view of the vertices contained in this graph.
 
- 
getEdgeSourceDescription copied from interface:GraphReturns the source vertex of an edge. For an undirected graph, source and target are distinguishable designations (but without any mathematical meaning).- Specified by:
- getEdgeSourcein interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- getEdgeSourcein class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- e- edge of interest
- Returns:
- source vertex
 
- 
getEdgeTargetDescription copied from interface:GraphReturns the target vertex of an edge. For an undirected graph, source and target are distinguishable designations (but without any mathematical meaning).- Specified by:
- getEdgeTargetin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- getEdgeTargetin class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- e- edge of interest
- Returns:
- target vertex
 
- 
getEdgeWeightpublic double getEdgeWeight(it.unimi.dsi.fastutil.longs.LongLongSortedPair e) Description copied from interface:GraphReturns the weight assigned to a given edge. Unweighted graphs return 1.0 (as defined byGraph.DEFAULT_EDGE_WEIGHT), allowing weighted-graph algorithms to apply to them when meaningful.- Specified by:
- getEdgeWeightin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- getEdgeWeightin class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- e- edge of interest
- Returns:
- edge weight
 
- 
setEdgeWeightpublic void setEdgeWeight(it.unimi.dsi.fastutil.longs.LongLongSortedPair e, double weight) Description copied from interface:GraphAssigns a weight to an edge.- Specified by:
- setEdgeWeightin interface- Graph<Long,- it.unimi.dsi.fastutil.longs.LongLongSortedPair> 
- Overrides:
- setEdgeWeightin class- AbstractImmutableBigGraphAdapter<it.unimi.dsi.fastutil.longs.LongLongSortedPair>
- Parameters:
- e- edge on which to set weight
- weight- new weight for edge
 
- 
getTypeDescription copied from interface:GraphGet the graph type. The graph type can be used to query for additional metadata such as whether the graph supports directed or undirected edges, self-loops, multiple (parallel) edges, weights, etc.
- 
copy- Specified by:
- copyin interface- it.unimi.dsi.lang.FlyweightPrototype<ImmutableUndirectedBigGraphAdapter>
 
- 
iterablesDescription copied from interface:GraphAccess the graph using theGraphIterablesinterface. This allows accessing graphs without the restrictions imposed by 32-bit arithmetic. Moreover, graph implementations are free to implement this interface without explicitly materializing intermediate results.
 
-