Approximating the Permanent with Deep Rejection Sampling

Juha Harviainen, Antti Röyskö, Mikko Koivisto

Introduction

In linear algebra, the permanent of a matrix looks deceptively similar to the determinant. However, while the determinant is easy to compute in polynomial time, computing the permanent is notoriously #P-hard. This makes it a computational bottleneck despite its critical importance in fields like multi-target tracking, communication theory, and counting perfect matchings in graphs.

Because exact calculation is infeasible for large matrices, researchers rely on Randomized Approximation Schemes. A popular approach is rejection sampling: an algorithm picks a random permutation, checks its "weight," and accepts or rejects it based on a calculated upper bound. The efficiency of this method depends entirely on how "tight" that upper bound is. If the bound is much larger than the actual permanent, the algorithm will spend nearly all its time rejecting samples. The core challenge is finding a bound that is both tight and computationally cheap to evaluate.

To address this, researchers have introduced DeepAR (Deep Acceptance-Rejection), a method that significantly speeds up the approximation of the matrix permanent. By using dynamic programming to look "deeper" into the recursion tree of a matrix, the algorithm generates tighter upper bounds, leading to orders-of-magnitude faster sampling compared to previous state-of-the-art methods.

Methods: Deep Rejection Sampling

The paper builds on a technique called self-reducible rejection sampling. Traditionally, these algorithms use a "depth-zero" upper bound at the very start of the recursion.

The authors propose Deep Rejection Sampling (DeepAR). Instead of using a single global upper bound, they replace it with a linear combination of bounds from sub-problems at a specific depth $d$ in the recursion tree.

Comparison of basic (depth-zero) and deep (depth-$d$) rejection sampling paths.
  • The "Deep" Strategy: By looking $d$ steps ahead, the algorithm effectively "pre-tightens" the bound.
  • The Computational Trick: Summing up all possible sub-bounds at depth $d$ would normally take $O(n^d)$ time, which is completely impractical. However, the authors leverage a clever dynamic programming (DP) algorithm—originally designed for rectangular matrices—to compute these "deep" bounds in just $O(2^d dn)$ time.
  • Feasibility: This optimization allows them to use a depth of $d \approx 20$. This depth is small enough for the DP to run quickly, but deep enough to drastically increase the acceptance rate of the sampler.

Datasets and Evaluation

The authors evaluated DeepAR on both synthetic and real-world benchmarks to test its robustness:

  1. Random Matrices: Including Uniform (entries independently drawn from $[0, 1]$), Bernoulli($p$) ($(0, 1)$-matrices where each entry is 1 with probability $p$), and Block Diagonal matrices.
  2. Benchmark Instances: Five real-world instances from the Network Repository (e.g., ENZYMES, cage5, bcspwr01), as well as Staircase Matrices. Staircase matrices are a specific class of $(0, 1)$-matrices known to have a very high ratio between the upper bound and the actual permanent, making them an excellent "stress test" for these algorithms.

Key Insights and Results

DeepAR operates on a precomputation trade-off: it trades a bit of upfront computation (the $O(2^d)$ DP step) for a massive reduction in the number of rejected samples. For hard matrices, this trade-off is incredibly lucrative.

  • Massive Speedups: On the notoriously difficult "Staircase" matrices, DeepAR achieved speedups of several orders of magnitude compared to the previous state-of-the-art method (AdaPart). For many benchmark instances, DeepAR reduced the expected running time from over $10^4$ seconds to just a few seconds or minutes.
  • Superiority in Sparsity: The authors prove that for random $(0, 1)$-matrices with density $p < 1/5$, their method provides a theoretical time complexity bound superior to previous results. They established that an $(\epsilon, \delta)$-approximation for a random matrix in $\mathcal{B}(n, p)$ can be computed in expected time $O(n^{1.5 + \alpha/p})$, which is currently the fastest practical bound for this class.
  • Trustworthy Estimation: Unlike some determinant-based estimators that might fail silently on certain inputs, rejection sampling is "trustworthy"—it provides high-confidence error bounds that are easier to mathematically verify.
  • Nesting Matters: For rejection sampling to work, the bounds must "nest" (a technical monotonicity property). The paper provides a counterexample showing that the popular Brouwer–Schrijver bound doesn't always nest under dynamic partitioning, highlighting the need for the careful algorithm design implemented in DeepAR.

Limitations and Future Work

While DeepAR represents a significant leap forward, a few open challenges remain. The depth $d$ is currently a user-specified parameter; developing an automatic way to select the optimal $d$ for a specific matrix would be a valuable improvement. Additionally, while "Sinkhorn balancing" (a preprocessing step to make the matrix nearly doubly stochastic) helps on many instances, it actually hurt performance on Bernoulli matrices. Knowing precisely when to apply which preprocessing remains an open question.

Finally, while the empirical results for $d=20$ are exceptionally strong, the theoretical analysis focuses mostly on the $d=0$ case. Proving tighter theoretical bounds that explicitly account for the depth $d$ is a primary goal for future research.

Summary updated

BibTeX
@inproceedings{harviainen2021approximating,
  author = {Juha Harviainen and Antti Röyskö and Mikko Koivisto},
  title = {{Approximating the Permanent with Deep Rejection Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=mgkxmKYW62},
}
Figure