Faster Subgraph Counting in Sparse Graphs

Author Marco Bressan

Thumbnail PDF


  • Filesize: 0.74 MB
  • 15 pages

Document Identifiers

Author Details

Marco Bressan
  • Department of Computer Science, Sapienza University of Rome, Italy

Cite AsGet BibTex

Marco Bressan. Faster Subgraph Counting in Sparse Graphs. In 14th International Symposium on Parameterized and Exact Computation (IPEC 2019). Leibniz International Proceedings in Informatics (LIPIcs), Volume 148, pp. 6:1-6:15, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2019)


A fundamental graph problem asks to compute the number of induced copies of a k-node pattern graph H in an n-node graph G. The fastest algorithm to date is still the 35-years-old algorithm by Nešetřil and Poljak [Nešetřil and Poljak, 1985], with running time f(k) * O(n^{omega floor[k/3] + 2}) where omega <=2.373 is the matrix multiplication exponent. In this work we show that, if one takes into account the degeneracy d of G, then the picture becomes substantially richer and leads to faster algorithms when G is sufficiently sparse. More precisely, after introducing a novel notion of graph width, the DAG-treewidth, we prove what follows. If H has DAG-treewidth tau(H) and G has degeneracy d, then the induced copies of H in G can be counted in time f(d,k) * O~(n^{tau(H)}); and, under the Exponential Time Hypothesis, no algorithm can solve the problem in time f(d,k) * n^{o(tau(H)/ln tau(H))} for all H. This result characterises the complexity of counting subgraphs in a d-degenerate graph. Developing bounds on tau(H), then, we obtain natural generalisations of classic results and faster algorithms for sparse graphs. For example, when d=O(poly log(n)) we can count the induced copies of any H in time f(k) * O~(n^{floor[k/4] + 2}), beating the Nešetřil-Poljak algorithm by essentially a cubic factor in n.

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Discrete mathematics
  • Theory of computation → Design and analysis of algorithms
  • Theory of computation → Graph algorithms analysis
  • subgraph counting
  • tree decomposition
  • degeneracy


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. N. Alon, P. Dao, I. Hajirasouliha, F. Hormozdiari, and S. C. Sahinalp. Biomolecular network motif counting and discovery by color coding. Bioinformatics, 24(13):i241-249, July 2008. URL:
  2. Noga Alon, Raphael Yuster, and Uri Zwick. Color-coding. J. ACM, 42(4):844-856, 1995. URL:
  3. Andreas Björklund, Petteri Kaski, and Łukasz Kowalik. Counting Thin Subgraphs via Packings Faster Than Meet-in-the-middle Time. In Proc. of ACM-SIAM SODA, pages 594-603, 2014. URL:
  4. Marco Bressan. Faster subgraph counting in sparse graphs. CoRR, abs/1805.02089, 2018. URL:
  5. Marco Bressan, Flavio Chierichetti, Ravi Kumar, Stefano Leucci, and Alessandro Panconesi. Counting Graphlets: space vs. time. In Proc. of ACM WSDM, pages 557-566, 2017. URL:
  6. Marco Bressan, Flavio Chierichetti, Ravi Kumar, Stefano Leucci, and Alessandro Panconesi. Motif Counting Beyond Five Nodes. ACM Transactions on Knowledge Discovery from Data, 20(2):1-25, April 2018. URL:
  7. Marco Bressan, Stefano Leucci, and Alessandro Panconesi. Motivo: fast motif counting via succinct color coding and adaptive sampling. Proc. of the VLDB Endowment, 12(11):1651-1663, July 2019. URL:
  8. Jianer Chen, Benny Chor, Mike Fellows, Xiuzhen Huang, David Juedes, Iyad A. Kanj, and Ge Xia. Tight lower bounds for certain parameterized NP-hard problems. Information and Computation, 201(2):216-231, 2005. URL:
  9. Jianer Chen, Xiuzhen Huang, Iyad A. Kanj, and Ge Xia. Strong computational lower bounds via parameterized complexity. Journal of Computer and System Sciences, 72(8):1346-1367, 2006. URL:
  10. Norishige Chiba and Takao Nishizeki. Arboricity and Subgraph Listing Algorithms. SIAM J. Comput., 14(1):210-223, 1985. URL:
  11. Radu Curticapean and Dániel Marx. Complexity of Counting Subgraphs: Only the Boundedness of the Vertex-Cover Number Counts. In Proc. of IEEE FOCS, pages 130-139, Washington, DC, USA, 2014. IEEE Computer Society. URL:
  12. Reinhard Diestel. Graph Theory. Springer Publishing Company, Incorporated, 5th edition, 2017. URL:
  13. David Eppstein. Arboricity and Bipartite Subgraph Listing Algorithms. Inf. Process. Lett., 51(4):207-211, August 1994. URL:
  14. David Eppstein. Subgraph Isomorphism in Planar Graphs and Related Problems. Journal of Graph Algorithms and Applications, 3(3):1-27, 1999. URL:
  15. David Eppstein, Maarten Löffler, and Darren Strash. Listing All Maximal Cliques in Sparse Graphs in Near-Optimal Time. In Algorithms and Computation, pages 403-414. Springer Berlin Heidelberg, 2010. URL:
  16. David Eppstein and Darren Strash. Listing All Maximal Cliques in Large Sparse Real-World Graphs. In Experimental Algorithms, pages 364-375. Springer Berlin Heidelberg, 2011. URL:
  17. Peter Floderus, Mirosław Kowaluk, Andrzej Lingas, and Eva-Marta Lundell. Detecting and Counting Small Pattern Graphs. SIAM J. Discrete Math., 29(3):1322-1339, 2015. URL:
  18. Fedor V. Fomin and Dieter Kratsch. Exact Exponential Algorithms. Springer-Verlag Berlin Heidelberg, 1 edition, 2010. URL:
  19. Robert Ganian, Petr Hliněný, Joachim Kneis, Daniel Meister, Jan Obdržálek, Peter Rossmanith, and Somnath Sikdar. Are there any good digraph width measures? Journal of Combinatorial Theory, Series B, 116:250-286, January 2016. URL:
  20. Martin Grohe and Dániel Marx. On tree width, bramble size, and expansion. Journal of Combinatorial Theory, Series B, 99(1):218-228, 2009. URL:
  21. Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? In Proc. of IEEE FOCS, pages 653-662, 1998. URL:
  22. Shweta Jain and C. Seshadhri. A Fast and Provable Method for Estimating Clique Counts Using Turán’s Theorem. In Proc. of WWW, pages 441-449, 2017. URL:
  23. Joachim Kneis, Daniel Mölle, Stefan Richter, and Peter Rossmanith. Algorithms Based on the Treewidth of Sparse Graphs. In Graph-Theoretic Concepts in Computer Science, pages 385-396. Springer Berlin Heidelberg, 2005. URL:
  24. Mirosław Kowaluk, Andrzej Lingas, and Eva-Marta Lundell. Counting and Detecting Small Subgraphs via Equations. SIAM Journal on Discrete Mathematics, 27(2):892-909, January 2013. URL:
  25. François Le Gall. Powers of Tensors and Fast Matrix Multiplication. In Proc. of ISSAC, pages 296-303, 2014. URL:
  26. Silviu Maniu, Pierre Senellart, and Suraj Jog. An Experimental Study of the Treewidth of Real-World Graph Data. In Proc. of ICDT, pages 12:1-12:18, 2019. URL:
  27. J. Nešetřil and P.O. de Mendez. Sparsity: Graphs, Structures, and Algorithms. Algorithms and Combinatorics. Springer Berlin Heidelberg, 2012. URL:
  28. Jaroslav Nešetřil and Svatopluk Poljak. On the complexity of the subgraph problem. Commentationes Mathematicae Universitatis Carolinae, 026(2):415-419, 1985. URL:
  29. Viresh Patel and Guus Regts. Computing the Number of Induced Copies of a Fixed Graph in a Bounded Degree Graph. Algorithmica, 81(5):1844-1858, September 2018. URL:
  30. Ali Pinar, C. Seshadhri, and Vaidyanathan Vishal. ESCAPE: Efficiently counting all 5-vertex subgraphs. In Proc. of WWW, pages 1431-1440, 2017. URL:
  31. Ahmet Erdem Sariyüce and Ali Pinar. Peeling Bipartite Networks for Dense Subgraph Discovery. In Proc. of ACM WSDM, pages 504-512, 2018. URL:
  32. Ahmet Erdem Sariyüce, C. Seshadhri, Ali Pinar, and Ümit V. Çatalyürek. Nucleus Decompositions for Identifying Hierarchy of Dense Subgraphs. ACM Trans. Web, 11(3):16:1-16:27, July 2017. URL:
  33. Charalampos E. Tsourakakis, Jakub Pachocki, and Michael Mitzenmacher. Scalable Motif-aware Graph Clustering. In Proc. of WWW, pages 1451-1460, 2017. URL:
  34. Virginia Vassilevska Williams and Ryan Williams. Finding, Minimizing, and Counting Weighted Subgraphs. SIAM J. Comput., 42(3):831-854, 2013. URL:
  35. Hao Yin, Austin R. Benson, Jure Leskovec, and David F. Gleich. Local Higher-Order Graph Clustering. In Proc. of ACM KDD, pages 555-564, 2017. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail