- Open Access
Unbiased randomization of weighted bipartite networks with exact degree and strength sequences
Phys. Rev. E 114, 014312 – Published 27 July, 2026
DOI: https://doi.org/10.1103/rn1f-zsgb
Abstract
In the context of complex networks, designing a null model that preserves certain properties of the original network is a fundamental problem. While for binary bipartite networks, the problem has been solved by the curveball algorithm, which preserves the degree of each node exactly, for weighted bipartite networks, finding a null model that strictly preserves some features of the original network is still an open challenge. In this work, we present a microcanonical algorithm that preserves exactly the degree and the strength of each node in a weighted bipartite network. The algorithm is based on an edge-swap procedure that combines three different moves: weight shuffling, simple edge swap, and bridge edge swap. The algorithm has been built to guarantee that the underlying transition matrix of the Monte Carlo Markov chain (MCMC) is symmetric, which is a crucial property to obtain an unbiased sample of random graphs. We validate our algorithm empirically, showing through a χ-square test that for small graphs, the algorithm produces an unbiased sample of graphs. Finally, we also provide a heuristic method to estimate the mixing time of the MCMC.
Physics Subject Headings (PhySH)
Article Text
References (28)
- J. Park and M. E. J. Newman, Statistical mechanics of networks, Phys. Rev. E 70, 066117 (2004).
- G. Cimini, T. Squartini, F. Saracco, D. Garlaschelli, A. Gabrielli, and G. Caldarelli, The statistical physics of real-world networks, Nat. Rev. Phys. 1, 58 (2019).
- S. Maslov and K. Sneppen, Specificity and stability in topology of protein networks, Science 296, 910 (2002).
- G. Strona, D. Nappo, F. Boccacci, S. Fattorini, and J. San-Miguel-Ayanz, A fast and unbiased procedure to randomize ecological binary matrices with fixed row and column totals, Nat. Commun. 5, 4114 (2014).
- K. Godard and Z. P. Neal, Fastball: A fast algorithm to randomly sample bipartite graphs with fixed degree sequences, J. Complex Networks 10, cnac049 (2022).
- T. Opsahl, V. Colizza, P. Panzarasa, and J. J. Ramasco, Prominence and control: The weighted rich-club effect, Phys. Rev. Lett. 101, 168702 (2008).
- G. Ansmann and K. Lehnertz, Constrained randomization of weighted networks, Phys. Rev. E 84, 026103 (2011).
- V. Zlatic, G. Bianconi, A. Díaz-Guilera, D. Garlaschelli, F. Rao, and G. Caldarelli, On the rich-club effect in dense and weighted networks, Eur. Phys. J. B 67, 271 (2009).
- R. Mastrandrea, T. Squartini, G. Fagiolo, and D. Garlaschelli, Enhanced reconstruction of weighted networks from strengths and degrees, New J. Phys. 16, 043022 (2014).
- R. Marcaccioli and G. Livan, A Pólya urn approach to information filtering in complex networks, Nat. Commun. 10, 745 (2019).
- https://github.com/Glaviano/biwes.
- P. Diaconis and B. Sturmfels, Algebraic algorithms for sampling from conditional distributions, Ann. Stat. 26, 363 (1998).
- C. J. Carstens and K. J. Horadam, Switching edges to randomize networks: What goes wrong and how to fix it, J. Complex Networks 5, 337 (2017).
- A. Papoulis, Random Variables and Stochastic Processes (McGraw Hill, New York, NY, 1965).
- D. A. Levin and Y. Peres, Markov Chains and Mixing Times (American Mathematical Society, Providence, RI, 2017), Vol. 107.
- B. Walsh, Markov chain Monte Carlo and Gibbs sampling, Lecture Notes EEB 581, 3 (2004).
- M. Jha, C. Seshadhri, and A. Pinar, Path sampling: A fast and provable method for estimating 4-vertex subgraph counts, in Proceedings of the 24th International Conference on World Wide Web (Association for Computing Machinery, New York, 2015), pp. 495–505.
- L. Tabourier, C. Roth, and J.-P. Cointet, Generating constrained random graphs using multiple edge switches, J. Exp. Algorithmics 16, 1 (2011).
- R. Milo, N. Kashtan, S. Itzkovitz, M. E. J. Newman, and U. Alon, On the uniform generation of random graphs with prescribed degree sequences, arXiv:cond-mat/0312028.
- Z. P. Neal, A stopping rule for randomly sampling bipartite networks with fixed degree sequences, Social Networks 80, 59 (2025).
- W. A. Link and M. J. Eaton, On thinning of chains in MCMC, Methods Ecol. Evol. 3, 112 (2012).
- https://icon.colorado.edu/networks.
- D. W. Inouye and G. H. Pyke, Pollination biology in the Snowy Mountains of Australia: Comparisons with montane Colorado, USA, Aust. J. Ecol. 13, 191 (1988).
- M. Kato, T. Kakutani, T. Inoue, and T. Itino, Insect-flower relationship in the primary beech forest of Ashu, Kyoto: An overview of the flowering phenology and the seasonal pattern of insect visits, Contrib. Biol. Lab. Kyoto Univ. 27, 309 (1990).
- A. F. Motten, Pollination ecology of the spring wildflower community of a temperate deciduous forest, Ecol. Monogr. 56, 21 (1986).
- M. Schleuning, N. Blüthgen, M. Flörchinger, J. Braun, H. M. Schaefer, and K. Böhning-Gaese, Specialization and interaction strength in a tropical plant—Frugivore network differ among forest strata, Ecology 92, 26 (2011).
- M. J. Barber, Modularity and community detection in bipartite networks, Phys. Rev. E 76, 066102 (2007).
- S. K. Lam, A. Pitrou, and S. Seibert, Numba: A LLVM-based Python JIT compiler, in Proceedings of the 2nd Workshop on the LLVM Compiler Infrastructure in HPC (Association for Computing Machinery, New York, 2015), pp. 1–6.