An Approximation Algorithm for #k-SAT
We present a simple randomized algorithm that approximates the number of satisfying assignments of Boolean formulas in conjunctive normal form. To the best of our knowledge this is the first algorithm which approximates #k-SAT for any k >= 3 within a running time that is not only non-trivial, but also significantly better than that of the currently fastest exact algorithms for the problem. More precisely, our algorithm is a randomized approximation scheme whose running time depends polynomially on the error tolerance and is mildly exponential in the number n of variables of the input formula. For example, even stipulating sub-exponentially small error tolerance, the number of solutions to 3-CNF input formulas can be approximated in time O(1.5366^n). For 4-CNF input the bound increases to O(1.6155^n). We further show how to obtain upper and lower bounds on the number of solutions to a CNF formula in a controllable way. Relaxing the requirements on the quality of the approximation, on k-CNF input we obtain significantly reduced running times in comparison to the above bounds.
💡 Research Summary
The paper introduces the first non‑trivial randomized approximation scheme for the model‑counting problem #k‑SAT (the number of satisfying assignments of a Boolean formula in conjunctive normal form) that runs substantially faster than the best known exact algorithms. The authors observe that the difficulty of counting depends heavily on whether the input formula has few solutions or many, and they design two complementary sub‑routines that are combined into a single algorithm.
For the “few‑solutions” regime they use a SAT solver as a sub‑routine. Given a bound N on the number of solutions, they build a binary search tree whose leaves correspond to partial assignments that still keep the formula satisfiable. Each node expands a variable by checking both restrictions (x=0 and x=1) with a boosted SAT solver that succeeds with probability at least 3/4. The tree depth is at most n (the number of variables) and the number of leaves is at most N, so the total number of SAT‑solver calls is O(n·N). If the SAT solver runs in time O*(2^{β_k n}) (β_k is the exponent coming from the PPSZ/Hertli analysis), the whole enumeration phase runs in O*(2^{β_k n}·N^{1−β_k}) time. This yields an exact count when the true number of solutions is ≤ N, with success probability at least 3/4.
For the “many‑solutions” regime they employ a classic sampling technique: draw N independent uniform assignments from {0,1}ⁿ, count how many satisfy the formula (X), and output X·2ⁿ/N. By the Chernoff bound, if N = Ω(2ⁿ·ε⁻²·#F⁻¹) then with probability at least 3/4 the output is an e^{ε}‑approximation of #F. This phase therefore costs O*(2ⁿ·ε⁻²·N⁻¹) time.
The overall algorithm first runs the enumeration sub‑routine with a cutoff N that is not known a priori. If the enumeration reports that #F ≤ N, it also returns the exact count; otherwise it is guaranteed that #F > N, and the sampling sub‑routine is invoked. The total running time is the maximum of the two costs: max{2^{β_k n}·N^{1−β_k}, 2ⁿ·ε⁻²·N⁻¹}. Setting log₂N = f·n and balancing the two terms yields f = (1−β_k)/(2−β_k) and a combined running time of O*(2^{(2−β_k)n}·ε⁻²). Substituting the known values β₃≈0.3864 and β₄≈0.4151 gives concrete bounds:
- For #3‑SAT: O(ε⁻²·1.5366ⁿ)
- For #4‑SAT: O(ε⁻²·1.6155ⁿ)
These are markedly faster than the best exact algorithms (O*(1.6423ⁿ) for 3‑SAT and O*(1.9275ⁿ) for 4‑SAT). The paper also presents two auxiliary algorithms:
- A lower‑bound algorithm (Theorem 1.2) that, given a threshold L, decides with probability ≥3/4 whether #F > L, and if #F ≤ L it returns the exact count. It uses the same SAT‑solver enumeration technique.
- An upper‑bound algorithm (Theorem 1.3) based on the Valiant‑Vazirani bisection method, but applied directly to the system of linear equations obtained by adding random GF(2) constraints. For a parameter μ ≤ n it runs in O*(2^{n−μ}) time and outputs a number u such that 2^{u}+3 ≥ #F; if u > μ then 2^{u} is a 16‑approximation.
The authors discuss how the upper‑bound routine can be combined with the lower‑bound one to obtain a 16‑approximation in the same asymptotic time as the main scheme, and how this can be fed into a Markov‑chain based sampler (Jerrum‑Sinclair) to boost the approximation ratio to (1+poly(1/n)) with only polynomial overhead.
In summary, the paper delivers a theoretically sound, practically faster randomized approximation scheme for #k‑SAT, establishes explicit exponential constants for k=3 and k=4, and provides complementary tools for obtaining provable upper and lower bounds. The approach of separating the problem into “few‑solutions” and “many‑solutions” regimes and tailoring algorithms to each regime may inspire similar breakthroughs for other #P‑complete counting problems.
Comments & Academic Discussion
Loading comments...
Leave a Comment