Gelly provides a collection of scalable graph generators. Each generator is
parallelizable, in order to create large datasets
scale-free, generating the same graph regardless of parallelism
thrifty, using as few operators as possible
Graph generators are configured using the builder pattern. The parallelism of generator
operators can be set explicitly by calling setParallelism(parallelism). Lowering the
parallelism will reduce the allocation of memory and network buffers.
Graph-specific configuration must be called first, then configuration common to all
generators, and lastly the call to generate(). The following example configures a
grid graph with two dimensions, configures the parallelism, and generates the graph.
Complete Graph
An undirected graph connecting every distinct pair of vertices.
Cycle Graph
An undirected graph where all edges form a single cycle.
Empty Graph
The graph containing no edges.
Grid Graph
An undirected graph connecting vertices in a regular tiling in one or more dimensions.
Each dimension is configured separately. When the dimension size is at least three the
endpoints are optionally connected by setting wrapEndpoints. Changing the following
example to addDimension(4, true) would connect 0 to 3 and 4 to 7.
Hypercube Graph
An undirected graph where edges form an n-dimensional hypercube. Each vertex
in a hypercube connects to one other vertex in each dimension.
Path Graph
An undirected Graph where all edges form a single path.
RMat is a stochastic generator configured with a source of randomness implementing the
RandomGenerableFactory interface. Provided implementations are JDKRandomGeneratorFactory
and MersenneTwisterFactory. These generate an initial sequence of random values which are
then used as seeds for generating the edges.
The default RMat contants can be overridden as shown in the following example.
The contants define the interdependence of bits from each generated edge’s source
and target labels. The RMat noise can be enabled and progressively perturbs the
contants while generating each edge.
The RMat generator can be configured to produce a simple graph by removing self-loops
and duplicate edges. Symmetrization is performed either by a “clip-and-flip” throwing away
the half matrix above the diagonal or a full “flip” preserving and mirroring all edges.
Singleton Edge Graph
An undirected graph containing isolated two-paths.
Star Graph
An undirected graph containing a single central vertex connected to all other leaf vertices.