{'fraction_non_alphanumeric': 0.02080624187256177, 'fraction_numerical': 0.0019505851755526658, 'mean_word_length': 5.333333333333333, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Convergence criteria for sampling random graphs with specified degree sequences

The configuration model is a standard tool for generating random graphs with a specified degree sequence, and is often used as a null model to evaluate how much of an observed network’s structure is explained by its degrees alone. Except for networks with both self-loops and multi-edges, we lack a direct sampling algorithm for the configuration model, e.g., for simple graphs. A Markov chain Monte Carlo (MCMC) algorithm, based on a degree-preserving double-edge swap, provides an asymptotic solution to sample from the configuration model without bias. However, accurately detecting convergence of this Markov chain on its stationary distribution remains an unsolved problem. Here, we provide a concrete solution to detect convergence and sample from the configuration model without bias. We first develop an algorithm for estimating a sufficient gap between sampled MCMC states for them to be effectively independent. Applying this algorithm to a corpus of 509 empirical networks, we derive a set of computationally efficient heuristics, based on scaling laws, for choosing this sampling gap automatically. We then construct a convergence detection method that applies a Kolmogorov–Smirnov test to sequences of network assortativity values derived from the Markov chain’s sampled states. Comparing this test to three generic Markov chain convergence diagnostics, we find that our method is both more accurate and more efficient at detecting convergence.