Approximate Counting for Spin Systems in Sub-Quadratic Time

Authors Konrad Anand , Weiming Feng , Graham Freifeld, Heng Guo , Jiaheng Wang

Thumbnail PDF


  • Filesize: 0.89 MB
  • 20 pages

Document Identifiers

Author Details

Konrad Anand
  • School of Mathematical Sciences, Queen Mary University of London, London, UK
Weiming Feng
  • Institute for Theoretical Studies, ETH Zürich, Switzerland
Graham Freifeld
  • School of Informatics, University of Edinburgh, UK
Heng Guo
  • School of Informatics, University of Edinburgh, UK
Jiaheng Wang
  • School of Informatics, University of Edinburgh, UK


We would like to thank Chunyang Wang for pointing out how to shave a factor of e from Lemma 24.

Cite AsGet BibTex

Konrad Anand, Weiming Feng, Graham Freifeld, Heng Guo, and Jiaheng Wang. Approximate Counting for Spin Systems in Sub-Quadratic Time. In 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 297, pp. 11:1-11:20, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)


We present two randomised approximate counting algorithms with Õ(n^{2-c}/ε²) running time for some constant c > 0 and accuracy ε: 1) for the hard-core model with fugacity λ on graphs with maximum degree Δ when λ = O(Δ^{-1.5-c₁}) where c₁ = c/(2-2c); 2) for spin systems with strong spatial mixing (SSM) on planar graphs with quadratic growth, such as ℤ². For the hard-core model, Weitz’s algorithm (STOC, 2006) achieves sub-quadratic running time when correlation decays faster than the neighbourhood growth, namely when λ = o(Δ^{-2}). Our first algorithm does not require this property and extends the range where sub-quadratic algorithms exist. Our second algorithm appears to be the first to achieve sub-quadratic running time up to the SSM threshold, albeit on a restricted family of graphs. It also extends to (not necessarily planar) graphs with polynomial growth, such as ℤ^d, but with a running time of the form Õ(n²ε^{-2}/2^{c(log n)^{1/d}}) where d is the exponent of the polynomial growth and c > 0 is some constant.

Subject Classification

