## 8.8. Generating Graphs

This section describes procedures that can be used to generate example graphs.

Generate undirected (random direction) graphs with semi-real random distributions based on theoretical models.

type | qualified name | signature | description
--- | --- | --- | ---
procedure | `apoc.generate.ba` | `apoc.generate.ba(noNodes :: INTEGER?, edgesPerNode :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID` | apoc.generate.ba(noNodes, edgesPerNode, label, type) - generates a random graph according to the Barabasi-Albert model
procedure | `apoc.generate.complete` | `apoc.generate.complete(noNodes :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID` | apoc.generate.complete(noNodes, label, type) - generates a random complete graph
procedure | `apoc.generate.er` | `apoc.generate.er(noNodes :: INTEGER?, noEdges :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID` | apoc.generate.er(noNodes, noEdges, label, type) - generates a random graph according to the Erdos-Renyi model
procedure | `apoc.generate.simple` | `apoc.generate.simple(degrees :: LIST? OF INTEGER?, label :: STRING?, type :: STRING?) :: VOID` | apoc.generate.simple(degrees, label, type) - generates a simple random graph according to the given degree distribution
procedure | `apoc.generate.ws` | `apoc.generate.ws(noNodes :: INTEGER?, degree :: INTEGER?, beta :: FLOAT?, label :: STRING?, type :: STRING?) :: VOID` | apoc.generate.ws(noNodes, degree, beta, label, type) - generates a random graph according to the Watts-Strogatz model

Example

    CALL apoc.generate.ba(1000, 2, 'TestLabel', 'TEST_REL_TYPE')
    CALL apoc.generate.ws(1000, null, null, null)
    CALL apoc.generate.simple([2,2,2,2], null, null)