Belief Propagation and Loop Series on Planar Graphs
Abstract
We discuss a generic model of Bayesian inference with binary variables defined on edges of a planar graph. The Loop Calculus approach of [1, 2] is used to evaluate the resulting series expansion for the partition function. We show that, for planar graphs, truncating the series at singleconnected loops reduces, via a map reminiscent of the Fisher transformation [3], to evaluating the partition function of the dimer matching model on an auxiliary planar graph. Thus, the truncated series can be easily resummed, using the Pfaffian formula of Kasteleyn [4]. This allows to identify a big class of computationally tractable planar models reducible to a dimer model via the Belief Propagation (gauge) transformation. The Pfaffian representation can also be extended to the full Loop Series, in which case the expansion becomes a sum of Pfaffian contributions, each associated with dimer matchings on an extension to a subgraph of the original graph. Algorithmic consequences of the Pfaffian representation, as well as relations to quantum and nonplanar models, are discussed.
pacs:
02.50.Tt, 64.60.Cn, 05.50.+q, ,
1 Introduction
Bayesian Inference can be seen both as a subfield of Information Theory and of general Statistical Inference [5]. A typical problem in this field is: given observed noisy data and known statistical model of a noisy communication channel (transition probability), as well as a prior distribution for the input (a preimage), find the most likely preimage, or compute the a posteriori marginal probability for some part of the preimage.
This field is also deeply related to Combinatorial Optimization, which is a branch of optimization in Computer Science, related to operations research, algorithm theory and complexity theory [6]. A typical problem in Combinatorial Optimization is: solve, approximate or count (exactly or approximately) instances of problems by exploring the exponentially large space of solutions. In many emerging applications (in magnetic and optical recording, microfabrication, chip design, computer vision, network routing and logistics), the data are structured in a twodimensional grid (array). Moreover, data associated with an element of the grid are often binary and correlations imposed by the problem are local, so that only nearest neighbors on the grid are correlated. Such problems are typically stated in terms of binary statistical models on planar graphs.
In this paper, we discuss a generic problem of Bayesian inference defined on a planar graph. We focus on the problem of weighted counting, or (from the perspective of statistical physics) we aim to calculate the partition function of an underlying statistical model. As the seminal work of Onsager [7] on the twodimensional Ising model and its combinatorial interpretation by Kac and Ward [8] have shown, the planarity constraint dramatically simplifies statistical calculations. By contrast, threedimensional statistical models are much more challenging, and no exact results are known.
Building on the work of physicists, specifically on results of Fisher [3, 9] and Kasteleyn [4, 10], Barahona [11] has shown that calculating the partition function of the spin glass Ising model on an arbitrary planar graph is easy, as the number of operations required to evaluate the partition function scales algebraically, , with the size of the system. To prove this, the partition function of the spinglass Ising model was reduced to a dimer model on an auxiliary graph, and the partition function was expressed as the Pfaffian of a skewsymmetric matrix defined on the graph. The polynomial algorithm was later used in simulations of spin glasses [12]. However, Barahona also added a grain of salt to the exciting positive result, showing that generic planar binary problem is difficult [11, 13]. Specifically, evaluating twodimensional spin glass Ising model in a magnetic field is NPhard, i.e. it is a task of likely exponential complexity.
When an exact computational algorithm of polynomial complexity is not available, efficient approximations become relevant. Typically, the approximation is built around a tractable case. One such approximate algorithm built around the FisherKasteleyn Pfaffian formula was recently suggested by Globerson and Jaakkola in [14]. Although this approximation (coined “planargraph decomposition”) gives a provable upper bound for the partition function for some special graphical models, it constitutes just heuristics, i.e. it suffers from lack of errorcontrol and the inability of gradual errorreduction.
Controlling errors in approximate evaluations of the partition function of a graphical model is generally difficult. However, one recent approach, developed by two of us and called Loop Calculus [1, 2], offers a new method. Loop Calculus allows to express explicitly the partition function of a general statistical inference problem via an expansion (the Loop Series), where each term is explicitly expressed via a solution of the Belief Propagation [15, 16, 17], or BethePeierls [18, 19, 20] (BP) equations. This brought new significance to the BP concept, which previously was seen as just heuristics.
The BP equations are tractable for any graph; generally, the number of terms in the Loop Series is exponentially large, so direct resummation is not feasible. However, since any individual term in the series can be evaluated explicitly (once the BP solution is known), the Loop Series representation offers a possibility for correcting the bare BP approximation perturbatively, accounting for loop contributions one after another sequentially. This scheme was shown to work well in improving BP decoding of LowDensity Parity Check codes in the errorfloor regime, where the number of important loop contributions to the Loop Series is (experimentally) small, and the most important loop contributions (comparable by absolute value to the bare BP one) have a simple, singleconnected structure [21, 22]. In spite of this progress, the question remained: what to do with other truly difficult cases when the number of important loop corrections is not small, and when the important corrections are not necessarily singleconnected? In general, we still do not know how to answer these questions, while a partial answer for the important class of planar models is provided in this paper.
1.1 Brief Description of Our Results
In this manuscript we show that, for any graph (planar or not), the partial sum of the loop series over singleconnected loops reduces to evaluation of the full partition function of an auxiliary dimermatching model on an extended, regular degree3 graph. Weights of dimers calculated on the extended graph are expressed explicitly via solution of the respective BP equations. The dimer weights can be positive or negative. In general, summing the singleconnected partition is not tractable. However, in the planar case, it reduces (through manipulations reminiscent of the FisherKasteleyn transformations) to a Pfaffian defined on the extended graph, which is also planar by construction. Thus, we find a big class of planar graphical models which are computationally tractable by reduction (via a BP/gauge transformation) to a loop series including only singleconnected loops, and summable into a Pfaffian. Moreover, we find that the partition function of the entire Loop Series is generally reducible to a weighted Pfaffians series, where each higherorder Pfaffian is associated with a sum of dimer configurations on a modified subgraph of the original graph. Each term in the Pfaffian series is computationally tractable via the Belief Propagation solution on the original graph.
The material in the manuscript is organized as follows. A formal definition of the model is given in Section 1.2 and a brief description of Loop Calculus [1, 2] forms Section 1.3. Some introductory material on the graphical transformations is also given in A. Section 2 is devoted to resummation of the singleconnected loops in the Loop Series (we called it single connected partition). Section 2.1 introduces graphical transformation from the original graph to the extended graph , reminiscent the Fisher transformation [3, 9]. This allows to restate the singleconnected loop partition of the Loop Series on the original graph in terms of a sum over dimer configurations on the extended graph. Subsection 2.2 adapts the Kasteleyn transformation [4, 10] to our case, thus expressing the partition function of the singleconnected series as a Pfaffian of a matrix defined on the extended graph. Section 3 describes a set of graphical models reducible under Belief Propagation gauge (transformation) to a Loop Series which is computationally tractable. Section 4 describes the representation of the Loop Series for planar graphs in terms of the Pfaffian Series, where each Pfaffian sums dimer matchings on a graph extended from a subgraph of , with the later correspondent to exclusion of an even set of vertices from . Grassmann representations, as well as fermionic models are discussed in Section 5: a general set of Grassmann models on superspaces is given in Section 5.1, while Section 5.2 addresses the relation between binary models and integrable hierarchies. A brief list of future research topics is given in Section 6.
1.2 Vertexfunction Model
We introduce an undirected graph consisting of vertices and edges . This study focuses mainly on planar graphs, like those emerging in communication or logistics networks connecting or relating nearest neighbors on a 2d mesh or terrain. However, the material discussed in the present and the following Subsections is general, and applies to any graph, planar or not. A binary variable, , which we will also be calling a spin, is associated with any edge . The graphical model is defined in terms of the probability function
(1) 
for a spin configuration . In (1), is the vector built from all edge variables associated with the given vertex . ’s are positive and otherwise we will assume no restrictions on the factor functions. is the normalization factor, the socalled partition function of the graphical model.
We refer to (1) as “vertexfunction” models, according to statistical physics notation [18]. In the information theory, they are known as Forneystyle graphical models [23, 24].
We will assume in the following that the degree of connectivity of any vertex in the graph is three. Note that this is not a restrictive condition, as the th order vertices, correspondent to spin interactions with , can always be represented in terms of a product of triplet terms. Then the th degree vertex can be transformed into a planar graph consisting of degree three vertices. We discuss transformations to the triplets, in general but also on some examples (Ising Model and Parity Check Decoding of a linear code), in A.
1.3 Loop Calculus
Loop Calculus [1, 2] gives an explicit expression for through the Loop Series:
(2)  
(3) 
where can be any allowed generalized loop on the graph , i.e. is a subgraph of which does not contain any vertices of degree one; is a set of vertices of graph which are also contained in the generalized loop (by construction consists of two or three elements); and and are beliefs associated with vertex and edge . The beliefs are defined via message variables
(4)  
(5) 
solving the following system of the Belief Propagation (BP) equations
(6) 
The bare (BP) partition function in Eq. (2) has the following expression in terms of the message variables:
(7) 
BP equations (6) are interpreted as conditions on the gauge transformations, leaving the partition function of the model invariant. These equations may allow multiple solutions, related to each other via respective gauge transformations. The multiple solutions correspond to multiple extrema of the Bethe Free Energy and Loop Series can be constructed around any of the BP solutions. ^{1}^{1}1See [1, 2, 21] for a detailed discussion of this and other related features of BP equations as gauge fixing conditions.
2 Resummation of the Singleconnected Partition
In the following we will show how to resum a part of the Loop Series accounting for all the singleconnected loops, i.e. subgraphs of with all vertices of degree two
(8) 
where stands for the number of neighbors of within . The evaluation will consist of the following two steps:
Note: while A) is valid for any graphical model, B) applies only to the planar case.
2.1 Transformation to Dimer Matching Problem
Following the construction of Fisher [3, 9], we expand each vertex of into a threevertex of the extended graph , according to the scheme shown in the left panel of Figure 1. Consider a vertex of and assume that are three neighbors of on . For each vertex , there are three contributions of degree two within a generalized loop , i.e. with , which can possibly contribute to the singleconnected partition : . We associate the three weights with internal edges of the respective threevertex of , while the weights of all the external edges of the threevertex are equal to unity. Then any coloring of the original graph, marking a single connected loop of , is in the onetoone correspondence to a dimermatching (which we also call coloring) of . The weights and coloring assignments are illustrated on an example at the left panel of Figure 1. An example of transformation mapping a singleconnectedloop on respective dimer on is shown in Figure 2.
This map from the singleconnected loops to dimers leads to the following representation for the singleconnected partition
(9) 
where the dimerweights on are defined according to the simple rules explained in the previous paragraph. One finds that the right hand side of (9) is nothing but the partition function of a dimermatching problem on .
2.2 Pfaffian Expression for the Partition Function
Kasteleyn has shown in [4, 10] (see also [11]) that is equal to a Pfaffian (the square root of determinant) of a skewsymmetric matrix of size , where is the number of vertices in . Each element of the matrix with (ordering is arbitrary, but it is fixed once and forever) is , where . There are many possible choices of which guarantee the Pfaffian relation: . A simple constructive way of choosing such a valid is to relate it to orientation of edges in a directed version of , built according to the following “oddface” rule: number of clockwiseoriented segments of any internal face of should be negative. ^{2}^{2}2Except, possibly, the external face. Example of a valid orientation is shown in Figure 2 and the respective expressions are
(10) 
Since calculating the determinant requires operations, one finds that resummation of all the singleconnected loops in the Loop Series expression for the partition function of a planar graphical model can be done efficiently in steps.
3 Tractable Problems Reducible to SingleConnected Partition
In the case of a general vertexfunction graphical model, the BPgauge transformations, described by the set of BP equations (6), result in exact cancelation in the Loop Series of all the subgraphs containing at least one vertex of degree one within the subgraph. Thus, for the graph with all vertices of degree three, any vertex contributing a generalized loop (subgraph) should be of degree two or three within the subgraph. As shown in the previous Section, if one ignores generalized loops with vertices of degree three and the original graph is planar, the resulting subseries (singleconnected partition) is computationally tractable, i.e. the number of operations required to evaluate the singleconnected partition is cubic in the system size (not exponential !).
In this Section we discuss the class of planar models whose Loop Series do not contain any generalized loops with vertices of degree three. According to Section 2, these models are tractable.
Indeed, it is known that BP Eqs. (6) have at least one solution for the set of messages on any graph and for any factor functions defined on the vertices of the graph. The aforementioned requirement for the generalized loop not to contain any vertex of degree three translates into the following set of additional equations
(11) 
Considered together, the set of Eqs. (6,11) is overdefined, i.e. it cannot be solved in terms of variables for any values of the factor functions. However, if one allows flexibility in the factor functions, and, in fact, considers Eqs. (6,11) as a set of conditions on both the messages and the factor functions , one arrives at a big set of possible solutions.
Therefore, Eqs. (6,11) define a big set of models reducible via BP transformations to a tractable Loop Series consisting only of single connected loops.
Moreover, the relations we established may be reversed. One may start from an arbitrary Loop Series consisting of only single connected loops, apply an arbitrary gauge transformation leaving the Loop Series invariant (these transformations are not necessarily of BP type), and arrive at a graphical model with some set of factor functions. At first sight, the resulting graphical model might not look tractable, but it actually is, by construction.
4 Loop Series as a Pfaffian Series
Let us notice that the general planar problem (e.g. spin glass in a magnetic field) is NPhard [11], and it is thus not surprising that full resummation does not allow expression in terms of a single Pfaffian (or a determinant).
On the other hand, we already found that a part of the Loop Series, specifically its singleconnected partition, reduces to a computationally tractable Pfaffian. This suggests to represent the full Loop Series as a sum over terms, each representing a set of triplets (fully colored vertices of degree tree on ):
(12) 
where is either the empty set or any set of even nodes on ; are the weights from Eq. (2) associated with the triplet , such that ; and is the sum over all generalized loops (proper Loop Series colorings, i.e. subgraphs) of such that all nodes of are fully colored (all edges adjusted to the nodes belong to the generalized loop), while any other vertices of are not colored or only partially colored. Thus, the first term in Eq. (12), where is the empty set, represents the singleconnected partition, .
We show here that not only the first term in Eq. (12), associated with , but any term in Eq. (12) is computationally tractable, being equal to a Pfaffian of a matrix defined on .
Indeed, it is straightforward to verify that the generalized loops associated with the given set of triplets (fully colored vertices) from the set are in onetoone correspondence with the set of dimer matchings on , which is a subgraph of with all vertices correspondent to , and external edges connected to the vertices, completely removed. Notice that some vertices of are of degree two. (These are vertices neighboring the removed triplets of .)
An example of a construction is given in Figure 4. One associates weights to the edges of in exactly the same way as for the singleconnected partition: the weights of all the external edges of vertices of are equal to unity, while the internal edges are associated with the respective values , defined in Eq. (3).
For any of one constructs the skewsymmetric matrix according to the Kasteleyn rule for the dimermatching model described in Section 2.1. As before, the dimensionality of the matrix is and each element of the matrix is the product of the respective dimer weight and orientation sign. Notice that the choice of signs for the elements of depends on the set of “excluded” triplets , and thus is not simply a minor of the original matrix , the one corresponding to the singleconnected partition (without exclusion). Thus,
(13) 
Eqs. (12,13) describe the Pfaffian series representation for the Loop Series of the planar problem.
5 Fermion Representation and Models
Any Pfaffian in Eq.(13) allows a compact representation in terms of Grassmann variables [25]. Indeed, let us associate a Grassmann (anticommuting or fermionic) variable with each vertex of . The Grassmann variables satisfy
(14) 
and commute with ordinary numbers. One also introduces the Berezin integration rules over the Grassmann variables
(15) 
This translates into the following rule of Gaussian integration over the Grassmann variables:
(16) 
where is the vector of the Grassmann variables over the entire graph, and is an arbitrary skewsymmetric matrix on the graph. For example, applying this formula to the first term of the Pfaffian series (12) one derives
(17) 
In general, any term in the Pfaffian series of Eq. (12) can be represented as a Gaussian Grassmann integrable, however with different Gaussian kernels, not reducible simply to minors of .
5.1 Graphical Models on SuperSpaces
In this Subsection we first consider graphical models on spaces generalizing the point (binary) set to superspaces containing commuting and anticommuting parts. The models will be defined on arbitrary (non necessarily planar) graphs. Then, we return to the simple example (17) of pure dimer model with the Grassmann (anticommuting) variables defined on vertices of , to see that the model can be restated as the vertexfunction Grassmann model on the original graph .
The general class of vertexfunction models can be introduced as follows. For our graph, , consider a set of spaces , i.e., we associate a space with any edge, , together with a vertex, , that belongs to the edge. For simplicity we assume the spaces to be identical, i.e., for all . The basic variables are . We also introduce the notation (all products below are cartesian)
(18)  
(19) 
Note that any is a twocomponent cartesian product. The vertexfunction model is determined by a set of vertex functions defined on and a set of integration measures on . The model partition function is
(20) 
For the particular case when measures have supports restricted to the diagonals , i.e. , we can consider the basic variables that belong to the diagonals. This corresponds to a more conventional formulation of the vertexfunction models with the variables residing on edges. Note that the models introduced allow for looptower calculus [26], formulated in terms of fixing a proper gauge. The BP gauge fixing for a general vertexfunction model described by Eq. (20) is nothing more than choosing basis sets in the vector spaces (maybe infinitedimensional) of functions in . A standard binary model, defined in Eq. (1), corresponds to the choice of the basic space to be a point set. Vertex models with ary alphabet, e.g. discussed in [26], are described by . Continuous models are obtained if is chosen to be a manifold of dimension . The continuous case can be extended to the choice of to be a supermanifold of dimension that contains Grassmann (anticommuting) coordinates and whose substrate is an dimensional manifold. Note that a manifold can be considered as a supermanifold with zero odd dimension . In the remainder of this Subsection we will be dealing with an opposite case of the zero even dimension , specifically with the purely Grassmann case of the supermanifold.
Eq. (17) is the partition function of a model stated in terms of Grassmann variables defined on the vertices of . The extended graph is constructed from the original graph so that a vertex of extends into a triangle with three vertices of degree three (see the left panel of Figure 1). Therefore, the three Grassmann variables in (17) are associated with a vertex of . Then, Eq. (17) defined on allows an obvious reformulation in the vertexfunction form (20) on , where represents the three Grassmann variables that reside on the vertices of , obtained by expanding the vertex of the original graph. The dimer weights for the three edges of associated with the extended vertex of are encoded in the Gaussian function . The dimer weight associated with an edge of that represents and edge of the original graph is encoded in the integration measure .
Also notice that the vertexfunction Grassmann model on a planar graph can be restated as a model on the triangulated graph, dual to , with complex fermion (Grassmann) variables associated with the edges of the dual graph and functions associated with a face (elementary triangle) of the dual graph (Figure 7 illustrates the duality transformation). One interesting conclusion here is that the sequence of transformations discussed above leads us from a special binary model on a planar graph to a Gaussian fermion (Grassmann) model on the dual graph, thus representing an instance of the disorder operator approach of KadanoffCeva [27] developed originally for the Ising model on a square lattice.
5.2 Comments on Relation to Quantum Algorithms and Integrable Hierarchies
A mapping of a classical inference problem onto finding an expectation value in a corresponding quantum model takes on a natural interpretation as a quantum algorithm. This can be tried by using the theory of the infinite KadomtsevPetviashvilii (KP) hierarchy, specifically its fermionic formulation [28]. Consider lattice fermions with and introduce the population and shift operators . Let denote the standard manyparticle vacuum state where all singlefermion orbitals with are occupied, and is some uncorrelated (i.e. represented by a single Slater determinant) manyparticle state, which is sufficiently close to . Introducing , , and we consider an expectation value
(21) 
The approach is based on mapping the partition function of a classical inference problem on a graph onto a calculation of an expectation value represented by Eq. (21). We have established such a mapping for some simple Grassmannian models on planar graphs [29], where all the details on the suggested approach will be presented. Note that in the case and the expectation value is related to the function of the KP integrable hierarchy.
6 Future Challenges
We conclude with a brief and incomplete discussion of future challenges and opportunities raised by this study.

