A Parallel Algorithm for Generating a Random Graph with a Prescribed Degree Sequence

Md Hasanuzzaman Bhuiyan, Maleq Khan, Madhav V. Marathe

Abstract

Random graphs with a given degree sequence are vital for modeling complex real-world systems, capturing characteristics like dependent edges and non-binomial degree distributions. However, generating these graphs efficiently is challenging due to the computational cost of sequential algorithms. This paper presents an OpenMP-based shared-memory parallel algorithm for generating random graphs with a prescribed degree sequence, achieving a speedup of 20.5 with 32 cores. We also introduce the first non-trivial parallel algorithm for checking the Erdős-Gallai characterization, which achieves a speedup of 23 using 32 cores.

Introduction

In network science, generating "null models"—random graphs that preserve specific properties of real-world networks—is a fundamental task. The degree sequence, representing the number of connections for each node, is one of the most critical constraints to maintain. For instance, in a social network, a random version must ensure that a user with 50 friends in reality still has exactly 50 friends in the model.

Generating these graphs without bias or "illegal" structures (like self-loops or multi-edges) is computationally intensive. The Blitzstein-Diaconis algorithm, while statistically robust, is strictly sequential with a complexity of $O(mn^2)$. As datasets scale to millions of nodes, this sequential nature becomes a significant bottleneck.

Methodology

The proposed solution is a shared-memory parallel algorithm implemented using OpenMP. It parallelizes the sequential importance sampling method by Blitzstein and Diaconis.

Parallel Graph Generation

The core of the algorithm involves iteratively adding edges while ensuring the remaining degree sequence remains "graphical"—meaning it can still form a valid graph. The algorithm identifies a candidate list of vertices for each connection and selects from them.

Pseudocode for the parallel random graph generation algorithm.

Key innovations include:

  1. Parallel Erdős-Gallai Check: A novel method to verify graphicality using parallel prefix sums and round-robin distribution.
  2. Durfee Number Optimization: Reducing the number of required inequality checks.
  3. Bulk Edge Assignment: Simultaneously assigning multiple edges when the number of candidates matches the required degree.

The Erdős-Gallai Characterization

To maintain graphicality, the algorithm must satisfy the Erdős-Gallai theorem, which involves checking a series of inequalities.

Example of degree sequences and their corresponding graphicality checks (LHS vs RHS) alongside a sample graph.

As shown in the figure, for a sequence to be graphical, the Left-Hand Side (LHS) of the inequality must be less than or equal to the Right-Hand Side (RHS) for all $i$. The parallel implementation of this check is the primary driver of the overall performance gains.

Experimental Results

The algorithm was evaluated on diverse real-world networks, including Facebook, GooglePlus, and massive datasets like Friendster (65M nodes).

  • Speedup: The graph generation achieved a 20.5x speedup on 32 cores for the Facebook dataset.
  • Erdős-Gallai Performance: The standalone parallel check reached a 23x speedup on 32 cores for the Friendster dataset.
  • Statistical Integrity: Structural analysis confirmed that the parallel algorithm produces graphs with properties nearly identical to traditional sequential methods, preserving the exact stochastic process.

Conclusion

This work provides a scalable solution for generating large-scale random graphs while strictly adhering to prescribed degree sequences. By parallelizing the graphicality check, the researchers have removed a major bottleneck in network simulation. Future research will focus on extending these methods to distributed-memory systems using MPI to handle web-scale graphs with billions of nodes.

Summary updated

BibTeX
@inproceedings{bhuiyan2017parallel,
  author = {Md Hasanuzzaman Bhuiyan and Maleq Khan and Madhav V. Marathe},
  title = {{A Parallel Algorithm for Generating a Random Graph with a Prescribed Degree Sequence}},
  booktitle = {IEEE BigData},
  year = {2017},
  url = {https://openreview.net/forum?id=cy60nC0BBJ},
}
Figure