Combining Breadth-First and Depth-First Strategies in Searching for Treewidth

Rong Zhou, Eric A. HansenIJCAI 2009

Abstract

Finding the treewidth of a graph is a fundamental NP-complete problem with significant implications for computational efficiency in fields like Bayesian inference. This paper introduces a hybrid search algorithm that combines the duplicate-avoiding capabilities of breadth-first search (BFS) with the memory efficiency and locality of depth-first search (DFS). By organizing the search frontier into a "Frontier Decision Tree," the authors minimize the computational overhead of graph manipulation, achieving up to a 3x speedup and substantial memory savings on complex graph benchmarks.

Introduction

Treewidth is a metric that quantifies how closely a graph resembles a tree. Many hard problems become tractable when a graph's treewidth is low. However, calculating the exact treewidth involves searching for an optimal vertex elimination order, a process with an exponentially growing search space.

Historically, researchers have relied on two main search strategies:

  1. Depth-First Search (DFS): While memory-efficient, DFS often revisits the same intermediate states multiple times due to different vertex permutations, leading to redundant computations.
  2. Best-First Search (BFS): BFS avoids duplicate states by recognizing when different paths lead to the same configuration. However, it requires significant memory to store the frontier and suffers from a "graph generation bottleneck," where intermediate graphs must be rebuilt from scratch for each node expansion.

Methodology: The Frontier Decision Tree

To address these limitations, the authors propose a hybrid approach centered on a Frontier Decision Tree (FDT). This structure stores the search frontier as an ordered binary decision tree where each path from the root to a leaf represents a unique set of eliminated vertices.

DFS within BFS

The overall search progresses level-by-level (breadth-first), but the algorithm traverses the leaves of the FDT using a depth-first strategy. This "DFS-inside-BFS" approach exploits memory-reference locality. Because the DFS visits similar nodes consecutively—nodes that share a long prefix of eliminated vertices—the algorithm can transform one intermediate graph into the next using a few "uneliminate" and "eliminate" operations. This is significantly faster than rebuilding the graph from the root.

DFS traversal within the Frontier Decision Tree to exploit locality

Partial Frontier Decision Trees

To further optimize memory usage, the authors introduced Partial Frontier Decision Trees. In this model, "full-depth" leaves represent nodes currently being expanded, while "shallow-depth" leaves use compact bit-vectors to represent nodes waiting in the queue. This hybrid approach provides the compression benefits of symbolic search without the full memory overhead of an explicit tree.

Experimental Evaluation

The algorithm was tested on two primary datasets:

  • Random Graphs: 100 instances with varying densities (e.g., $V=35, E=140$).
  • DIMACS Benchmarks: Structured graphs used for coloring problems (e.g., queen, david, myciel5), which are notoriously difficult for treewidth solvers.

Key Results

The hybrid strategy demonstrated marked improvements in both speed and memory efficiency:

  • Speedup: On the most challenging random graph instances, the incremental "neighbor-based" modification was 3.1 times faster than traditional graph rebuilding.
  • Memory Compression: The partial FDT approach reduced the peak number of decision nodes by over an order of magnitude in some cases. For instance, a search requiring 5.7 million nodes in a full tree was reduced to just 270,000 nodes using a partial tree.
Comparison of node counts and execution time for full vs. partial decision trees

The algorithm also set new performance standards for DIMACS benchmarks, solving the myciel5 graph in under 200 seconds.

Conclusion and Future Work

By combining the strengths of BFS and DFS, this hybrid algorithm effectively mitigates the graph generation bottleneck in treewidth search. The use of Frontier Decision Trees allows for efficient duplicate detection while maintaining the locality necessary for fast graph manipulation.

Future research may explore adapting this strategy for external-memory search, utilizing disk space to overcome RAM limitations for even larger graphs. Additionally, the "DFS-inside-BFS" paradigm could be applied to other state-space search problems where state representation is computationally expensive, such as in formal model checking.

Summary updated

BibTeX
@inproceedings{zhou2009combining,
  author = {Rong Zhou and Eric A. Hansen},
  title = {{Combining Breadth-First and Depth-First Strategies in Searching for Treewidth}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2009},
}
Figure