Skip to main content
Log in

A Sequential Algorithm for Generating Random Graphs

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

We present a nearly-linear time algorithm for counting and randomly generating simple graphs with a given degree sequence in a certain range. For degree sequence (d i ) ni=1 with maximum degree d max =O(m 1/4−τ), our algorithm generates almost uniform random graphs with that degree sequence in time O(md max ) where \(m=\frac{1}{2}\sum_{i}d_{i}\) is the number of edges in the graph and τ is any positive constant. The fastest known algorithm for uniform generation of these graphs (McKay and Wormald in J. Algorithms 11(1):52–67, 1990) has a running time of O(m 2 d 2max  ). Our method also gives an independent proof of McKay’s estimate (McKay in Ars Combinatoria A 19:15–25, 1985) for the number of such graphs.

We also use sequential importance sampling to derive fully Polynomial-time Randomized Approximation Schemes (FPRAS) for counting and uniformly generating random graphs for the same range of d max =O(m 1/4−τ).

Moreover, we show that for d=O(n 1/2−τ), our algorithm can generate an asymptotically uniform d-regular graph. Our results improve the previous bound of d=O(n 1/3−τ) due to Kim and Vu (Adv. Math. 188:444–469, 2004) for regular graphs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Alderson, D., Doyle, J., Willinger, W.: Toward and optimization-driven framework for designing and generating realistic Internet topologies. HotNets (2002)

  2. Alon, N., Spencer, J.: The Probabilistic Method. Wiley, New York (1992)

    MATH  Google Scholar 

  3. Amraoui, A., Montanari, A., Urbanke, R.: How to find good finite-length codes: from art towards science. Preprint, cs.IT/0607064 (2006)

  4. Bassetti, F., Diaconis, P.: Examples comparing importance sampling and the Metropolis algorithm (2005)

  5. Bayati, M., Montanari, A., Saberi, A.: Generating random graphs with large girth. In: ACM-SIAM Symposium on Discrete Algorithms (SODA) (2009)

  6. Bender, E.A., Canfield, E.R.: The asymptotic number of labeled graphs with given degree sequence. J. Comb. Theory Ser. A 24(3), 296–307 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  7. Bezáková, I., Bhatnagar, N., Vigoda, E.: Sampling binary contingency tables with a greedy start. In: Symposium on Discrete Algorithms (SODA) (2006)

  8. Bezáková, I., Sinclair, A., S̆tefankovič, D., Vigoda, E.: Negative examples for sequential importance sampling of binary contingency tables. In: Proceedings of Annual European Symposium, vol. 14. Lecture Notes in Computer Science, vol. 4168, pp. 136–147. Springer, Berlin (2006)

    Google Scholar 

  9. Blanchet, J.: Efficient importance sampling for binary contingency tables. Ann. Appl. Probab. 19(3), 949–982 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  10. Blitzstein, J., Diaconis, P.: A sequential importance sampling algorithm for generating random graphs with prescribed degrees. Ann. Appl. Probab. (2005, submitted)

  11. Bollobás, B.: A probabilistic proof of an asymptotic formula for the number of labelled regular graphs. Eur. J. Comb. 1(4), 311–316 (1980)

    MATH  Google Scholar 

  12. Bu, T., Towsley, D.: On distinguishing between Internet power law topology generator. In: INFOCOM (2002)

  13. Chen, Y., Diaconis, P., Holmes, S., Liu, J.S.: Sequential Monte Carlo methods for statistical analysis of tables. J. Am. Stat. Assoc. 100, 109–120 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  14. Chung, F., Lu, L.: Connected components in random graphs with given expected degree sequence. Ann. Comb. 6(2), 125–145 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  15. Cooper, C., Dyer, M., Greenhill, C.: Sampling regular graphs and peer-to-peer network. Comb. Probab. Comput. 16 (2007)

  16. Diaconis, P., Gangolli, A.: Rectangular arrays with fixed margins. In: Discrete Probability and Algorithms, Minneapolis, MN, 1993. IMA Volumes in Mathematics and Its Applications, vol. 72, pp. 15–41. Springer, New York (1995)

    Google Scholar 

  17. Faloutsos, M., Faloutsos, P., Faloutsos, C.: On power-law relationships of the Internet topology. In: SIGCOM (1999)

  18. Gkantsidis, C., Mihail, M., Zegura, E.: The Markov chain simulation method for generating connected power law random graphs. Alenex (2003)

  19. Jerrum, M., Sinclair, A.: Approximate counting, uniform generation and rapidly mixing Markov chains. Inf. Comput. 82(1), 93–133 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  20. Jerrum, M., Sinclair, A.: Fast uniform generation of regular graphs. Theor. Comput. Sci. 73(1), 91–100 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  21. Jerrum, M., Valiant, L., Vazirani, V.: Random generation of combinatorial structures from a uniform distribution. Theor. Comput. Sci. 43, 169–188 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  22. Jerrum, M., Sinclair, A., McKay, B.: When is a graphical sequence stable? In: Random Graphs, Poznań, 1989, vol. 2, pp. 101–115. Wiley-Interscience, New York (1992)

    Google Scholar 

  23. Kannan, R., Tetali, P., Vempala, S.: Simple Markov chain algorithms for generating bipartite graphs and tournaments. Random Struct. Algorithms 14, 293–308 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  24. Kim, J.H.: On Brooks’ theorem for sparse graphs. Comb. Probab. Comput. 4, 97–132 (1995)

    Article  MATH  Google Scholar 

  25. Kim, J.H., Vu, V.H.: Concentration of multivariate polynomials and its applications. Combinatorica 20(3), 417–434 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  26. Kim, J.H., Vu, V.H.: Generating random regular graphs. In: STOC 2003, pp. 213–222

  27. Kim, J.H., Vu, V.: Sandwiching random graphs. Adv. Math. 188, 444–469 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  28. Knuth, D.: Mathematics and computer science: coping with finiteness. Science 194(4271), 1235–1242 (1976)

    Article  MathSciNet  Google Scholar 

  29. McKay, B.: Asymptotics for symmetric 0-1 matrices with prescribed row sums. Ars Combinatoria A 19, 15–25 (1985)

    MathSciNet  Google Scholar 

  30. McKay, B., Wormald, N.C.: Uniform generation of random regular graphs of moderate degree. J. Algorithms 11(1), 52–67 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  31. McKay, B., Wormald, N.C.: Asymptotic enumeration by degree sequence of graphs with degrees o(n 1/2). Combinatorica 11(4), 369–382 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  32. Medina, A., Matta, I., Byers, J.: On the origin of power laws in Internet topologies. ACM Comput. Commun. Rev. 30(2), 18–28 (2000)

    Article  Google Scholar 

  33. Milo, R., ShenOrr, S., Itzkovitz, S., Kashtan, N., Chklovskii, D., Alon, U.: Network motifs: simple building blocks of complex networks. Science 298, 824–827 (2002)

    Article  Google Scholar 

  34. Milo, R., Kashtan, N., Itzkovitz, S., Newman, M., Alon, U.: On the uniform generation of random graphs with prescribed degree sequences. http://arxiv.org/PS_cache/cond-mat/pdf/0312/0312028.pdf (2004)

  35. Molloy, M., Reed, B.: A critical point for random graphs with a given degree sequence. Random Struct. Algorithms 6(2–3), 161–179 (1995)

    MATH  MathSciNet  Google Scholar 

  36. Sinclair, A.: Personal communication (2006)

  37. Steger, A., Wormald, N.C.: Generating random regular graphs quickly. Comb. Probab. Comput. 8(4), 377–396 (1997) (English summary in Random Graphs and Combinatorial Structures, Oberwolfach)

    Article  MathSciNet  Google Scholar 

  38. Tangmunarunkit, H., Govindan, R., Jamin, S., Shenker, S., Willinger, W.: Network topology generators: degree based vs. structural. In: ACM SIGCOM (2002)

  39. Vu, V.H.: Concentration of non-Lipschitz functions and applications, Probabilistic methods in combinatorial optimization. Random Struct. Algorithms 20(3), 267–316 (2002)

    Article  MathSciNet  Google Scholar 

  40. Wormald, N.C.: Models of random regular graphs. In: Surveys in Combinatorics. Canterbury. London Mathematical Society Lecture Note Series, vol. 265, pp. 239–298. Cambridge University Press, Cambridge (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jeong Han Kim.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bayati, M., Kim, J.H. & Saberi, A. A Sequential Algorithm for Generating Random Graphs. Algorithmica 58, 860–910 (2010). https://doi.org/10.1007/s00453-009-9340-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-009-9340-1

Keywords

Navigation