Parallel Global Edge Switching for the Uniform Sampling of Simple Graphs with Prescribed Degrees

The uniform sampling of simple graphs matching a prescribed degree sequence is an important tool in network science, e.g., to construct graph generators or null-models. Here, the Edge Switching Markov Chain (ES-MC) is a common choice. Given an arbitrary simple graph with the required degree sequence, ES-MC carries out a large number of small changes involving at most four edges to eventually obtain a uniform sample. In practice, reasonably short runs efficiently yield approximate uniform samples. We first engineer a simple sequential ES-MC implementation representing the graph in a hash-set. Despite its simplicity and to the best of our knowledge, our implementation significantly outperforms all openly available solutions. Secondly, we propose the Global Edge Switching Markov Chain (G-ES-MC) and show that it, too, converges to a uniform distribution. We provide empirical evidence that G-ES-MC requires not more switches than ES-MC (and often fewer). Thirdly, we engineer shared-memory parallel algorithms for ES-MC and G-ES-MC; we find that they benefit from the easier dependency structure of the G-ES-MC. In an empirical evaluation, we demonstrate the scalability of our implementations. 2012 ACM Subject Classification Mathematics of computing → Graph theory → Random graphs

[1]  Peter Sanders,et al.  Concurrent hash tables: fast and general?(!) , 2016, PPoPP.

[2]  Sebastiano Vigna,et al.  Axioms for Centrality , 2013, Internet Math..

[3]  Alan M. Frieze,et al.  Random graphs , 2006, SODA '06.

[4]  Pieter Kleer,et al.  Rapid Mixing of the Switch Markov Chain for Strongly Stable Degree Sequences and 2-Class Joint Degree Matrices , 2018, SODA.

[5]  Isabelle Stanton,et al.  Constructing and sampling graphs with a prescribed joint degree distribution , 2011, JEAL.

[6]  Daniel Lemire,et al.  Fast Random Integer Generation in an Interval , 2018, ACM Trans. Model. Comput. Simul..

[7]  R. Milo,et al.  Subgraphs in random networks. , 2003, Physical review. E, Statistical, nonlinear, and soft matter physics.

[8]  Pu Gao,et al.  Uniform Generation of Random Regular Graphs , 2015, 2015 IEEE 56th Annual Symposium on Foundations of Computer Science.

[9]  N. Verhelst An Efficient MCMC Algorithm to Sample Binary Matrices with Fixed Marginals , 2008 .

[10]  Béla Bollobás,et al.  A Probabilistic Proof of an Asymptotic Formula for the Number of Labelled Regular Graphs , 1980, Eur. J. Comb..

[11]  Manuel Penschuck,et al.  I/O-Efficient Generation of Massive Graphs Following the LFR Benchmark , 2016, ALENEX.

[12]  Christian Staudt,et al.  NetworKit: A tool suite for large-scale complex network analysis , 2014, Network Science.

[13]  Christos Gkantsidis,et al.  The Markov Chain Simulation Method for Generating Connected Power Law Random Graphs , 2003, ALENEX.

[14]  Eli Upfal,et al.  Probability and Computing: Randomized Algorithms and Probabilistic Analysis , 2005 .

[15]  Aric Hagberg,et al.  Exploring Network Structure, Dynamics, and Function using NetworkX , 2008, Proceedings of the Python in Science Conference.

[16]  Andrzej Lingas,et al.  On Truly Parallel Time in Population Protocols , 2021, ArXiv.

[17]  István Miklós,et al.  Approximate Counting of Graphical Realizations , 2015, PloS one.

[18]  Giovanni Strona,et al.  A fast and unbiased procedure to randomize ecological binary matrices with fixed row and column totals , 2014, Nature Communications.

[19]  C. J. Carstens TOPOLOGY OF COMPLEX NETWORKS: MODELS AND ANALYSIS , 2017, Bulletin of the Australian Mathematical Society.

[20]  Mark Newman,et al.  Networks: An Introduction , 2010 .

[21]  Ryan A. Rossi,et al.  The Network Data Repository with Interactive Graph Analytics and Visualization , 2015, AAAI.

[22]  Catherine S. Greenhill,et al.  The switch Markov chain for sampling irregular graphs and digraphs , 2017, Theor. Comput. Sci..

[23]  F. Chung,et al.  Connected Components in Random Graphs with Given Expected Degree Sequences , 2002 .

[24]  Pu Gao,et al.  Fast Uniform Generation of Random Graphs with Given Degree Sequences , 2019, 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS).

