NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Counting good truth assignments of random k-SAT formulae

Andrea Montanari, Devavrat Shah

Introduction

The $k$-satisfiability ($k$-SAT) problem is a foundational challenge in computer science. While determining the satisfiability of a formula is NP-complete, the counting version—#SAT—is even more demanding, falling into the #P-complete complexity class. For random $k$-SAT formulae, where clauses are sampled uniformly, researchers have identified distinct phase transitions as the clause-to-variable ratio ($\alpha$) increases. However, counting "good" assignments—those that violate only a small fraction of clauses—remains computationally difficult because the solution space often becomes fractured, rendering traditional Markov Chain Monte Carlo (MCMC) methods ineffective.

Methodology: Beyond Stochastic Sampling

The authors propose a deterministic, polynomial-time algorithm that shifts away from stochastic sampling in favor of a message-passing approach combined with thermodynamic interpolation.

Belief Propagation and Correlation Decay

The core of the algorithm relies on Belief Propagation (BP). By representing the $k$-SAT formula as a factor graph, BP estimates the marginal probabilities of variables through local message passing.

Factor graph representation of a k-SAT formula showing message passing in Belief Propagation.

While BP is often a heuristic, the authors prove its accuracy for random $k$-SAT by leveraging the "locally tree-like" structure of these graphs. They demonstrate that these systems exhibit spatial correlation decay: the influence of one variable on another far-away variable diminishes exponentially. This property ensures that local computations can reliably capture global properties of the assignment space.

The Interpolation Procedure

To compute the partition function $Z$ (the total number of assignments), the authors avoid direct counting. Instead, they introduce an interpolation method over an "inverse temperature" parameter $\beta$. By analyzing how the expected number of violated clauses evolves as $\beta$ increases—effectively moving from a random assignment to a "good" one—they can integrate these values to determine the total count. This approach bypasses the "self-reducibility" issues that plague standard counting algorithms on random structures.

Key Results and Theoretical Insights

The research provides several rigorous guarantees for the proposed algorithm:

  • Deterministic Approximation: The algorithm approximates the logarithm of the number of good assignments with a relative error bounded by $\epsilon$ in $O(N^4)$ time.
  • Density Thresholds: The method is proven effective for clause densities below a critical threshold $\alpha_u(k) \approx 2k^{-1} \log k$, where the uniqueness of the Gibbs distribution is guaranteed.
  • Thermodynamic Limit: The authors rigorously establish that the limit $\frac{1}{N} \log Z_N(\beta, F)$ exists with probability 1, validating predictions previously made via the "replica method" in statistical physics.

Limitations and Future Directions

Despite its success, the algorithm faces constraints. It operates below the uniqueness threshold; as the density approaches the actual satisfiability threshold ($\alpha \approx 2^k \ln 2$), the solution space clusters, and correlation decay breaks down. Furthermore, while the algorithm handles "good" assignments (violating at most $N\epsilon$ clauses), extending it to strictly satisfying assignments (zero violations) remains a challenge due to the potential for "frozen" variables in the high-density regime.

Reference: Montanari, A., & Shah, D. (2006). Counting good truth assignments of random k-SAT formulae. arXiv:cs/0607073.

Summary updated

BibTeX
@inproceedings{montanari2007counting,
  author = {Andrea Montanari and Devavrat Shah},
  title = {{Counting good truth assignments of random k-SAT formulae}},
  booktitle = {SODA},
  year = {2007},
}
Figure