Abstract
Uniformly sampling solutions from complex combinatorial spaces defined by hard constraints is a fundamental challenge in artificial intelligence, essential for tasks like probabilistic reasoning and model counting. Traditional Markov Chain Monte Carlo (MCMC) methods often struggle with "energy barriers"—regions of invalid assignments that isolate solution clusters—leading to biased samples or exponential convergence times. We present SearchTreeSampler, an algorithm that leverages systematic constraint solvers (e.g., MiniSAT) as oracles to perform level-by-level exploration of the search tree. By reasoning through constraints rather than performing local moves, SearchTreeSampler achieves near-uniformity and significantly outperforms existing samplers in both speed and accuracy on structured problems.
Introduction
In many AI domains, such as Markov Logic Networks or hardware verification, the goal is not merely to find a single satisfying assignment but to sample uniformly from the entire set of solutions. When a problem is defined by "hard" logical constraints, the solution space often resembles a series of isolated islands in a vast ocean of non-solutions.
Standard MCMC methods, including Simulated Annealing (SA) and Gibbs Sampling, navigate this space by flipping individual variables. However, these local moves are often insufficient to cross the "high-energy" regions (invalid assignments) separating solution clusters. Consequently, the sampler may become trapped in a single region, failing to explore the full distribution. This lack of ergodicity leads to biased results that can undermine downstream probabilistic estimates.
The SearchTreeSampler Algorithm
To overcome these barriers, the researchers at Cornell proposed SearchTreeSampler. Instead of a random walk through the space of full assignments, the algorithm performs a systematic, level-by-level exploration of the search tree.
Mechanism
The core idea is to treat a complete SAT solver as a high-powered oracle. The algorithm proceeds as follows:
- Pseudosolutions: It defines a "pseudosolution" as a partial variable assignment that is guaranteed to be completable to at least one full solution.
- Recursive Level-by-Level Sampling: Starting from an empty assignment at the root, the algorithm moves down the tree. At each level $i$, it maintains a set of $k$ sampled pseudosolutions.
- Oracle-Driven Expansion: For each sampled pseudosolution, the algorithm uses the SAT solver to exhaustively enumerate its descendants at a deeper level $i + \ell$.
- Uniformity Control: By carefully selecting which descendants to keep for the next level, the algorithm maintains a distribution that approaches perfect uniformity as the sample size $k$ increases.
This "horizontal" approach allows the algorithm to exploit the internal reasoning power of modern solvers. While a random walk might take exponential time to stumble upon a valid path between clusters, a SAT solver can use conflict-driven clause learning and other optimizations to prune the search space and find valid paths directly.
Experimental Evaluation
The authors evaluated SearchTreeSampler against popular alternatives like SampleSAT (a hybrid of local search and systematic search) and Simulated Annealing across a variety of challenging benchmarks:
- Synthetic Landscapes: Designed to test specific failure modes, including "Golf-Course" landscapes (sparse solutions), "XORBarriers" (solutions separated by many violated constraints), and "Asymmetric Spaces" (where solution clusters vary significantly in size).
- Real-World Problems: Logistics planning instances from SATPlan, graph coloring problems from SatLib, and hard random 3-SAT instances.
- Model Counting: Latin Squares and Langford’s problems were used to test the algorithm's accuracy in estimating the total number of solutions.
Key Results and Discussion
The experimental results demonstrate that SearchTreeSampler provides a robust solution to the bias issues inherent in local-search samplers.
Uniformity and Statistical Significance
A critical metric for any sampler is the Pearson’s $\chi^2$ test, which measures how closely the sampled distribution matches a theoretical uniform distribution. In asymmetric spaces where SampleSAT was heavily biased—sampling one specific solution nearly 50% of the time when it should have appeared less than 1% of the time—SearchTreeSampler consistently passed the $\chi^2$ test with high P-values (often $> 0.90$).
Performance on Energy Barriers
The advantage of using a solver as an oracle is most apparent in problems with embedded energy barriers. In these cases, SearchTreeSampler was often three orders of magnitude faster than SampleSAT and significantly more efficient than Simulated Annealing. Because the solver can "see" through the constraints, it effectively "teleports" across the barriers that trap local-move samplers.
Conclusion
SearchTreeSampler represents a paradigm shift in uniform sampling by leveraging the "reasoning" capabilities of modern constraint solvers. By moving vertically through the search tree rather than horizontally through the assignment space, it bypasses the ergodicity problems that plague traditional MCMC methods.
While the method's efficiency is tied to the underlying solver's performance on subproblems, it provides a powerful new tool for sampling in highly structured, constrained environments. Future work may focus on automated parameter tuning for $k$ and level depth $M$, as well as further optimizing the solver-oracle interface to handle even larger solution sets.
Summary updated