Abstract
This paper presents a practical fixed-parameter algorithm for #SAT, the computationally daunting task of counting all satisfying truth assignments for a logic formula. By leveraging "incidence treewidth"—a measure of how "tree-like" the connections between variables and clauses are—the authors provide an algorithm that runs in time exponential only to the treewidth but linear to the overall size of the formula.
Introduction
In computer science, determining if a formula can be satisfied (SAT) is famously difficult (NP-complete). Counting how many ways it can be satisfied (#SAT) is even harder—it is #P-complete. This isn't just a theoretical headache; #SAT is a foundational problem for artificial intelligence, probabilistic reasoning, and automated planning.
Because #SAT is so hard in the general case, researchers look for "islands of tractability." They ask: "What structural properties of a formula make counting easy?" Previous research focused on the primal graph (where variables are connected if they appear in the same clause). However, this paper tackles the more general incidence graph, a bipartite graph where both variables and clauses are treated as nodes. The goal is to prove that if this incidence graph has a low "treewidth" (meaning it looks somewhat like a tree), we can solve #SAT efficiently.
Graph Representations and Treewidth
The core of this research lies in the structural hierarchy of formula representations. While primal and dual graphs capture specific relationships, the incidence graph provides a more comprehensive view of the formula's structure.
The authors point out that incidence treewidth ($tw^*$) is a more powerful parameter than primal treewidth ($tw$). Mathematically, $tw^* \leq tw + 1$. This means any formula that is "easy" under primal treewidth is also "easy" under incidence treewidth, but the reverse isn't necessarily true. This confirms that incidence treewidth is a more general and useful parameter for #SAT than primal treewidth, dual treewidth, or branchwidth.
Methodology
The authors employ a technique called Fixed-Parameter Tractability (FPT). The core idea is to isolate the "hardness" of the problem into a single parameter ($k$, the treewidth).
- Tree-Decomposition: They represent the CNF (Conjunctive Normal Form) formula as an incidence graph and use a "nice tree-decomposition." This breaks the complex web of variables and clauses into a tree of "bags," where each bag contains a small subset of variables and clauses.
- Dynamic Programming: The heart of the paper is a bottom-up dynamic programming algorithm. For every node in the tree-decomposition, the algorithm maintains a table tracking the number of ways to partially satisfy the formula based on the variables and clauses currently "visible" in that bag.
- State Tracking: Crucially, the algorithm doesn't just count satisfied clauses; it keeps track of which clauses in the current bag are not yet satisfied, allowing it to resolve them as it moves up the tree.
- Join Nodes: The most complex part is the "join node," where two branches of the tree-decomposition merge. The authors prove a specific lemma showing that you can multiply the counts from two branches and correctly account for overlapping satisfied clauses without double-counting.
Key Results
The paper formally establishes that #SAT is Fixed-Parameter Tractable with respect to incidence treewidth. While previous theoretical results suggested such an algorithm existed, they often involved "galactic algorithms" with constants too large for practical use. This paper provides an explicit algorithm with a manageable runtime of $O(4^k \cdot k \cdot l \cdot N)$, where:
- $k$ is the incidence treewidth.
- $l$ is the size of the largest clause.
- $N$ is the number of nodes in the tree-decomposition (linear relative to the number of variables and clauses).
Limitations and Future Work
While the algorithm is linear in terms of formula size ($N$), it remains exponential in terms of treewidth ($4^k$). If a formula is dense and "un-tree-like," the algorithm remains slow. Additionally, the authors note a sharp boundary in complexity: while #SAT is tractable with incidence treewidth, the more general Boolean Constraint Satisfaction Problem (CSP) is likely not (it is W[1]-hard).
Future work includes testing this dynamic programming approach against modern heuristic-based #SAT solvers, such as those based on component caching or d-DNNF, to evaluate its performance in practical scenarios.
Summary updated