English

Fast exact algorithms via the Matrix Tree Theorem

Data Structures and Algorithms 2025-12-10 v1

Abstract

Fast exact algorithms are known for Hamiltonian paths in undirected and directed bipartite graphs through elegant though involved algorithms that are quite different from each other. We devise algorithms that are simple and similar to each other while having the same upper bounds. The common features of these algorithms is the use of the Matrix-Tree theorem and sieving using roots of unity. Next, we use the framework to provide alternative algorithms to count perfect matchings in bipartite graphs on nn vertices, i.e., computing the {0,1}\{0,1\}-permanent of a square n/2×n/2n/2 \times n/2 matrix which runs in a time similar to Ryser. We demonstrate the flexibility of our method by counting the number of ways to vertex partition the graph into kk-stars (a kk-star consist of a tree with a root having k1k-1 children that are all leaves). Interestingly, our running time improves to O((1+ϵk)n)O^*((1+\epsilon_k)^n) with ϵk0\epsilon_k \rightarrow 0 as kk \rightarrow \infty. As an aside, making use of Bj\"orklund's algorithm for exact counting perfect matchings in general graphs, we show that the count of maximum matchings can be computed in time O(2ν)O^*(2^\nu) where ν\nu is the size of a maximum matching. The crucial ingredient here is the famous Gallai-Edmonds decomposition theorem. All our algorithms run in polynomial space.

Keywords

Cite

@article{arxiv.2512.08600,
  title  = {Fast exact algorithms via the Matrix Tree Theorem},
  author = {V. Arvind and Srijan Chakraborty and Samir Datta and Asif Khan},
  journal= {arXiv preprint arXiv:2512.08600},
  year   = {2025}
}
R2 v1 2026-07-01T08:16:59.630Z