Statistics and Computing

, Volume 25, Issue 2, pp 227–242 | Cite as

Uniform random generation of large acyclic digraphs

  • Jack KuipersEmail author
  • Giusi Moffa


Directed acyclic graphs are the basic representation of the structure underlying Bayesian networks, which represent multivariate probability distributions. In many practical applications, such as the reverse engineering of gene regulatory networks, not only the estimation of model parameters but the reconstruction of the structure itself is of great interest. As well as for the assessment of different structure learning algorithms in simulation studies, a uniform sample from the space of directed acyclic graphs is required to evaluate the prevalence of certain structural features. Here we analyse how to sample acyclic digraphs uniformly at random through recursive enumeration, an approach previously thought too computationally involved. Based on complexity considerations, we discuss in particular how the enumeration directly provides an exact method, which avoids the convergence issues of the alternative Markov chain methods and is actually computationally much faster. The limiting behaviour of the distribution of acyclic digraphs then allows us to sample arbitrarily large graphs. Building on the ideas of recursive enumeration based sampling we also introduce a novel hybrid Markov chain with much faster convergence than current alternatives while still being easy to adapt to various restrictions. Finally we discuss how to include such restrictions in the combinatorial enumeration and the new hybrid Markov chain method for efficient uniform sampling of the corresponding graphs.


