public class IntegerTriplesArcLabelledImmutableGraph extends ArcLabelledImmutableSequentialGraph
ArcLabelledImmutableGraph. The triples are interpreted as labelled arcs: the first element is the source, the second element is the target, and the third element must be a nonnegative integer that will be saved using a
This class is mainly a useful example of how to expose of your data via an
it is also used to build test cases, but it is not efficient or particularly refined.
Nested Class Summary
Fields inherited from class it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableGraph
Constructors Constructor Description
(int triple)Creates a new arc-labelled immutable graph using a specified list of triples.
Modifier and Type Method Description
()Whether the node iterators returned by this graph support
()Returns a node iterator for scanning the graph sequentially, starting from the first node.
()Returns the number of nodes of this graph.
()Returns a prototype of the labels used by this graph.
Methods inherited from class it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableSequentialGraph
copy, labelArray, outdegree, randomAccess, successorArray
Methods inherited from class it.unimi.dsi.webgraph.labelling.ArcLabelledImmutableGraph
equals, load, load, loadOffline, loadOffline, loadOnce, loadSequential, loadSequential, toString
Methods inherited from class it.unimi.dsi.webgraph.ImmutableGraph
basename, hashCode, load, loadMapped, loadMapped, numArcs, outdegrees, splitNodeIterators, store, store
IntegerTriplesArcLabelledImmutableGraphpublic IntegerTriplesArcLabelledImmutableGraph(int triple)Creates a new arc-labelled immutable graph using a specified list of triples.
Note that it is impossible to specify isolated nodes with indices larger than the largest node with positive indegree or outdegree, as the number of nodes is computed by maximising over all indices in
triple- a list of triples specifying labelled arcs (see the class documentation); order is not relevant, but multiple arcs are not allowed.
prototypepublic Label prototype()Description copied from class:
ArcLabelledImmutableGraphReturns a prototype of the labels used by this graph. The prototype can be used to produce new copies, but must not be modified by the caller.
numNodespublic int numNodes()Returns the number of nodes of this graph.
Albeit this method is not optional, it is allowed that this method throws an
UnsupportedOperationExceptionif this graph has never been entirely traversed using a
node iterator. This apparently bizarre behaviour is necessary to support implementations as
ArcListASCIIGraph, which do not know the actual number of nodes until a traversal has been completed.
hasCopiableIteratorspublic boolean hasCopiableIterators()Whether the node iterators returned by this graph support
nodeIteratorpublic ArcLabelledNodeIterator nodeIterator(int from)Description copied from class:
successorspublic ArcLabelledNodeIterator.LabelledArcIterator successors(int from)Description copied from class:
nodeIteratorpublic ArcLabelledNodeIterator nodeIterator()Returns a node iterator for scanning the graph sequentially, starting from the first node.