Learning Optimal Bounded Treewidth Bayesian Networks via Maximum Satisfiability

Jeremias Berg, Matti Järvisalo, Brandon M. MaloneAISTATS 2014

Abstract

Learning Bayesian network (BN) structures with bounded treewidth is essential for ensuring tractable inference, yet it remains a computationally daunting task. Traditional dynamic programming approaches often suffer from prohibitive memory requirements. This paper introduces a novel framework that encodes the Bounded Treewidth Bayesian Network Structure Learning (BTW-BNSL) problem as a Weighted Partial Maximum Satisfiability (MaxSAT) problem. By leveraging state-of-the-art MaxSAT solvers, the proposed method significantly outperforms existing techniques in scalability and reliability, particularly on larger datasets where memory-intensive methods fail.

Introduction

Bayesian networks (BNs) are fundamental tools for probabilistic reasoning, but they face a dual challenge: structure learning is NP-hard, and general inference is also NP-hard. However, if a network's treewidth—a measure of its "tree-likeness"—is bounded, inference becomes efficient. The Bounded Treewidth Bayesian Network Structure Learning (BTW-BNSL) problem aims to find the optimal network structure under a strict treewidth constraint. Previous approaches, largely based on dynamic programming (DP), are limited by extreme memory consumption, often failing as variable counts increase beyond a small handful.

Methodology: A MaxSAT Approach

The authors propose casting BTW-BNSL as a Weighted Partial MaxSAT problem. This shift moves the computational burden from memory-intensive recursion to a search-based optimization problem. The encoding involves several key components:

  1. Parent Selection and Acyclicity: Each node must select exactly one parent set. To prevent cycles, a binary level-ranking system is implemented.
  2. Treewidth Encoding: This is the core innovation. Treewidth is defined via the existence of a triangulation of the moralized graph. The encoding simulates the process of moralization and triangulation using logical constraints.
Graph transformations for treewidth: (a) DAG, (b) moralized graph, (c) triangulation, and (d) ordered graph.

To formalize this, the researchers defined a set of Boolean variables to represent the parent sets, the edges in the moralized graph, and the node ordering required for triangulation.

Boolean variables used in the MaxSAT encoding for BTW-BNSL.

The optimization objective is to minimize the total cost associated with the chosen parent sets (the "soft" constraints) while satisfying all structural "hard" constraints. The researchers also found that adding redundant logical clauses—such as requiring at least one root node—and applying standard parent-set pruning significantly improved solver performance. The state-of-the-art MaxHS solver was employed to handle these real-valued costs.

Results and Discussion

The MaxSAT approach (MS) was evaluated against the previous state-of-the-art DP algorithm on 10 benchmark datasets with treewidth bounds $W \in \{2, 3, 4\}$.

  • Scalability: While DP was competitive on small datasets (e.g., 9 variables), it failed on larger instances like the Flag dataset (29 variables) due to memory exhaustion. In contrast, MS found optimal solutions for most instances within a 30-minute window.
  • Reliability: Across 30 experimental runs, the DP approach failed (either timed out or ran out of memory) 25 times. The MaxSAT approach failed only twice.
  • Efficiency: MS successfully navigated the search space without the "memory wall" that plagues DP methods. For a clear 2/3 majority of the instances, the MaxSAT approach produced an optimal solution within 30 minutes.

Conclusion

By translating graph-theoretic constraints into propositional logic, this work demonstrates that MaxSAT solvers can effectively solve the BTW-BNSL problem where traditional methods fail. While the logical encoding becomes massive as treewidth and variable counts increase, the approach offers a more scalable and reliable path forward for learning useful Bayesian networks. Future work may focus on refining the treewidth encoding and leveraging advancements in MaxSAT solver technology to handle even larger networks.

Summary updated

BibTeX
@inproceedings{berg2014learning,
  author = {Jeremias Berg and Matti Järvisalo and Brandon M. Malone},
  title = {{Learning Optimal Bounded Treewidth Bayesian Networks via Maximum Satisfiability}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2014},
}
Figure