Abstract
Calculating the partition function ($Z$) in probabilistic graphical models is a fundamental but NP-hard problem. While Belief Propagation (BP) provides a popular approximation, it is only exact for trees and can be highly inaccurate for graphs with loops. This paper introduces a systematic method to improve BP for planar graphs by leveraging the Loop Calculus framework. We demonstrate that the sum of a specific subset of correction terms—2-regular loops—can be mapped to a weighted perfect matching problem on an extended graph. For planar topologies, this sum is efficiently computable in polynomial time using Pfaffians. Our results show that even the first term of this "Pfaffian series" provides a significant accuracy boost, outperforming several state-of-the-art approximate inference algorithms.
Introduction
In Markov Random Fields and other graphical models, the partition function $Z$ is the essential normalization constant required for probabilistic inference. For graphs containing cycles, standard methods like Belief Propagation (BP) often fail to provide accurate estimates. Loop Calculus offers a theoretical remedy by expressing the exact partition function as the BP estimate multiplied by a series of correction terms associated with subgraphs. However, the exponential number of such terms typically renders full correction intractable. This work addresses this challenge for the special case of planar graphs, providing a polynomial-time algorithm to sum the most critical correction terms.
Methodology: From Loops to Matchings
The core of our approach is the focus on "2-regular loops"—subgraphs where every vertex has a degree of at least two. We utilize the Loop Calculus framework to represent the partition function as $Z = Z_{BP} \cdot (1 + \sum \text{corrections})$.
To make the summation of these corrections tractable, we employ a graph transformation technique based on Fisher's rules from statistical physics. The original planar graph $\mathcal{G}$ is transformed into an "extended graph" $\mathcal{G}_{ext}$. In this extended representation, the sum over 2-regular loops in the original graph corresponds exactly to the sum of all weighted perfect matchings in the extended graph.
For planar graphs, the sum of perfect matchings can be calculated in $O(N^3)$ time by computing the Pfaffian of a skew-symmetric matrix. We define a "Pfaffian series" where the first term, $Z_\emptyset$, captures the bulk of the loop corrections. This provides an "any-time" algorithm where additional terms can be computed for increased precision if resources allow.
Experimental Evaluation
We evaluated the proposed method on synthetic Ising models with both attractive and mixed (frustrated) interactions on square grids up to $18 \times 18$ nodes. The performance was compared against standard BP and other advanced approximate inference methods, including Tree-Structured Expectation Propagation (TreeEP), Tree Reweighting (TRW), and the Cluster Variation Method (CVM).
Key Results
Our experiments revealed that the $Z_\emptyset$ correction consistently and significantly improves upon the base BP result. As shown in the performance plots, the error in the partition function for $Z_\emptyset$ (the thick black line) is often orders of magnitude lower than that of BP, TRW, or TreeEP across various coupling strengths ($\beta$).
Notably, the accuracy of the $Z_\emptyset$ approximation remains stable as the graph size increases, unlike simpler loop-truncation schemes. While the $O(N^3)$ computational cost is higher than BP, it remains far more efficient than exact methods like the Junction Tree algorithm for large planar graphs.
Discussion and Conclusion
By bridging combinatorial geometry and probabilistic inference, we have shown that planarity allows for a tractable and highly accurate correction to Belief Propagation. The "power of the first term" in the Pfaffian series suggests that capturing the collective effect of 2-regular loops is a potent strategy for improving inference.
Future work will explore extending these techniques to "almost planar" graphs and models with non-binary variables. While the planarity restriction is significant, many structured problems in computer vision and physics naturally satisfy or approximate this condition, making this a valuable tool for high-precision approximate inference.
Summary updated