Going Deep and Going Wide: Counting Logic and Homomorphism Indistinguishability over Graphs of Bounded Treedepth and Treewidth

Authors Eva Fluck , Tim Seppelt , Gian Luca Spitzer

Thumbnail PDF


  • Filesize: 0.83 MB
  • 17 pages

Document Identifiers

Author Details

Eva Fluck
  • RWTH Aachen University, Germany
Tim Seppelt
  • RWTH Aachen University, Germany
Gian Luca Spitzer
  • RWTH Aachen University, Germany


We would like to thank Martin Grohe and Daniel Neuen for fruitful discussions.

Cite AsGet BibTex

Eva Fluck, Tim Seppelt, and Gian Luca Spitzer. Going Deep and Going Wide: Counting Logic and Homomorphism Indistinguishability over Graphs of Bounded Treedepth and Treewidth. In 32nd EACSL Annual Conference on Computer Science Logic (CSL 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 288, pp. 27:1-27:17, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)


We study the expressive power of first-order logic with counting quantifiers, especially the k-variable and quantifier-rank-q fragment 𝖢^k_q, using homomorphism indistinguishability. Recently, Dawar, Jakl, and Reggio (2021) proved that two graphs satisfy the same 𝖢^k_q-sentences if and only if they are homomorphism indistinguishable over the class 𝒯^k_q of graphs admitting a k-pebble forest cover of depth q. Their proof builds on the categorical framework of game comonads developed by Abramsky, Dawar, and Wang (2017). We reprove their result using elementary techniques inspired by Dvořák (2010). Using these techniques we also give a characterisation of guarded counting logic. Our main focus, however, is to provide a graph theoretic analysis of the graph class 𝒯^k_q. This allows us to separate 𝒯^k_q from the intersection of the graph class TW_{k-1}, that is graphs of treewidth less or equal k-1, and TD_q, that is graphs of treedepth at most q if q is sufficiently larger than k. We are able to lift this separation to the semantic separation of the respective homomorphism indistinguishability relations. A part of this separation is to prove that the class TD_q is homomorphism distinguishing closed, which was already conjectured by Roberson (2022).

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Graph theory
  • Theory of computation → Finite Model Theory
  • Treewidth
  • treedepth
  • homomorphism indistinguishability
  • counting first-order logic


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


  1. Samson Abramsky, Anuj Dawar, and Pengming Wang. The pebbling comonad in Finite Model Theory. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavík, Iceland, June 20-23, 2017, pages 1-12. IEEE Computer Society, 2017. URL: https://doi.org/10.1109/LICS.2017.8005129.
  2. Samson Abramsky and Dan Marsden. Comonadic Semantics for Guarded Fragments. In Proceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS '21. IEEE Press, 2021. URL: https://doi.org/10.1109/LICS52264.2021.9470594.
  3. Samson Abramsky and Nihil Shah. Relating structure and power: Comonadic semantics for computational resources. Journal of Logic and Computation, 31(6):1390-1428, September 2021. URL: https://doi.org/10.1093/logcom/exab048.
  4. Jin-Yi Cai, Martin Fürer, and Neil Immerman. An optimal lower bound on the number of variables for graph identification. Combinatorica, 12(4):389-410, December 1992. URL: https://doi.org/10.1007/BF01305232.
  5. Anuj Dawar, Tomáš Jakl, and Luca Reggio. Lovász-Type Theorems and Game Comonads. In 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1-13, June 2021. URL: https://doi.org/10.1109/LICS52264.2021.9470609.
  6. Anuj Dawar and David Richerby. The power of counting logics on restricted classes of finite structures. In Jacques Duparc and Thomas A. Henzinger, editors, Computer Science Logic, pages 84-98. Springer Berlin Heidelberg, 2007. URL: https://doi.org/10.1007/978-3-540-74915-8_10.
  7. Holger Dell, Martin Grohe, and Gaurav Rattan. Lovász Meets Weisfeiler and Leman. 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018), pages 40:1-40:14, 2018. URL: https://doi.org/10.4230/LIPICS.ICALP.2018.40.
  8. Zdeněk Dvořák. On recognizing graphs by numbers of homomorphisms. Journal of Graph Theory, 64(4):330-342, August 2010. URL: https://doi.org/10.1002/jgt.20461.
  9. Eva Fluck, Tim Seppelt, and Gian Luca Spitzer. Going Deep and Going Wide: Counting Logic and Homomorphism Indistinguishability over Graphs of Bounded Treedepth and Treewidth, 2023. URL: https://doi.org/10.48550/arXiv.2308.06044.
  10. Martin Fürer. Weisfeiler-Lehman Refinement Requires at Least a Linear Number of Iterations. In Fernando Orejas, Paul G. Spirakis, and Jan van Leeuwen, editors, Automata, Languages and Programming, 28th International Colloquium, ICALP 2001, Crete, Greece, July 8-12, 2001, Proceedings, volume 2076 of Lecture Notes in Computer Science, pages 322-333. Springer, 2001. URL: https://doi.org/10.1007/3-540-48224-5_27.
  11. Archontia C. Giannopoulou, Paul Hunter, and Dimitrios M. Thilikos. LIFO-search: A minendashmax theorem and a searching game for cycle-rank and tree-depth. Discrete Applied Mathematics, 160(15):2089-2097, October 2012. URL: https://doi.org/10.1016/j.dam.2012.03.015.
  12. Georg Gottlob, Nicola Leone, and Francesco Scarcello. Robbers, marshals, and guards: game theoretic and logical characterizations of hypertree width. Journal of Computer and System Sciences, 66(4):775-808, 2003. Special Issue on PODS 2001. URL: https://doi.org/10.1016/S0022-0000(03)00030-8.
  13. Martin Grohe. Counting Bounded Tree Depth Homomorphisms. In Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS '20, pages 507-520, New York, NY, USA, 2020. Association for Computing Machinery. event-place: Saarbrücken, Germany. URL: https://doi.org/10.1145/3373718.3394739.
  14. Martin Grohe. word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings of Structured Data. In Dan Suciu, Yufei Tao, and Zhewei Wei, editors, Proceedings of the 39th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2020, Portland, OR, USA, June 14-19, 2020, pages 1-16. ACM, 2020. URL: https://doi.org/10.1145/3375395.3387641.
  15. Martin Grohe. The Logic of Graph Neural Networks. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021, pages 1-17. IEEE, 2021. URL: https://doi.org/10.1109/LICS52264.2021.9470677.
  16. Martin Grohe, Gaurav Rattan, and Tim Seppelt. Homomorphism Tensors and Linear Equations. In Mikołaj Bojańczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of Leibniz International Proceedings in Informatics (LIPIcs), pages 70:1-70:20, Dagstuhl, Germany, 2022. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. URL: https://doi.org/10.4230/LIPIcs.ICALP.2022.70.
  17. Lauri Hella. Logical Hierarchies in PTIME. Information and Computation, 129(1):1-19, August 1996. URL: https://doi.org/10.1006/inco.1996.0070.
  18. Stephan Kreutzer and Sebastian Ordyniak. Digraph decompositions and monotonicity in digraph searching. Theor. Comput. Sci., 412(35):4688-4703, 2011. URL: https://doi.org/10.1016/j.tcs.2011.05.003.
  19. László Lovász. Operations with structures. Acta Mathematica Academiae Scientiarum Hungarica, 18(3):321-328, September 1967. URL: https://doi.org/10.1007/BF02280291.
  20. Laura Mančinska and David E. Roberson. Quantum isomorphism is equivalent to equality of homomorphism counts from planar graphs. In 2020 IEEE 61st Annual Symposium on Foundations of Computer Science (FOCS), pages 661-672, 2020. URL: https://doi.org/10.1109/FOCS46700.2020.00067.
  21. Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks. AAAI, 33:4602-4609, July 2019. URL: https://doi.org/10.1609/aaai.v33i01.33014602.
  22. Daniel Neuen. Homomorphism-Distinguishing Closedness for Graphs of Bounded Tree-Width, April 2023. URL: https://doi.org/10.48550/arXiv.2304.07011.
  23. Hoang Nguyen and Takanori Maehara. Graph homomorphism convolution. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 7306-7316. PMLR, 13-18 July 2020. URL: https://proceedings.mlr.press/v119/nguyen20c.html.
  24. Roman Rabinovich. Graph complexity measures and monotonicity. PhD thesis, RWTH Aachen University, 2013. URL: https://publications.rwth-aachen.de/record/230227.
  25. Gaurav Rattan and Tim Seppelt. Weisfeiler-Leman and Graph Spectra. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2268-2285. Society for Industrial and Applied Mathematics, 2023. URL: https://doi.org/10.1137/1.9781611977554.ch87.
  26. David E. Roberson. Oddomorphisms and homomorphism indistinguishability over graphs of bounded degree, June 2022. URL: https://doi.org/10.48550/arXiv.2206.10321.
  27. David E. Roberson and Tim Seppelt. Lasserre Hierarchy for Graph Isomorphism and Homomorphism Indistinguishability. In Kousha Etessami, Uriel Feige, and Gabriele Puppis, editors, 50th International Colloquium on Automata, Languages, and Programming (ICALP 2023), volume 261 of Leibniz International Proceedings in Informatics (LIPIcs), pages 101:1-101:18, Dagstuhl, Germany, 2023. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. URL: https://doi.org/10.4230/LIPIcs.ICALP.2023.101.
  28. Tim Seppelt. Logical Equivalences, Homomorphism Indistinguishability, and Forbidden Minors. In Jérôme Leroux, Sylvain Lombardy, and David Peleg, editors, 48th International Symposium on Mathematical Foundations of Computer Science (MFCS 2023), volume 272 of Leibniz International Proceedings in Informatics (LIPIcs), pages 82:1-82:15, Dagstuhl, Germany, 2023. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. URL: https://doi.org/10.4230/LIPIcs.MFCS.2023.82.
  29. Paul D. Seymour and Robin Thomas. Graph Searching and a Min-Max Theorem for Tree-Width. J. Comb. Theory, Ser. B, 58(1):22-33, 1993. URL: https://doi.org/10.1006/jctb.1993.1027.
  30. Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In International Conference on Learning Representations, 2019. URL: https://openreview.net/forum?id=ryGs6iA5Km.