Generating Random Networks Without Short Cycles

Mohsen Bayati, Andrea Montanari, Amin Saberi · DOI

In network science and information theory, generating random graphs that satisfy specific structural constraints is a fundamental challenge. One particularly critical constraint is the absence of short cycles (e.g., triangles or squares), resulting in what are known as "high-girth" graphs. These structures are vital for the design of Low-Density Parity-Check (LDPC) codes; in these contexts, short cycles significantly degrade the performance of decoding algorithms used to transmit data over noisy channels.

However, as the number of edges ($m$) increases relative to the number of vertices ($n$), the probability of a randomly generated graph being cycle-free becomes exponentially small. This makes simple "rejection sampling"—generating a graph and discarding it if it contains a short cycle—computationally infeasible. While existing "greedy" processes can successfully avoid cycles, they typically produce biased distributions that are not truly representative of a uniform distribution. This paper introduces RandGraph, the first polynomial-time algorithm capable of generating random graphs that are both asymptotically uniform and free of short cycles.

The RandGraph Algorithm

RandGraph overcomes the limitations of previous methods by employing a sequential edge-addition strategy. Instead of picking any valid edge uniformly at each step, the algorithm calculates a specific probability $p_{ij}$ for every potential edge $(i, j)$.

The Poisson Approximation

The "secret sauce" of the algorithm lies in how these probabilities are determined. RandGraph uses a Poisson approximation to estimate the "room" available for future edges. Specifically, it calculates the probability of an edge based on the expected number of small cycles that would likely be formed if the remaining edges were added at random. By favoring edges that leave the most flexibility for future steps, the algorithm avoids "painting itself into a corner" where no more edges can be added without violating the girth constraint.

Computational Efficiency

Calculating these look-ahead probabilities for every step could potentially be slow. However, the authors demonstrate that by using sparse matrix multiplication—specifically calculating powers of the adjacency matrix—the algorithm can be implemented efficiently. RandGraph runs in $O(n^2m)$ time in expectation, making it a practical tool for generating graphs with thousands of nodes.

Theoretical Rigor and Insights

The paper provides a complex mathematical proof to ensure that the algorithm remains faithful to a uniform distribution. Using the Janson inequality and Martingale-like arguments, the authors show that the accumulated error from the Poisson approximations remains small.

A major theoretical insight discovered during this analysis is error cancellation. The authors found that while individual approximation steps for edge probabilities might contain small errors, these errors largely cancel each other out when multiplied over the $m$ steps of the algorithm. This ensures that the final output is asymptotically uniform.

Key Results and Empirical Evaluation

The authors evaluated RandGraph using synthetic graph generation, with $n$ ranging from 50 to 400 and $m$ scaled as $n^{1.1}$. The algorithm was benchmarked against the standard Triangle-Free Process to measure "multiplicative bias"—the degree to which the distribution deviates from uniform.

  • Uniformity: For any constant cycle length $k$ and $m = O(n^{1+1/[2k(k+3)]})$, RandGraph generates an asymptotically uniform random graph.
  • Superiority over Heuristics: Empirical tests showed that RandGraph's multiplicative bias was significantly more concentrated around the ideal value of 1 compared to the triangle-free process, which exhibited much higher variance and bias.
  • Reliability: The probability that the algorithm "fails" (becomes unable to add more edges) vanishes as the number of vertices $n$ grows.

Limitations and Future Work

While RandGraph represents a significant step forward, there are areas for further development:

  1. Edge Density Limits: The current theoretical guarantee for uniformity holds for "relatively sparse" graphs. While empirical results suggest the algorithm works for a wider range of densities, the formal proof for higher $m$ values remains an open challenge.
  2. Complex Constraints: The paper notes that the framework can be extended to bipartite graphs and fixed degree sequences—structures directly used in LDPC construction—but the full rigorous analysis for these cases is left for future work.
  3. General Substructures: The current method is optimized specifically for cycles. Adapting this sequential approximation framework to avoid other types of subgraphs, such as cliques or specific motifs, is a promising avenue for future research in network modeling.

Summary updated

BibTeX
@inproceedings{bayati2009generating,
  author = {Mohsen Bayati and Andrea Montanari and Amin Saberi},
  title = {{Generating Random Networks Without Short Cycles}},
  booktitle = {SODA},
  year = {2009},
  doi = {10.1137/1.9781611973068.63},
}
Figure