ACM Subject Classification
  • Theory of computation → Randomness, geometry and discrete structures
  • Randomised algorithm
  • Approximate counting
  • Spin system
  • Sub-quadratic algorithm


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


  1. Konrad Anand and Mark Jerrum. Perfect sampling in infinite spin systems via strong spatial mixing. SIAM J. Comput., 51(4):1280-1295, 2022. Google Scholar
  2. Nima Anari, Vishesh Jain, Frederic Koehler, Huy Tuan Pham, and Thuy-Duong Vuong. Entropic independence: optimal mixing of down-up random walks. In STOC, pages 1418-1430. ACM, 2022. Google Scholar
  3. Alexander I. Barvinok. Combinatorics and Complexity of Partition Functions, volume 30 of Algorithms and combinatorics. Springer, 2016. Google Scholar
  4. Amartya Shankha Biswas, Ronitt Rubinfeld, and Anak Yodpinyanee. Local access to huge random objects through partial sampling. In ITCS, volume 151 of LIPIcs, pages 27:1-27:65. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. Google Scholar
  5. Clinton Bowen, Stephane Durocher, Maarten Löffler, Anika Rounds, André Schulz, and Csaba D. Tóth. Realization of simply connected polygonal linkages and recognition of unit disk contact trees. In GD, volume 9411 of Lecture Notes in Computer Science, pages 447-459. Springer, 2015. Google Scholar
  6. Jin-Yi Cai and Xi Chen. Complexity of counting CSP with complex weights. J. ACM, 64(3):19:1-19:39, 2017. Google Scholar
  7. Ruoxu Cen, William He, Jason Li, and Debmalya Panigrahi. Beyond the quadratic time barrier for network unreliability. CoRR, 2023. URL:
  8. Xiaoyu Chen, Weiming Feng, Yitong Yin, and Xinyuan Zhang. Optimal mixing for two-state anti-ferromagnetic spin systems. In FOCS, pages 588-599. IEEE, 2022. Google Scholar
  9. Yuansi Chen and Ronen Eldan. Localization schemes: A framework for proving mixing bounds for markov chains (extended abstract). In FOCS, pages 110-122. IEEE, 2022. Google Scholar
  10. Zongchen Chen, Kuikui Liu, and Eric Vigoda. Optimal mixing of Glauber dynamics: Entropy factorization via high-dimensional expansion. In STOC, pages 1537-1550. ACM, 2021. Google Scholar
  11. Timothy Chu, Yu Gao, Richard Peng, Sushant Sachdeva, Saurabh Sawlani, and Junxing Wang. Graph sparsification, spectral sketches, and faster resistance computation, via short cycle decompositions. In FOCS, pages 361-372. IEEE Computer Society, 2018. Google Scholar
  12. Erik D. Demaine and Mohammad Taghi Hajiaghayi. Equivalence of local treewidth and linear local treewidth and its algorithmic applications. In SODA, pages 840-849. SIAM, 2004. Google Scholar
  13. Sally Dong, Yin Tat Lee, and Kent Quanrud. Computing circle packing representations of planar graphs. In SODA, pages 2860-2875. SIAM, 2020. Google Scholar
  14. Peter Eades and Sue Whitesides. The logic engine and the realization problem for nearest neighbor graphs. Theor. Comput. Sci., 169(1):23-37, 1996. Google Scholar
  15. David Eppstein. Diameter and treewidth in minor-closed graph families. Algorithmica, 27(3):275-291, 2000. Google Scholar
  16. Weiming Feng, Heng Guo, Chunyang Wang, Jiaheng Wang, and Yitong Yin. Towards derandomising Markov chain Monte Carlo. In FOCS, pages 1963-1990. IEEE, 2023. Google Scholar
  17. Weiming Feng, Heng Guo, and Yitong Yin. Perfect sampling from spatial mixing. Random Struct. Algorithms, 61(4):678-709, 2022. Google Scholar
  18. Andreas Galanis, Daniel Štefankovič, and Eric Vigoda. Inapproximability for antiferromagnetic spin systems in the tree nonuniqueness region. J. ACM, 62(6):50:1-50:60, 2015. Google Scholar
  19. Andreas Galanis, Daniel Štefankovič, and Eric Vigoda. Inapproximability of the partition function for the antiferromagnetic Ising and hard-core models. Combin. Probab. Comput., 25(4):500-559, 2016. Google Scholar
  20. Heng Guo. Complexity Classification of Exact and Approximate Counting Problems. PhD thesis, University of Wisconsin - Madison, 2015. Google Scholar
  21. Thomas P. Hayes and Alistair Sinclair. A general lower bound for mixing of single-site dynamics on graphs. Ann. Appl. Probab., 17(3):931-952, 2007. Google Scholar
  22. Mark Huber. Approximation algorithms for the normalizing constant of Gibbs distributions. Ann. Appl. Probab., 25(2):974-985, 2015. Google Scholar
  23. Mark Jerrum and Alistair Sinclair. Approximating the permanent. SIAM J. Comput., 18(6):1149-1178, 1989. Google Scholar
  24. Mark Jerrum and Alistair Sinclair. Polynomial-time approximation algorithms for the Ising model. SIAM J. Comput., 22(5):1087-1116, 1993. Google Scholar
  25. Mark Jerrum, Leslie G. Valiant, and Vijay V. Vazirani. Random generation of combinatorial structures from a uniform distribution. Theor. Comput. Sci., 43:169-188, 1986. Google Scholar
  26. Frank Kammer and Torsten Tholey. Approximate tree decompositions of planar graphs in linear time. Theor. Comput. Sci., 645:60-90, 2016. Google Scholar
  27. Vladimir Kolmogorov. A faster approximation algorithm for the Gibbs partition function. In COLT, volume 75 of Proceedings of Machine Learning Research, pages 228-249. PMLR, 2018. Google Scholar
  28. Liang Li, Pinyan Lu, and Yitong Yin. Correlation decay up to uniqueness in spin systems. In SODA, pages 67-84. SIAM, 2013. Full version from arXiv at
  29. Viresh Patel and Guus Regts. Deterministic polynomial-time approximation algorithms for partition functions and graph polynomials. SIAM J. Comput., 46(6):1893-1919, 2017. Google Scholar
  30. Alistair Sinclair, Piyush Srivastava, and Marc Thurley. Approximation algorithms for two-state anti-ferromagnetic spin systems on bounded degree graphs. In SODA, pages 941-953. SIAM, 2012. Google Scholar
  31. Allan Sly and Nike Sun. Counting in two-spin models on d-regular graphs. Ann. Probab., 42(6):2383-2416, 2014. Google Scholar
  32. Daniel Štefankovič, Santosh S. Vempala, and Eric Vigoda. Adaptive simulated annealing: A near-optimal connection between sampling and counting. J. ACM, 56(3):18:1-18:36, 2009. Google Scholar
  33. Leslie G. Valiant. The complexity of computing the permanent. Theor. Comput. Sci., 8:189-201, 1979. Google Scholar
  34. Dror Weitz. Counting independent sets up to the tree threshold. In STOC, pages 140-149. ACM, 2006. Google Scholar
  35. Yitong Yin and Chihao Zhang. Approximate counting via correlation decay on planar graphs. In SODA, pages 47-66. SIAM, 2013. Google Scholar