Adds the given edge to the graph, increasing the number of nodes if needed.
Adds the given edge to the graph, increasing the number of nodes if needed.
Called by other methods when given an id that doesn't exist in this graph.
Called by other methods when given an id that doesn't exist in this graph. By default it throws an exception, but implementations can override it to return an IndexedSeq which is the neighbor seq of non-existing nodes (typically an empty IndexedSeq).
The number of edges in this graph.
The number of edges in this graph.
Returns the number of in-neighbors of the given id.
Returns the number of in-neighbors of the given id.
Returns the in-degree of the given node id, or 0 if the node id does not exist.
Returns the in-degree of the given node id, or 0 if the node id does not exist.
Returns the ith in-neighbor of the node with the given id.
Returns the ith in-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < inDegree(id).
Returns the in-neighbors of the given id as a java.util.List.
Returns the in-neighbors of the given id as a java.util.List.
Returns the in-neighbors of the given id.
Returns the in-neighbors of the given id. Throws NoSuchElementException if id is not a valid id.
The largest node id in this graph (or an upper bound on it).
The largest node id in this graph (or an upper bound on it).
Returns the nodeCount if it is defined.
Returns the nodeCount if it is defined. Otherwise throws an UnsupportedOperationException.
The number of nodes in this graph.
The number of nodes in this graph. May return None if it is expensive to compute (for example, for the union of two graphs).
All nodeIds that exist in the graph.
All nodeIds that exist in the graph.
Returns the number of out-neighbors of the given id.
Returns the number of out-neighbors of the given id.
Returns the out-degree of the given node id, or 0 if the node id does not exist.
Returns the out-degree of the given node id, or 0 if the node id does not exist.
Returns the ith out-neighbor of the node with the given id.
Returns the ith out-neighbor of the node with the given id. Throws IndexOutOfBoundsException unless 0 <= i < outDegree(id).
Returns the out-neighbors of the given id as a java.util.List.
Returns the out-neighbors of the given id as a java.util.List.
Returns the out-neighbors of the given id.
Returns the out-neighbors of the given id.
Returns a view of the transpose of this graph.
Returns a view of the transpose of this graph.
Returns the node with the given id
or else None
if the given node does not
exist in this graph.
Returns the node with the given id
or else None
if the given node does not
exist in this graph. Deprecated: to decrease the number of objects used, get node
neighbors and degrees directly through the graph.
(Since version 1.0) Rather than using Node objects, use graph method directly
An efficient dynamic graph implementation which supports concurrent reading and writing. Locks are only used by writing threads. Nodes are stored in a ConcurrentHashMap. Multi-edges are allowed (multiple copies of an edge may exist in the graph). Node count and edge count are both available.