Zog.Generator (Zog v0.1.0)
View SourceGenerators for creating synthetic and random graphs.
Summary
Functions
Generates a Barabási-Albert scale-free random graph.
Generates an Erdős-Rényi random graph G(n, p).
Generates a 2D Grid / Lattice graph.
Generates a Watts-Strogatz small-world random graph.
Functions
Generates a Barabási-Albert scale-free random graph.
Nodes are labeled from 0 to n-1. Starts with a clique of size m, then adds remaining nodes one by one, connecting them to m existing nodes with probability proportional to their degree.
Options
:kind- Graph kind, either:directedor:undirected(default).
@spec erdos_renyi(non_neg_integer(), float(), keyword()) :: Zog.SoA.t()
Generates an Erdős-Rényi random graph G(n, p).
Nodes are labeled from 0 to n-1. Each potential edge is present with probability p. Uses the linear-time Batagelj-Brandes algorithm for efficient generation of sparse graphs.
Options
:kind- Graph kind, either:directedor:undirected(default).
Generates a 2D Grid / Lattice graph.
Nodes are labeled with tuples {row, col} where 0 <= row < rows and 0 <= col < cols.
Options
:kind- Graph kind, either:directedor:undirected(default).
Generates a Watts-Strogatz small-world random graph.
Starts with a ring lattice of n nodes connected to k nearest neighbors, then rewires each edge with probability beta.
Options
:kind- Graph kind, either:directedor:undirected(default).