We plan to extend the study looking at new approximate schemes for intractable planar problems. One new direction, suggested in Section 3, consists of exploring the vicinity of the computationally tractable models reducible via the BPgauge transformation to the series of singleconnected loops. It is also of great interest to explore the vicinity of integrable tractable models mentioned in 5.2.

Perturbative exploration of a larger set of intractable nonplanar problems which are close, in some sense, to planar problems, constitutes another interesting extension of the research. Here, one would aim to blend the aforementioned planar techniques with planar (or similar) decomposition techniques, e.g. these of the type discussed in [14].

One important component of our analysis consisted in the Pfaffian resummation of the singleconnected loop (dimer) contributions, which is a special feature of the graph planarity. On the other hand, it is known that the planarity is equivalent to the graph being minorexcluded with respect to and subgraphs. Therefore, one wonders if there exists a generalization of the Pfaffian reduction to partition functions of models from other and/or broader graphminor classes defined within the graphminor theory [30]?Likewise, comparing with previous studies of the nonplanar/nonspherical cases, based on the dimer approach [31, 32, 33].

Extending the Loop Series analysis of the binary planar problem to the qary case seems feasible via the Loop Tower construction of [26]. This research should be of a special interest in the context of recently proposed polynomial quantum algorithm for calculating partition function of the Potts model [34]. Besides, recent progress [35, 36] shows that a Kasteleyntype approach is extendable to a ary case, leading to the concept of “heaps of dimers”, and (in the continuum limit) to fascinating connections with special, highly symmetric complex surfaces, known as Harnack curves.

