Module generators

Module generators 

Source
Expand description

Graph generation algorithms

This module provides functions for generating various types of graphs:

  • Random graphs (Erdős–Rényi, Barabási–Albert, etc.)
  • Regular graphs (complete, star, path, cycle)
  • Lattice graphs
  • Small-world networks

Functions§

barabasi_albert_graph
Generates a Barabási–Albert preferential attachment graph
complete_graph
Generates a complete graph (clique)
configuration_model
Generates a random graph using the Configuration Model
create_digraph
Create a new empty directed graph
create_graph
Create a new empty undirected graph
cycle_graph
Generates a cycle graph (circular arrangement of nodes)
erdos_renyi_graph
Generates an Erdős–Rényi random graph
forest_graph
Generates a random forest (collection of trees)
grid_2d_graph
Generates a 2D grid/lattice graph
grid_3d_graph
Generates a 3D grid/lattice graph
hexagonal_lattice_graph
Generates a hexagonal lattice graph (honeycomb structure)
path_graph
Generates a path graph (nodes connected in a line)
planted_partition_model
Generates a planted partition model (special case of SBM)
random_spanning_tree
Generates a random spanning tree from an existing graph
simple_configuration_model
Generates a simple random graph using the Configuration Model
star_graph
Generates a star graph with one central node connected to all others
stochastic_block_model
Generates a graph using the Stochastic Block Model (SBM)
tree_graph
Generates a random tree with n nodes
triangular_lattice_graph
Generates a triangular lattice graph
two_community_sbm
Generates a simple stochastic block model with two communities
watts_strogatz_graph
Generates a Watts-Strogatz small-world graph