A Method for Generating Connected Erdos-Renyi Random Graphs
Boris Chinyaev
TL;DR
This paper addresses sampling connected graphs from the sparse Erdős–Rényi model $G(n,p)$ where connectivity conditioning is exponentially unlikely. It introduces an exact sampler that couples the graph exploration process to an inhomogeneous Poisson random walk, generating the exploration tree and then completing the graph by independently sampling the remaining edges with probability $p$, achieving $O(n)$ expected time for $p=c/n$. The method extends to $G(n,M)$ via an acceptance-rejection step on the number of edges, with a parameter tuning based on the target $M$. Empirical results validate distributional correctness, symmetry of vertex degrees, and the predicted degree behavior, and the authors provide open-source code for implementation.
Abstract
We propose a novel exact algorithm for generating connected Erdos-Renyi random graphs $G(n,p)$. The method couples the graph exploration process to an inhomogeneous Poisson random walk, which yields an exact sampler that runs in $O(n)$ time in the sparse regime $p=c/n$. We also show how the method extends to the $G(n,M)$ model via an additional acceptance-rejection step.
