Papers › Counting Perfect Matchings as Fast as Ryser

Counting Perfect Matchings as Fast as Ryser

22 Jul 2011arXiv:1107.4466links table onlyarchive 2025-07-28

Andreas Björklund

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

We show that there is a polynomial space algorithm that counts the number of perfect matchings in an n-vertex graph in O^*(2^(n/2))⊂O(1.415ⁿ) time. (O^*(f(n)) suppresses functions polylogarithmic in f(n)).The previously fastest algorithms for the problem was the exponential space O^*(((1+√(5))/2)ⁿ) ⊂O(1.619ⁿ) time algorithm by Koivisto, and for polynomial space, the O(1.942ⁿ) time algorithm by Nederlof. Our new algorithm's runtime matches up to polynomial factors that of Ryser's 1963 algorithm for bipartite graphs. We present our algorithm in the more general setting of computing the hafnian over an arbitrary ring, analogously to Ryser's algorithm for permanent computation. We also give a simple argument why the general exact set cover counting problem over a slightly superpolynomial sized family of subsets of an n element ground set cannot be solved in O^*(2^((1-ϵ₁)n)) time for any ϵ₁>0 unless there are O^*(2^((1-ϵ₂)n)) time algorithms for computing an n×n 0/1 matrix permanent, for some ϵ₂>0 depending only on ϵ₁.

PaperPDFCode

Code

sradybites/hafnian mentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections