Table of Contents
Fetching ...

Fast exact algorithms via the Matrix Tree Theorem

V. Arvind, Srijan Chakraborty, Samir Datta, Asif Khan

TL;DR

The paper presents a unified, simple framework that leverages the Matrix Tree Theorem and roots-of-unity sieving to design fast exact algorithms for counting Hamiltonian paths and a broad class of subgraph patterns, all within polynomial space. A central recipe constructs a graph H and a matrix C so that determinants encode spanning-tree–based encodings of target patterns, and then uses root-of-ununity substitutions to isolate the desired monomials, optionally aided by the isolation lemma. The method yields near-best-known runtimes for several problems: undirected bipartite Hamiltonian paths in $O^*(2^{n/2})$, directed bipartite Hamiltonian paths in $O^*(3^{n/2})$, and counting of perfect matchings in bipartite graphs in $O^*(2^{n/2})$, among others, with extensions to maximum matchings via the Gallai–Edmonds decomposition and to perfect $k$-star covers and $k$-matchings. All algorithms operate in polynomial space, highlighting the practicality and scalability of the approach. The work unifies and simplifies prior algebraic techniques, offering a versatile framework that can drive further improvements in exact counting and decision problems in graphs.

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 $n$ vertices, i.e., computing the $\{0,1\}$-permanent of a square $n/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 $k$-stars (a $k$-star consist of a tree with a root having $k-1$ children that are all leaves). Interestingly, our running time improves to $O^*((1+ε_k)^n)$ with $ε_k \rightarrow 0$ as $k \rightarrow \infty$. As an aside, making use of Björklund'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^ν)$ where $ν$ 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.

Fast exact algorithms via the Matrix Tree Theorem

TL;DR

The paper presents a unified, simple framework that leverages the Matrix Tree Theorem and roots-of-unity sieving to design fast exact algorithms for counting Hamiltonian paths and a broad class of subgraph patterns, all within polynomial space. A central recipe constructs a graph H and a matrix C so that determinants encode spanning-tree–based encodings of target patterns, and then uses root-of-ununity substitutions to isolate the desired monomials, optionally aided by the isolation lemma. The method yields near-best-known runtimes for several problems: undirected bipartite Hamiltonian paths in , directed bipartite Hamiltonian paths in , and counting of perfect matchings in bipartite graphs in , among others, with extensions to maximum matchings via the Gallai–Edmonds decomposition and to perfect -star covers and -matchings. All algorithms operate in polynomial space, highlighting the practicality and scalability of the approach. The work unifies and simplifies prior algebraic techniques, offering a versatile framework that can drive further improvements in exact counting and decision problems in graphs.

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 vertices, i.e., computing the -permanent of a square 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 -stars (a -star consist of a tree with a root having children that are all leaves). Interestingly, our running time improves to with as . As an aside, making use of Björklund's algorithm for exact counting perfect matchings in general graphs, we show that the count of maximum matchings can be computed in time where 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.

Paper Structure

This paper contains 56 sections, 16 theorems, 57 equations, 3 figures, 1 table.

Key Result

Theorem 2.1

Let $A=(a_{ij})$ be an $m\times n$ matrix, with $1\leq i\leq m$ and $1\leq j\leq n$. Let $B=(b_{ij})$ be an $n\times m$ matrix with $1\leq i \leq n$ and $1\leq j\leq m$. (Thus $AB$ is an $m\times m$ matrix.) If $m > n$, then $\det(AB)=0$. If $m\leq n$, then where $S$ ranges over all $m$-element subsets of $\{1,2,\ldots,n\}$

Figures (3)

  • Figure 1: (a) A bipartite undirected graph $G=(V_1\sqcup V_2,E)$(with extra vertex $t'$ attached to $t$). (b) Square graph of $G$, restricted to $V_1$.
  • Figure 2: Spanning trees of the squared graph from \ref{['fig:BUHamPath']}. (a) A spanning tree that is not Hamiltonian, with weight $x_s x_b x_c x^3_d {x}_{t'}$. (b) A Hamiltonian spanning tree, where all the $V_2$ labels appear on some edge, with weight $x_s x^2_b x^2_c x^2_d {x}_{t'}$. (c) A Hamiltonian spanning tree, with weight $x_s x^2_b x^2_c x^2_d {x}_{t'}$, but in which some $V_2$ labels are not covered.
  • Figure 3: Matchings in a bipartite graph $G=(V_1\sqcup V_2,E)$ on $8$ vertices. (a) A 'good' spanning tree containing a matching (graph edges are thick blue edges). The monomial corresponding to the tree is $y^4x_ax_bx_cx_d$. (b) A 'bad' spanning tree; does not contain any matching. Monomial corresponding to the tree is $y^4x^2_ax_bx_d$.

Theorems & Definitions (29)

  • Theorem 2.1: Cauchy-Binet Theorem Stanley
  • Definition 2.1: Incidence matrix
  • Definition 2.2: In-incidence matrix
  • Theorem 2.2
  • Theorem 2.3
  • Lemma 2.4: Isolation lemma MVV
  • Theorem 3.1: Barvinok
  • Remark 4.1
  • Theorem 5.1: Bjorklund14
  • proof
  • ...and 19 more