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.
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.
Loads the graph data into physical RAM, so later graph operations don't have lag.
Loads the graph data into physical RAM, so later graph operations don't have lag. Makes a "best effort" (see MappedByteBuffer.load()).
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
A graph which reads edge data from a memory mapped file. There is no object overhead per node: the memory used for with both in-neighbor and out-neighbor access is 8 bytes per edge and 8 bytes per node. Loading is very fast because no parsing of text is required. Loading time is exactly the time it takes the operating system to page data from disk into memory. Nodes are numbered sequentially from 0 to nodeCount - 1 and must be a range of this form (i.e. nodeCount == maxNodeId + 1).
Graphs are converted to this format using MemoryMappedDirectedGraphConverter, then loaded using this class. When transforming a graph where nodeCount <= maxNodeId to this format, new nodes with no neighbors will be implicitly created. The binary format is currently subject to change.