Counting perfect matchings and Hamiltonian cycles faster
arXiv:2309.15422
Abstract
We show that the hafnian of a symmetric matrix of -bit integers (which counts the number of perfect matchings of a -vertex graph) and the number of Hamiltonian cycles of an -vertex directed graph can be computed in time , improving and generalizing an earlier algorithm of Björklund, Kaski, and Williams (Algorithmica 2019) that runs in time . A key tool of our approach is the design of a data structure that supports fast evaluation of high-order derivatives of hafnian and Hamiltonian cycles, which integrates with the new approach on multivariate multipoint evaluation by Bhargava, Ghosh, Guo, Kumar, and Umans (FOCS 2022, JACM 2024).
arXiv comment15 pages, to appear in ICALP 2026