In [46], the problem of finding all pseudocodewords in a finite cycle code (corresponding to the type of graphical model discussed in this paper), was addressed by constructing a generating function known as graph zeta function [47]. The interesting fact discovered in [46] is that this generating function of pseudocodewords has a determinant formulation, based on a discrete graph operator. Hence, one may anticipate an existence of yet uncovered relation between the graph zeta function and a PfaffianLoop resummation of related graphical models.
7 Acknowledgments
Research of M.C. and R.T. was carried out under the auspices of the National Nuclear Security Administration of the U.S. Department of Energy at Los Alamos National Laboratory under Contract No. DE C5206NA25396, and specifically the LDRD Directed Research grant on Physics of Algorithms. M.C. also acknowledges support of the Weston Visiting Professorship program at the Weizmann Institute of Science, where he started to work on the manuscript. V.Y.C. acknowledges support through the startup funds from Wayne State University.
Appendix A Graphical Transformations
In this Appendix we discuss graphical transformations reducing any binary problem to the vertexfunction model described by Eq. (1), where all vertices are of degree three. Our main focus here is on the planar graphs, and on the graphical transformations preserving planarity. However some of the transformations and considerations discussed below apply to an arbitrary graph.
Often the original binary model is not represented in the vertexfunction form. Some or all binary variables describing a problem may actually be assigned to vertices of a graph, then respective functions are associated with edges and not vertices. Obviously, one can also reformulate the model reducing it to the vertex (canonical for our purposes) form. The transformation is illustrated in Figure 5. Algebraic form of the transformation shown in the Figure reads, , where is the characteristic function equal to unity if all variables are equal each other and equal to zero otherwise.
Next, let us notice that, given a vertexfunction model (1) with the degree of connectivity higher than three, one can always perform a sequence of transformations reducing the degree of connectivity of all the nodes in the resulting graphical model to three. An elementary graphical transformation of the kind is illustrated in Figure 6. It is assumed that the transformation is applied sequentially to vertices of degree larger than three till none of these are left. The end result is that: (a) there are no vertices of degree larger than three left within the graph; (b) the increase in the total number of vertices is polynomial; (c) if the original graph is planar the resulting graph is also planar.
The set of transformations just described is general, and thus often inefficient, in the sense that knowing specific form of the factor functions one can practically always do a more efficient, customized and simpler reduction. Below we will illustrate this point on examples.
a.1 Ising Model
The spin glass Ising model is usually defined in terms of variables associated with vertices of the graph
(22) 
where summation under the exponential on the r.h.s. goes over all edges of the graph, and associated with an edge can be positive or negative. Obviously one can apply the vertextoedges transformation, explained in Figure 5, to restate the spin glass Ising model as a vertexfunction model. However, in this case one can also do a simpler transformation to the dual graph. Let us consider a planar triangulated graph shown in black in Figure 7. All vertices of the respective dual graph, , shown in red in Figure 7, have degree of connectivity three. We assume that the spin glass Ising model is defined on the planar triangulated graph . Defining a new variable on an edge of as the product of two variables of the original graph connected by an edge of crossing the edge of , one finds that the sum on the r.h.s. of Eq. (22), rewritten in terms of the new variables, becomes, . However, the new variables, are not independent, but rather related to each other via a set of local constraints, : . Then, Eq. (22) restated in terms of the new variables on the dual graph gets the following compact vertexstyle form
(23) 
One interesting observation is that the allowed configurations of on the dual graph correspond exactly to the singleconnected loops on , where the loops are built from the excited, , edges. Therefore, and in accordance with discussion of Section 2, calculation of the partition function for the spin glass Ising is reduced to evaluation of the respective Pfaffian, which is the task of a polynomial complexity. Notice also that adding a magnetic field (linear in ) term in the expression under the exponent on the r.h.s. of Eq. (23) will raise the complexity level to exponential.
a.2 ParityCheck Based ErrorCorrection
Consider a linear code with the codebook defined in terms of the bipartite Tanner graph, consisting of bits and parity checks, and the set of edges relating bits to checks and checks to bits. Then a message is a codeword of the code if it satisfies all the parity checks, i.e. . Assuming that all the codewords are equally probable originally, and that the white channel transform a bit of the original codeword into the signal with the probability , one finds that the probability for to be a codeword resulted in the measurement is
(24) 
where, as usual, the partition function is fixed by the normalization condition, .
Eq. (24) represents an example of a mixed graphical model, with variables defined on bitvertices, the paritycheck functions defined on checkvertices and the channel functions (carrying the dependencies on the loglikelihoods ) also associated with the bitvertices. In this case transformation to the vertexstyle model is done by direct application of the vertextoedges procedure of Figure 5 to all the bitvertices of . Then, the vertexstyle version of Eq. (24) becomes
(25)  
(26)  
(27)  
(28) 
In general, degree of connectivity of bitvertices and checkvertices may be arbitrary. Direct application of the general procedure explained above (see Figure 5 and discussion therein) allows to reduce all the higherdegree nodes to a larger set of nodes of degree three. However, a simpler dendroreduction is possible both for the bitvertices and checkvertices. The dendro trick (e.g. discussed in [48] for complexity reduction of a Linear Programming decoding of LDPC codes) is schematically illustrated in the two right panels of Figure 8, where respective algebraic relations are
(29)  
(30)  
and is equal to unity if all arguments are the same, and it is zero otherwise.
Bibliography
References
 [1] Chertkov M and Chernyak V Y, Loop Calculus in Statistical Physics and Information Science, 2006 Phys. Rev. E 73 065102(R) [condmat/0601487]
 [2] Chertkov M and Chernyak V Y, Loop series for discrete statistical models on graphs, 2006 J. Stat. Mech. P06009 [condmat/0603189]
 [3] Fisher M E, Statistical Mechanics on a Plane Lattice, 1961 Phys. Rev 124 1664
 [4] Kasteleyn P W, The statistics of dimers on a lattice, 1961 Physics 27 1209
 [5] MacKay D, Information Theory, Inference, and Learning Algorithms, 2003 Cambridge Univ. Press
 [6] Papadimitriou C H and Steiglitz K, Combinatorial Optimization: Algorithms and Complexity, 1998 Dover
 [7] Onsager L, Crystal Statistics, 1944 Phys. Rev. 65 117
 [8] Kac M and Ward J C, A combinatorial solution of the Twodimensional Ising Model, 1952 Phys. Rev. 88 1332
 [9] Fisher M E, On the dimer solution of planar Ising models, 1966 J. Math. Phys. 7 1776
 [10] Kasteleyn P W, Dimer Statistics and Phase Transitions, 1963 J. Math. Phys. 4 287
 [11] Barahona F, On the computational complexity of Ising spin glass models, 1982 J.Phys. A 15 3241
 [12] Saul L and Kardar M, Exact integer algorithm for the twodimensional Ising spin glass, 1993 Phys. Rev. E 48 R3221
 [13] Jerrum M, Twodimensional monomerdimer systems are computationally intractable, 1987 J. Stat. Physics 48 121134
 [14] Globerson A and Jaakkola T, Approximate inference using planar graph decomposition, in Proceedings of Advances in Neural Information Processing Systems, 2006 20
 [15] Gallager R G, Low density parity check codes, 1963 MIT Press Cambridge MA
 [16] Gallager R G, Information Theory and Reliable Communication, 1968 J. Wiley New York
 [17] Pearl J, Probabilistic reasoning in intelligent systems: network of plausible inference, 1988 Kaufmann San Francisco
 [18] Baxter R J, Exactly Solved Models in Statistical Mechanics, 1982 Academic Press
 [19] Bethe H A, 1935 Proc. Roy. Soc. London A 150 552
 [20] Peierls R, Ising’s model of ferromagnetism, 1936 Proc. Camb. Phil. Soc. 32 477
 [21] Chertkov M and Chernyak V Y, Loop Calculus Helps to Improve Belief Propagation and Linear Programming Decodings of LowDensityParityCheck Codes, invited talk, 44th Allerton Conference 2006 [ arXiv:cs.IT/0609154]
 [22] Chertkov M, Reducing the Error Floor, invited talk at the Information Theory Workshop on “Frontiers in Coding” 2007 [http://arxiv.org/abs/0706.2926]
 [23] Forney G D, Codes on Graphs: Normal Realizations, 2001 IEEE IT 47 520548
 [24] Loeliger H A, An Introduction to Factor Graphs, 2001 IEEE Signal Processing Magazine 28
 [25] Berezin F, Introduction to SuperAnalysis, 1987 Springer
 [26] Chernyak V and Chertkov M, Loop Calculus and Belief Propagation for qary Alphabet: Loop Tower, 2007 Proceedings of ISIT [cs.IT/0701086]
 [27] Kadanoff L P and Ceva H, Determination of an Operator Algebra for the TwoDimensional Ising Model, 1971 Phys. Rev. B 3 3918
 [28] Sato M, Miwa T and Jimbo M 1977 Proc. Japan Acad. 53A 6; 1978 Publ. Res. Int. Math. Sci. 14 223; 1979 15 201 577 871; 1980 16 531
 [29] Teodorescu R, Chernyak V and Chertkov M, in preparation
 [30] Lovász L, Graph Minor Theory, 2005 Bulletin of the American Mathematical Society 43 75
 [31] Regge T and Zecchina R, Exact solution of the Ising model on group lattices of genus , 1996 J. Math. Phys. 37 27962814
 [32] Regge T and Zecchina R, Combinatorial and topological approach to the 3D Ising model, 2000 J. Phys. A: Math.Gen. 33 741
 [33] Galluccio A, Loebl M and Vondrak J, New algorithm for the Ising problem: Partition function for finite lattice graphs, 2000 Phys. Rev. Lett. 84 59245927
 [34] Aharonov D, Arad I, Eban E and Landau Z, Polynomial Quantum Algorithms for Additive approximations of the Potts model and other Points of the Tutte Plane, QIP 2007
 [35] Di Francesco P and Guitter E, Integrability of graph combinatorics via random walks and heaps of dimers, [arXiv:math/0506542v1]
 [36] Kenyon R and Okounkov A, Planar dimers and Harnack curves, [arXiv:math/0311062v2]
 [37] Sherrington D and Kirkpatrick S, 1975 Phys. Rev. Lett. 35
 [38] Dotsenko V S and Dotsenko V S, Critical behaviour of the phase transition in the 2D Ising Model with impurities, 1983 Advances in Physics 32 129172
 [39] Honecker A, Picco M and Pujol P 2001 Phys. Rev. Lett. 87 047201
 [40] Amoruso C, Hartmann A K, Hastings M B and Moore M A 2006 Phys. Rev. Lett. 97 267202
 [41] Bhaseen B J, Caux J S, Kogan I I and Tsvelik A M 2001 Nucl.Phys. B 618 465
 [42] Efetov K, Supersymmetry in Disorder and Chaos, 1997 Cambridge University Press
 [43] Edwards S F and Anderson P W 1975 J. Phys. F 5 965
 [44] Fisher D S and Huse D A 1986 Phys. Rev. Lett. 56 1601
 [45] Mézard M, Parisi G and Virasoro M A, Spin Glass Theory and Beyond, 1987 World Scientific
 [46] Koetter R, Li WC. W, Vontobel P O and Walker J L, Pseudocodewords of cycle codes via zeta functions 2004 Proc. IEEE Inform. Theory Workshop p. 6
 [47] Horton M D, Stark H M and Terras A A, What are zeta functions of graphs and what are they good for? 2006 Contemporary Mathematics 415 173
 [48] Chertkov M and Stepanov M, Pseudocodeword Landscape, 2007 Proc. of ISIT [cs.IT/0701084]