[25]  Catherine S. Greenhill,et al.  The mixing time of switch Markov chains: A unified approach , 2019, Eur. J. Comb..

[26]  Yung-Pin Chen,et al.  An Application of Markov Chain Monte Carlo to Community Ecology , 2003, Am. Math. Mon..

[27]  Matthieu Latapy,et al.  Fast generation of random connected graphs with prescribed degrees , 2005, ArXiv.

[28]  Jennifer Neville,et al.  Scalable and exact sampling method for probabilistic generative graph models , 2018, Data Mining and Knowledge Discovery.

[29]  Ulrik Brandes,et al.  What is network science? , 2013, Network Science.

[30]  Annabell Berger,et al.  Smaller universes for sampling graphs with fixed degree sequence , 2018 .

[31]  M. Newman,et al.  On the uniform generation of random graphs with prescribed degree sequences , 2003, cond-mat/0312028.

[32]  Peter Sanders,et al.  Random Permutations on Distributed, External and Hierarchical Memory , 1998, Inf. Process. Lett..

[33]  Madhav Marathe,et al.  A parallel algorithm for generating a random graph with a prescribed degree sequence , 2017, 2017 IEEE International Conference on Big Data (Big Data).

[34]  Catherine S. Greenhill,et al.  Mixing time of the switch Markov chain and stable degree sequences , 2020, Discret. Appl. Math..

[35]  Mark Jerrum,et al.  Fast Uniform Generation of Regular Graphs , 1990, Theor. Comput. Sci..

[36]  S. Hakimi On Realizability of a Set of Integers as Degrees of the Vertices of a Linear Graph. I , 1962 .

[37]  Edward A. Bender,et al.  The Asymptotic Number of Labeled Graphs with Given Degree Sequences , 1978, J. Comb. Theory A.

[38]  Brendan D. McKay,et al.  Uniform Generation of Random Regular Graphs of Moderate Degree , 1990, J. Algorithms.

[39]  Ulrich Meyer,et al.  Parallel and I/O-efficient Randomisation of Massive Networks using Global Curveball Trades , 2018, ESA.

[40]  Persi Diaconis,et al.  A Sequential Importance Sampling Algorithm for Generating Random Graphs with Prescribed Degrees , 2011, Internet Math..

[41]  Prasad Tetali,et al.  Simple Markov-chain algorithms for generating bipartite graphs and tournaments , 1997, SODA '97.

[42]  Andrea Lancichinetti,et al.  Benchmarks for testing community detection algorithms on directed and weighted graphs with overlapping communities. , 2009, Physical review. E, Statistical, nonlinear, and soft matter physics.

[43]  Matthieu Latapy,et al.  Efficient and simple generation of random simple connected graphs with prescribed degree sequence , 2005, J. Complex Networks.

[44]  Isabelle Stanton,et al.  Sampling Graphs with a Prescribed Joint Degree Distribution Using Markov Chains , 2011, ALENEX.

[45]  A. Rao,et al.  A Markov chain Monte carol method for generating random (0, 1)-matrices with given marginals , 1996 .

[46]  Martin E. Dyer,et al.  Sampling regular graphs and a peer-to-peer network , 2005, SODA '05.

[47]  Takuji Nishimura,et al.  Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator , 1998, TOMC.

[48]  Ali Pinar,et al.  A stopping criterion for Markov chains when generating independent random graphs , 2012, J. Complex Networks.

[49]  Pu Gao,et al.  Uniform generation of random graphs with power-law degree sequences , 2017, SODA.

[50]  Madhav V. Marathe,et al.  Parallel algorithms for switching edges in heterogeneous graphs , 2017, J. Parallel Distributed Comput..

[51]  Katharina Anna Zweig,et al.  Influence of the null-model on motif detection , 2015, 2015 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM).

[52]  Václav Havel,et al.  Poznámka o existenci konečných grafů , 1955 .

[53]  Priya Mahadevan,et al.  Systematic topology analysis and generation using degree correlations , 2006, SIGCOMM.

[54]  Annabell Berger,et al.  Curveball: a new generation of sampling algorithms for graphs with fixed degree sequence , 2016, ArXiv.

[55]  Ulrik Brandes,et al.  Recent Advances in Scalable Network Generation , 2020, ArXiv.

[56]  Ali Pinar,et al.  Are We There Yet? When to Stop a Markov Chain while Generating Random Graphs , 2012, WAW.