Random graph generation Acyclic digraphs Recursive enumeration Bayesian networks MCMC 


  1. Alon, I., Rodeh, M.: Finding a minimum circuit in a graph. SIAM J. Comput. 7, 413–423 (1978) CrossRefzbMATHMathSciNetGoogle Scholar
  2. Andersson, S.A., Madigan, D., Perlman, M.D.: A characterization of Markov equivalence classes for acyclic digraphs. Ann. Stat. 25, 505–541 (1997) CrossRefzbMATHMathSciNetGoogle Scholar
  3. Bender, E.A., Robinson, R.W.: The asymptotic number of acyclic digraphs. II. J. Comb. Theory, Ser. B 44, 363–369 (1988) CrossRefzbMATHMathSciNetGoogle Scholar
  4. Bender, E.A., Richmond, L.B., Robinson, R.W., Wormald, N.C.: The asymptotic number of acyclic digraphs. I. Combinatorica 6, 15–22 (1986) CrossRefzbMATHMathSciNetGoogle Scholar
  5. Borboudakis, G., Tsamardinos, I.: Scoring Bayesian networks with informative, causal and associative priors. Preprint (2012). arXiv:1209.6561
  6. Colombo, D., Maathuis, M.H., Kalisch, M., Richardson, T.S.: Learning high-dimensional directed acyclic graphs with latent and selection variables. Ann. Stat. 40, 294–321 (2012) CrossRefzbMATHMathSciNetGoogle Scholar
  7. Daly, R., Shen, Q., Aitken, S.: Learning Bayesian networks: approaches and issues. Knowl. Eng. Rev. 26(2), 99–157 (2011) CrossRefGoogle Scholar
  8. Emmert-Streib, F., Glazko, G.V., Altay, G., de Matos Simoes, R.: Statistical inference and reverse engineering of gene regulatory networks from observational expression data. Front. Genet. 3, 8 (2012) CrossRefGoogle Scholar
  9. Friedman, N., Koller, D.: Being Bayesian about network structure. A Bayesian approach to structure discovery in Bayesian networks. Mach. Learn. 50, 95–125 (2003) CrossRefzbMATHGoogle Scholar
  10. Friedman, N., Linial, M., Nachman, I., Pe’er, D.: Using Bayesian networks to analyze expression data. J. Comput. Biol. 7, 601–620 (2000) CrossRefGoogle Scholar
  11. Gillispie, S.B., Perlman, M.D.: The size distribution for Markov equivalence classes of acyclic digraph models. Artif. Intell. 141, 137–155 (2002) CrossRefzbMATHMathSciNetGoogle Scholar
  12. Grzegorczyk, M., Husmeier, D.: Improving the structure MCMC sampler for Bayesian networks by introducing a new edge reversal move. Mach. Learn. 71, 265–305 (2008) CrossRefGoogle Scholar
  13. Ide, J.S., Cozman, F.G.: Random generation of Bayesian networks. In: Brazilian Symposium on Artificial Intelligence, pp. 366–375 (2002) Google Scholar
  14. Ide, J.S., Cozman, F.G., Ramos, F.T.: Generating random Bayesian networks with constraints on induced width. In: European Conference on Artificial Intelligence, pp. 323–327 (2004) Google Scholar
  15. Jiang, X., Neapolitan, R., Barmada, M.M., Visweswaran, S.: Learning genetic epistasis using Bayesian network scoring criteria. BMC Bioinform. 12, 89 (2011). doi: 10.1186/1471-2105-12-89 CrossRefGoogle Scholar
  16. Kalisch, M., Bühlmann, P.: Estimating high-dimensional directed acyclic graphs with the PC-algorithm. J. Mach. Learn. Res. 8, 613–636 (2007) zbMATHGoogle Scholar
  17. Kalisch, M., Machler, M., Colombo, D., Maathuis, M.H., Buhlmann, P.: Causal inference using graphical models with the R package pcalg. J. Stat. Softw. 47, 1–26 (2012) Google Scholar
  18. Lauritzen, S.L.: Graphical Models. Clarendon, Oxford (1996) Google Scholar
  19. Liskovets, V.: On the number of maximal vertices of a random acyclic digraph. Theory Probab. Appl. 20, 401–409 (1976) CrossRefGoogle Scholar
  20. Madigan, D., York, J.: Bayesian graphical models for discrete data. Int. Stat. Rev. 63, 215–232 (1995) CrossRefzbMATHGoogle Scholar
  21. Madigan, D., Andersson, S.A., Perlman, M.D., Volinsky, C.T.: Bayesian model averaging and model selection for Markov equivalence classes of acyclic digraphs. Commun. Stat., Theory Methods 25, 2493–2519 (1996) CrossRefzbMATHGoogle Scholar
  22. McKay, B.D., Oggier, F.O., Royle, G.F., Sloane, N.J.A., Wanless, I.M., Wilf, H.S.: Acyclic digraphs and eigenvalues of (0, 1)-matrices. J. Integer Seq. 7, 04.3.3 (2004) MathSciNetGoogle Scholar
  23. Melançon, G., Philippe, F.: Generating connected acyclic digraphs uniformly at random. Inf. Process. Lett. 90, 209–213 (2004) CrossRefzbMATHGoogle Scholar
  24. Melançon, G., Dutour, I., Bousquet-Mélou, M.: Random generation of dags for graph drawing. Tech. rep. CWI INS-R 0005 (2000) Google Scholar
  25. Melançon, G., Dutour, I., Bousquet-Mélou, M.: Random generation of directed acyclic graphs. Electron. Notes Discrete Math. 10, 202–207 (2001) CrossRefGoogle Scholar
  26. Neapolitan, R.E.: Learning Bayesian Networks. Prentice Hall, New York (2004) Google Scholar
  27. Peña, J.M.: Approximate counting of graphical models via MCMC. In: Proceedings of the Eleventh International Conference on Artificial Intelligence and Statistics, pp. 352–359 (2007) Google Scholar
  28. Robinson, R.W.: Enumeration of acyclic digraphs. In: Proceedings of the Second Chapel Hill Conference on Combinatorial Mathematics and Its Applications, University of North Carolina, Chapel Hill, pp. 391–399 (1970) Google Scholar
  29. Robinson, R.W.: Counting labeled acyclic digraphs. In: New Directions in the Theory of Graphs, pp. 239–273. Academic Press, New York (1973) Google Scholar
  30. Robinson, R.W.: Counting unlabeled acyclic digraphs. In: Combinatorial Mathematics V. Springer Lecture Notes in Mathematics, vol. 622, pp. 28–43 (1977) CrossRefGoogle Scholar
  31. Scutari, M.: Learning Bayesian networks with the bnlearn R package. J. Stat. Softw. 35, 1–22 (2010) Google Scholar
  32. Sloane, N.J.A.: The on-line encyclopedia of integer sequences (2013).
  33. Stanley, R.P.: Acyclic orientations of graphs. Discrete Math. 5, 171–178 (1973) CrossRefzbMATHMathSciNetGoogle Scholar
  34. Steinsky, B.: Enumeration of labeled chain graphs and labeled essential directed acyclic graphs. Discrete Math. 270, 267–278 (2003) CrossRefzbMATHMathSciNetGoogle Scholar
  35. Steinsky, B.: Asymptotic behaviour of the number of labelled essential acyclic digraphs and labelled chain graphs. Graphs Comb. 20, 399–411 (2004) CrossRefzbMATHMathSciNetGoogle Scholar
  36. Steinsky, B.: Enumeration of labelled essential graphs. Ars Comb. 111, 485–494 (2013) zbMATHMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Institut für Theoretische PhysikUniversität RegensburgRegensburgGermany
  2. 2.Institut für Funktionelle GenomikUniversität RegensburgRegensburgGermany

Personalised recommendations