Patent Publication Number: US-6910000-B1

Title: Generalized belief propagation for probabilistic systems

Description:
FIELD OF THE INVENTION 
   This invention relates generally to modeling probabilistic systems, and more particularly, to modeling probabilistic systems using belief propagation in a Markov network. 
   BACKGROUND OF THE INVENTION 
   Computer models are frequently used to study the behavior of complex probabilistic systems. When the systems contain many inter-dependent random variables, Markov networks are often used. In a Markov network, nodes of the network represent the possible states of a part of the system, and links between the nodes represent statistical dependencies between the possible states of those nodes. 
   By the Hammersly-Clifford theorem, from the study of Markov networks, the probability of any set of states at the nodes of the network can be written as the product of compatibility functions between clusters of nodes. 
     FIG. 1  shows a simple network with four nodes labeled a, b, c, and d. The links between the nodes represent the statistical dependencies between the possible states of the nodes. For the case of pairwise probabilistic interactions between nodes of the network, the overall joint probability of the system can be expressed as the product of compatibility functions for each linked pair of nodes:
   P ( s   a   , s   b   , s   c   , s   d )=φ ab ( s   a   , s   b )φ bc ( s   b   , s   c )φ ca ( s   c   , s   a )φ bd ( s   b   , s   d ),  [1] 
where φ ab  is the compatibility matrix between nodes a and b, s a  is a random variable describing the state at node a, and similarly for the other nodes and variables.
 
   Often, Markov networks for practical applications are very large. For example, an image acquired from a scene by a camera may be represented by a Markov network between all small neighboring patches, or even pixels, of the acquired image. Similarly, the well known “travelling salesman problem” can map onto a Markov network where the maximum probability state corresponds to the shortest path of the salesman&#39;s route. This network has as many nodes as cities to be visited. In some Markov networks, the nodes can represent measured input signals, such as visual input data. Markov models are also extensively used in speech recognition systems. 
   To analyze the probabilistic system modeled by a Markov network, one typically wants to find the marginal probabilities of certain network variables of interest. (The “marginal probability” of a variable signifies the probability of that variable ignoring, the state of any other network variable.) For example, it may be useful to examine the probability of a variable that represents an underlying explanation for some measured data, such as the probability of particular words used to vocalize particular speech sounds. To find those probabilities, the Markov network is marginalized over all the other variables in the network. This gives the probability of the variable representing the explanation, given the measured input data values. This marginalization is thus a form of inference. 
   One may also want to find states of the nodes, which maximize the network probabilities. For example, for the Markov network corresponding to the travelling salesman problem, it is desired to find the state at each node which maximize the probability of the Markov network. These states, which minimize the length of the salesman&#39;s route, are known as the maximum a posteriori probability (MAP) states. 
   In the example of  FIG. 1 , it is possible to determine the marginal probability P(s a ) of the variable at node a by summing the random values at nodes b, c, and d: 
               P   ⁡     (     s   a     )       =       ∑       s   b     ,     s   c     ,     s   d         ⁢         ϕ   cb     ⁡     (       s   a     ,     s   b       )       ⁢       ϕ   bc     ⁡     (       s   b     ,     s   c       )       ⁢       ϕ   ca     ⁡     (       s   c     ,     s   a       )       ⁢         ϕ   bd     ⁡     (       s   b     ,     s   d       )       .                 [   2   ]             
 
   In general, especially for large networks, these marginal probabilities are infeasible to determine directly. The joint sum over all possible states of all the nodes can be of too high a dimension to sum numerically, particularly when the network has closed loops. 
     FIGS. 2   a-b  show examples of Markov networks with many loops for which it is difficult to find either the marginal probability at a node, or the state of the node which maximizes the overall probability of the Markov network. Both networks are in the form of lattices, which are commonly used to describe the joint probabilities of variables spatially, distributed over two dimensions.  FIG. 2   a  shows a rectangular lattice, and  FIG. 2   b  shows a triangular lattice. These type of lattice networks are used to model many systems. 
   Techniques to approximate the marginal probabilities for such structures are known, but these techniques are typically very slow. Simulated annealing can be used, or Gibbs sampling, see Geman et al. “Stochastic relaxation, Gibbs distribution, and the Bayesian restoration of images,” IEEE Pattern Analysis and Machine Intelligence, 6:721-741, 1984. Another class of approximation techniques are variational methods, see Jordan, “Learning in graphical models,” MIT Press, 1998. However, these methods require an appropriate class of variational approximation functions for a particular problem. It is not obvious which functions, out of all possible ones, to use for the approximations. 
   For the special case of Markov networks that form chains or trees, there is a local message-passing method that calculates the marginal probabilities at each node, see Pearl, “Probabilistic reasoning in intelligent systems: networks of plausible inference,” Morgan Kaufmann, 1988. The later method is now in widespread use, and is equivalent to the “forward-backward” and Viterbi methods for solving one dimensional Hidden Markov Models (HMM), and to Kalman filters and their generalization to trees, see Luettgen et al. in “Efficient multiscale regularization with applications to the computation of optical flow,” IEEE Trans. Image Processing, 3(1):41-64, 1994. This message-passing method gives the exact marginal probabilities for any Markov network that does not have loops. This is referred to as the “standard” belief propagation, or message-passing method below. 
   Unfortunately, many Markov networks of practical interest do contain loops. For example, an image, modeled as a Markov network of local image patches connected to their nearest neighbors, gives a lattice structured Markov network as shown in  FIGS. 2   a-b , also called a Markov random field. This type of network contains many loops. 
   Another method for inference in Markov networks applies the local message-passing rules derived for trees and chains in a network, even though the network may contain loops, see Weiss, “Belief propagation and revision in networks with loops,” Technical Report 1616, MIT AI Lab, 1997. This is referred to as the “loopy” belief propagation method in the description below, although it should be clearly understood that the “loopy” method is nothing more than the “standard” belief propagation method applied to a network with loops. When such a procedure converges, it can yield an approximate determination of the marginal probabilities. However, the loopy method sometimes gives too poor an approximation to the marginal probabilities, and often does not even converge. In the latter case, the approximation gives no single answer for the desired marginal probabilities. 
   Therefore, it is desired to provide a method for determining marginal probabilities in Markov networks that is both relatively fast and more accurate than the loopy method. Furthermore, it is desired to provide a method for networks with loops that converges more reliably than the prior art loopy belief propagation method. 
   SUMMARY OF THE INVENTION 
   The present invention provides a method for determining the probabilities of nodes in a network model of a complex probabilistic system. More particularly, the method determines desired marginal or maximum a posteriori probabilities in networks with loops. The method uses a message-passing scheme, appropriate for networks with loops, which is more accurate and typically converges more reliably and in fewer iterations than prior art loopy belief propagation methods. 
   The invention describes a class of procedures in which computational cost and accuracy can be traded off against each other, allowing a user of the invention to select more computation for more accuracy in a particular application of the invention. 
   The invention has two major advantages over the prior art loopy belief propagation method. First, the invented method normally gives much more accurate answers for the desired marginal probabilities. Second, the invented method can converge to a single answer in cases where the loopy method does not. 
   Instead of finding the marginal probability at a node, one embodiment of the invention finds the states at each node which approximately maximize the probability of the entire network. Thus, the invention provides a novel way to approximate both the marginal probabilities and MAP states in Markov networks. 
   Many Markov network problems of interest are known to be NP-hard problems. A problem is NP-hard when it is intrinsically harder than those problems that can be solved by a Turing machine in nondeterministic polynomial time. When a decision version of a combinatorial optimization problem belongs to the class of NP-complete problems, which includes the traveling salesman problem described above, an optimization version is NP-hard. The invented method yields fast, approximate solutions for some of these very difficult optimization problems. 
   More particularly, the invention provides a method for determining marginal probabilities of states of a system represented by a model. The model includes nodes connected by links. Each node represents possible states of a corresponding part of the system, and each link represents statistical dependencies between possible states of related nodes. 
   The nodes are grouped into arbitrary sized clusters such that every node is included in at least one cluster and each link is completely contained in at least one cluster. Based on the arbitrary sized cluster, messages are defined. Each message has associated sets of source nodes and destination nodes, a value for each state of the destination nodes and a rule that depends on other messages and on selected links connecting the source nodes and destination nodes. The values of each message are updated using the associated rule until a termination condition is reached, at which point the probabilities of the states of the system are determined from the values of the messages. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  is graph of a network with four nodes and links; 
       FIG. 2   a  is a graph of a square network; 
       FIG. 2   b  is a graph of a triangular network; 
       FIG. 3  is a flow diagram of a method for propagating beliefs in a network according to a preferred embodiment of the invention; 
       FIGS. 4   a-c  are graphs of nodes grouped into arbitrary sized intersecting clusters; 
       FIG. 5  is a graph of a nine node network grouped into four intersecting clusters; 
       FIG. 6  is a flow diagram of detailed steps of the method according to the invention; 
       FIG. 7  is a graph of a hierarchy of regions; 
       FIGS. 8   a-c  are graphs of belief propagation for a rectangular network; 
       FIG. 9  is a graph of an identity for the belief propagation of  FIGS. 8   a-c;    
       FIG. 10  is a graph of another identity of the belief propagation of  FIG. 7 ; 
       FIGS. 11   a-c  are graphs of belief propagation for a triangular network; 
       FIG. 12  is a graph of an identity for the belief propagation of  FIGS. 11   a-c;    
       FIG. 13  is a graph of another identity for the belief propagation of  FIGS. 11   a-c;    
       FIG. 14  is graph of a nine node network grouped into four clusters; 
       FIG. 15   a  is a graph of the network of  FIG. 14  with the nodes grouped into four clusters; 
       FIG. 15   b  is a graph of a super-node network showing standard message passing; 
       FIG. 15   c  is a graph showing standard and normalized message passing; 
       FIG. 15   d  is a graph of a network with nine super-nodes; and 
       FIG. 16  is a flow diagram of an alternative embodiment of the belief propagation method according to the invention. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   Introduction 
   Our invention builds on the “cluster variational method” for analyzing cooperative phenomena in statistical physics, see for example, the special issue in honor of R. Kikuchi, Progress in Theoretical Physics Supplements, vol. 115, 1994. 
   A physical system is often modeled in statistical mechanics as a Markov network, where the states of the nodes in the network correspond to the physical states of the particles or spins in the physical system. The cluster variational method derives approximations to the “Gibbs free energy” of a physical system. We refer to these as “Kikuchi approximations” to the Gibbs free energy, or the “Kikuchi free energy.” From a Kikuchi approximation to the Gibbs free energy, one can determine properties of a physical system, such as magnetization, specific heat, or the critical temperature for a magnetic spin system. 
   The simplest Kikuchi approximation derived with the cluster variational method corresponds to an approximation first proposed by Bethe, see Bethe, Proc. Roy. Soc. (London) A 150 (1935) 552. The loopy belief propagation method, when it converges, gives marginal probabilities identical to those obtained from the Bethe approximation. 
   Solutions obtained from propagation rules according to our invention are equivalent to solving the appropriate physical system under the corresponding Kikuchi approximation. The method of minimizing the Kikuchi free energy directly will therefore give identical results to our method, but such a direct minimization will be extremely slow and be plagued by the problem of convergence to inappropriate local minimal in the free energy surface. Thus, physics calculations made with more complicated Kikuchi approximations have typically only been tractable for homogeneous models of physical systems. As an advantage, our belief propagation method is also practical for heterogeneous models of physical systems where the nodes of the model have arbitrary topology and interdependencies. 
   Calculation of Marginal Probabilities by Kikuchi Free Energy Minimization 
   As shown in  FIG. 3 , we begin with a network  300  representing a system or model. Typically, the network is constructed ahead of time by an “expert” in the art field in which the model operates. It is not our job to construct the model; instead, we provide a method for using the model, even if the model is heterogeneous and includes many loops. For example, in a medical diagnosis system, the nodes can represent clinical findings, physiological and psychological conditions, laboratory results, pathologies, etc. Here, the goal may be to use the model to make the best (most probable) diagnosis given observations made for a particular patient. In an error-correcting coding system, the nodes represent source bits or parity bits, and the links represent the required relationships between the bits. Here, the goal may be to use the model to decode a block of bits that has been corrupted by noise. 
   The model includes a plurality of nodes  301 . A random variable s at each node takes on one of a discrete set of states, or it may take on a continuum of states. The nodes are connected to others by links  302  to form the network model  300 . Typically, a link connects two nodes, however higher-order links can connect more than two nodes. The network model  300  can represent a magnetic spin system, a medical diagnosis system, an image-processing system, a speech recognition system, a genetic regulatory network, a decoding system, or other complex real-world systems. 
   By definition, for a Markov network with pair-wise statistical dependencies between nodes, the probability of a particular assignment of values s at the nodes is given by: 
                 P   ⁡     (       s   1     ,     s   2     ,     …   ⁢           ⁢     s   N         )       =       1   Z     ⁢       ∏     i   ,   j       ⁢         ϕ   ij     ⁡     (       s   i     ,     s   j       )       ⁢       ∏   i     ⁢     ψ   ⁡     (     s   i     )                 ,           [   3   ]             
 
where the first product runs over all the linked neighboring nodes, i and j.
 
   The φ compatibility matrices represent the statistical dependencies between the nodes, as represented by the links  302  in the network model  300 . For example, in a medical diagnosis system, one node might represent a symptom, and the nodes that it is linked to are related symptoms or diseases. The numerical values of the compatibility matrices φ, represent the strength of the relation between specific nodes. For example, in a medical diagnosis model, some symptoms might be strongly correlated with certain diseases, i.e. a strong statistical dependency, while other symptoms might only have weak statistical correlation with other symptoms or diseases. 
   For some systems, it may be desired to represent the statistical dependencies between the states of the nodes by compatibility functions (“links”) that are higher-order tensors. For example, if the states of nodes i, j, and k are mutually statistically dependent, but those dependencies cannot be expressed in terms of pair-wise interactions, then we introduce the tensor φ ijk (s i ,s j ,s k ) to represent those dependencies. The over-all probability of the system would then also include the product over all higher-order tensors as well. The method we describe here will also apply to systems with such higher-order links between nodes. All that is necessary is to include terms that arise from the higher-order links in the “energy” and “region energies” that we describe below. 
   The ψ functions represent the “evidence” that each node is in any particular one of its states before we consider any of the other nodes. While the φ functions will normally never change, the ψ functions will typically change from one use of the model to another. For example, in the case of a medical diagnosis model, the ψ i (s i ) function represents, for a specific patient, the results of a given test. To use the same model for a different patient, we use different evidence, represented through the ψ functions, but we do not change the φ functions, which represent the relationships between different symptoms, diseases, tests, etc. 
   In equation [3], Z is a normalization constant that insures that the sum of the probabilities of all possible states of the overall system is equal to one. 
   In order to describe the “Kikuchi free energy” of the model, it is helpful to define some additional functions, which are motivated by common conventions from statistical physics. We define the “bond strength” J ij (s i ,s j ) between two nodes i and j by:
 
φ ij ( s   i   ,s   j )= e   J     ij      (s     i     ,s     j     )/T   [4]
 
where T is a parameter called the “temperature.” We define the “field” h i (s i ) at the node i by:
 
ψ i ( s   i )= e   −h     i     (s     i     )/T   [5]
 
   In terms of these variables, we have: 
                 P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       =       1   Z     ⁢     e       -     E   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )         /   T           ,           [   6   ]             
 
where E is the “energy”: 
               E   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       =         ∑   ij     ⁢       J   ij     ⁡     (       s   i     ,     s   j       )         +       ∑   i     ⁢         h   i     ⁡     (     s   i     )       .                 [   7   ]             
 
   In statistical physics, equation [6], which is equivalent to the original definition [3] of the Markov model, is known as “Boltzmann&#39;s Law,” and the normalization constant Z is called the “partition function.” The partition function is defined explicitly by 
             Z   =       ∑       s   1     ,     s   2     ,   …   ⁢           ,     s   N         ⁢       e       -     E   ⁡     (       S   1     ,     S   2     ,   …   ⁢           ,     S   N       )         /   T       .               [   8   ]             
 
   Following the conventions of statistical physics, we define a quantity called the “Gibbs free energy.” The Gibbs free energy G is a function of the probability distribution P(s 1 ,s 2 , . . . ,s N ). By design, G is defined so that if it is minimized as a function P, then Boltzmann&#39;s Law is automatically obeyed. G is defined by: 
                     G   ⁡     (       P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       ,   γ     )       =       ⁢     U   -     T   ⁢           ⁢   S     +                     ⁢       γ   ⁡     [     1   -       ∑       s   1     ,     s   2     ,   …   ⁢           ,     s   N         ⁢     P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )           ]       .                   [   9   ]             
 
   Here, U is the expected value of the energy, also called the “internal energy”: 
             U   =       ∑       s   1     ,     s   2     ,   …   ⁢           ,     s   N         ⁢       E   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       ⁢     P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )                   [   10   ]             
 
and S is the entropy: 
             S   =     -       ∑       s   1     ,     s   2     ,     …   ⁢           ⁢     s   N           ⁢       P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       ⁢       ln   ⁡     (     P   ⁡     (       s   1     ,     s   2     ,   …   ⁢           ,     s   N       )       )       .                   [   11   ]             
 
   The last term in equation [9] is a Lagrange multiplier term designed to enforce the constraint that the sum of the probabilities over all states is equal to one. In order to insure that this constraint is satisfied, we set the partial derivative of G with respect to the Lagrange multiplier γ equal to zero. 
   If we differentiate the Gibbs free energy G with respect to the probability distribution P and the Lagrange multiplier y, and set those partial derivatives equal to zero, then we recover Boltzmann&#39;s Law. Thus, to understand physical systems, physicists often try to calculate and differentiate the Gibbs free energy. 
   For a large system, it is intractable to calculate G exactly, so Bethe, Kikuchi, and many others have developed approximation schemes. In these schemes, one determines exactly the Gibbs free energy over some small clusters of nodes of the network, and then approximates the total Gibbs free energy as a sum over many small clusters of nodes, correcting for over-counting in regions where the different clusters overlap. In the Bethe approximation, the clusters are precisely those pairs of nodes that are linked in the Markov network, while Kikuchi&#39;s more accurate approximations, also called the “cluster variational method,” allow for clusters of a larger size. 
   The cluster variational method errs by missing contributions to the Gibbs free energy that arise from high-order correlations between nodes that cannot be described in terms of the chosen clusters or intersections of clusters. The larger the size of the small clusters, the smaller the error. 
   In principle, the cluster variational method allows for arbitrary clusters on arbitrary Markov networks. In practice, however, most previous computations involving minimization of a Kikuchi free energy were restricted to symmetrically placed clusters over a homogenous network. Computations on inhomogeneous networks have been performed, but only for the Bethe approximation, see Morita, Physica 98A (1979) 566. 
   By “homogenous” networks, we mean networks for which the nodes are arranged in some regular repeated pattern, and the interactions between the nodes depends only on their position in that pattern. Many magnetic spin systems are “homogenous” in this sense, but most of the other types of systems that are modeled with Markov networks, such as the example of a medical diagnosis system, are not homogenous. 
   Previous prior art Kikuchi free energy minimization calculations were restricted to symmetrically placed clusters over a homogeneous network because, before our invention, there was no practical way to quickly minimize a Kikuchi free energy defined for arbitrary clusters over an inhomogeneous Markov network of arbitrary topology. 
   Using the Kikuchi approximate form for the total Gibbs free energy, we can approximately calculate the marginal probabilities of the variables at the nodes, and also the marginal probabilities of collections of nodes. We extend this technique to develop a message-passing method that converges to solutions corresponding to a Kikuchi approximation of the Gibbs free energy. A message-passage method, as an advantage over the prior art Kikuchi free energy calculations, is very much faster and more practical for inhomogeneous networks. 
   Kikuchi Free Energy Calculation for Simple Example 
   We use  FIGS. 4   a-c  to illustrate our generalized message-based belief propagation method. This example network shows how we develop a message-passing method that has a corresponding Kikuchi approximation result as a fixed point of the messages. That is to say, our message-passing method will converge to a solution that is equivalent to the solution of the Kikuchi approximation. 
     FIG. 4   a  is a graph of many nodes grouped into three clusters. The clusters intersect each other. The nodes and their links are not shown, and indeed, the number of nodes per cluster can be quite large. In real world physical systems, one usually chooses many more than three clusters for a Kikuchi approximation.  FIGS. 4   b-c  depict two possible instantiations of the three clusters and their intersections. 
   As described above with respect to  FIG. 3 , we group  310  the nodes of the network  300  into arbitrary intersecting clusters  311 . A cluster is said to be intersecting if a single node appears in more than one cluster. Because we do an arbitrary clustering, we can focus on regions of the model that might be more significant to an exact solution. We require that every node is included in at least cluster. We also require that every link in the Markov network is completely included in at least one cluster. The first constraint ensures that our clusters represent and consider all nodes of the model, and the second constraint ensures that the clusters will intersect. 
     FIG. 4   a  shows abstractly three clusters of nodes (regions  1 ,  2 , and  3 ), and their intersections (regions  12 ,  31 , and  23 ), and intersections of intersections (region  123 ). 
   We use the following terminology. The largest regions are referred to as “clusters.” The clusters, along with their intersections, and the intersections of those intersections, and so on, are referred to collectively as “regions.” A “sub-region” of region r is a region that consists of a proper subset of the nodes in region r. Region r is a “super-region” of region s if and only if region s is a sub-region of region r. 
   The number of nodes in each cluster can vary, and be different from each other. As stated before larger clusters will yield better results than small clusters albeit at a greater computational cost. Note that region  12  is interpreted to include region  123 , just as region  1  also includes region  123 . 
   In equation [12] below, we approximate the total Gibbs free energy for the system  300  by the sum of the free energies of each of the clusters. Then, we include correction terms by subtracting the free energy of intersection regions where we over-counted the free energy. We may include additional correction terms for the over-counted intersections of the intersection regions, etc. In addition, we impose, with Lagrange multipliers, the additional constraints that the probabilities of each region sum to one, and that the probabilities have the correct marginalization relationships with respect to each other. 
   We express the Gibbs free energy in terms of the probabilities of each of the regions. We let α i  be a particular assignment of node values within the cluster region i. This is what we called s 1 , s 2 , . . . , s N  in equation [3] above. Our notation for region intersections is to concatenate the indices of the intersecting regions, so α ijk  is a particular assignment of node values within the region of intersection of regions i, j, and k. 
   The “region energy” E(α i ) includes those terms in the overall energy that can be attributed to nodes or links contained entirely in the region i, when the nodes in the region are set to the particular values denoted by α i . Note that if there are higher-order tensor “links” in the definition of the system, the region energy will still contain those links that are contained. 
   The “region probability” P(α i ) is the marginal probability that the nodes in cluster i take on the particular values denoted by α i . In our notation, the normalization constraint for region i is Σ α     i   P(α i )=1. That is, the sum over the probabilities of all possible value assignments to the nodes of region i is one. An analogous equation holds for all regions. These are the Lagrange multiplier constraints γ in equation [12], below. 
   The second set of constraints for the Gibbs free energy in equation [12] are the marginalization constraints, associated with Lagrange multipliers λ. The Lagrange multipliers impose consistency constraints between the probabilities of the regions and their intersecting sub-regions. The probability of a region, marginalized over all the nodes in the region not in some intersection region, must equal the marginal probability of the nodes in that intersection region. In our notation, Σ α     i\j   P(α i )=P(α ij ), where Σ α     i\j    means the sum over all nodes in region i that are not in region j. 
   For the three clusters of nodes shown in  FIGS. 4   b-c , we express the Gibbs free energy in the Kikuchi approximation as G 1,2,3 . We have three sets of U−ST terms, first a sum over states α i  for the cluster region free energies, second the terms involving α ij  where we subtract over-counted intersection regions, and a third term involving α 123  where we correct for over-subtracting that intersection region. After all these corrections are made, each subset of each region is counted exactly once, as it should be. 
                     G     1   ,   2   ,   3       =       ⁢         (     U   -     S   ⁢           ⁢   T       )     ⁢           ⁢   terms     +     γ   ⁢           ⁢   constraints     +     λ   ⁢           ⁢   constraints                   =       ⁢         ∑     α   1       ⁢       P   ⁡     (     α   1     )       ⁢     E   ⁡     (     α   1     )           +       ∑     α   2       ⁢       P   ⁡     (     α   2     )       ⁢     E   ⁡     (     α   2     )           +       ∑     α   3       ⁢       P   ⁡     (     α   3     )       ⁢     E   ⁡     (     α   3     )           +                     ⁢       T   ⁢       ∑     α   1       ⁢       P   ⁡     (     α   1     )       ⁢     ln   ⁡     (     P   ⁡     (     α   1     )       )             +     T   ⁢       ∑     α   2       ⁢       P   ⁡     (     α   2     )       ⁢     ln   ⁡     (     P   ⁡     (     α   2     )       )             +                     ⁢       T   ⁢       ∑     α   3       ⁢       P   ⁡     (     α   3     )       ⁢     ln   ⁡     (     P   ⁡     (     α   3     )       )             -       ∑     α   12       ⁢       P   ⁡     (     α   12     )       ⁢     E   ⁡     (     α   12     )           -                     ⁢         ∑     α   23       ⁢     P   ⁢     (     α   23     )     ⁢     E   ⁡     (     α   23     )           -       ∑     α   31       ⁢     P   ⁢     (     α   31     )     ⁢     E   ⁡     (     α   31     )           -                     ⁢       T   ⁢       ∑     α   12       ⁢       P   ⁡     (     α   12     )       ⁢   ln   ⁢     (     P   ⁡     (     α   12     )       )           -     T   ⁢       ∑     α   23       ⁢       P   ⁡     (     α   23     )       ⁢   ln   ⁢     (     P   ⁡     (     α   23     )       )           -                     ⁢       T   ⁢       ∑     α   31       ⁢       P   ⁡     (     α   31     )       ⁢   ln   ⁢     (     P   ⁡     (     α   31     )       )           +     T   ⁢       ∑     α   123       ⁢       P   ⁡     (     α   123     )       ⁢     E   ⁡     (     α   123     )             +                     ⁢       T   ⁢       ∑     α   123       ⁢       P   ⁡     (     α   123     )       ⁢     ln   ⁡     (     P   ⁡     (     α   123     )       )             +       γ   1     ⁡     [     1   -       ∑     α   1       ⁢     P   ⁡     (     α   1     )           ]       +                     ⁢         γ   2     ⁡     [     1   -       ∑     α   2       ⁢     P   ⁡     (     α   2     )           ]       +       γ   3     ⁡     [     1   -       ∑     α   3       ⁢     P   ⁡     (     α   3     )           ]       +                     ⁢         γ   12     ⁡     [     1   -       ∑     α   12       ⁢     P   ⁡     (     α   12     )           ]       +       γ   23     ⁡     [     1   -       ∑     α   23       ⁢     P   ⁡     (     α   23     )           ]       +                     ⁢         γ   31     ⁡     [     1   -       ∑     α   31       ⁢     P   ⁡     (     α   31     )           ]       +       γ   123     ⁡     [     1   -       ∑     α   123       ⁢     P   ⁡     (     α   123     )           ]       +                     ⁢         ∑     α   12       ⁢         λ     1   ⁢   \12       ⁡     (     α   12     )       ⁡     [       P   ⁡     (     α   12     )       -       ∑     α     1   ⁢   \12         ⁢     P   ⁡     (     α   1     )           ]         +                     ⁢         ∑     α   12       ⁢         λ     2   ⁢   \12       ⁡     (     α   12     )       ⁡     [       P   ⁡     (     α   12     )       -       ∑     α     2   ⁢   \12         ⁢     P   ⁡     (     α   2     )           ]         +                     ⁢         ∑     α   23       ⁢         λ     2   ⁢   \23       ⁡     (     α   23     )       ⁡     [       P   ⁡     (     α   23     )       -       ∑     α     2   ⁢   \23         ⁢     P   ⁡     (     α   2     )           ]         +                     ⁢         ∑     α   23       ⁢         λ     3   ⁢   \23       ⁡     (     α   23     )       ⁡     [       P   ⁡     (     α   23     )       -       ∑     α     3   ⁢   \23         ⁢     P   ⁡     (     α   3     )           ]         +                     ⁢         ∑     α   31       ⁢         λ     3   ⁢   \31       ⁡     (     α   31     )       ⁡     [       P   ⁡     (     α   31     )       -       ∑     α     3   ⁢   \31         ⁢     P   ⁡     (     α   3     )           ]         +                     ⁢         ∑     α   31       ⁢         λ     1   ⁢   \31       ⁡     (     α   31     )       ⁡     [       P   ⁡     (     α   31     )       -       ∑     α     1   ⁢   \31         ⁢     P   ⁡     (     α   1     )           ]         +                     ⁢         ∑     α   123       ⁢         λ     \12   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁡     [       P   ⁡     (     α   123     )       -       ∑     α     12   ⁢   \   ⁢           ⁢   123         ⁢     P   ⁡     (     α   12     )           ]         +                     ⁢         ∑     α   123       ⁢         λ     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁡     [       P   ⁡     (     α   123     )       -       ∑     α     23   ⁢   \   ⁢           ⁢   123         ⁢     P   ⁡     (     α   23     )           ]         +                     ⁢       ∑     α   123       ⁢           λ     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁡     [       P   ⁡     (     α   123     )       -       ∑     α     31   ⁢   \   ⁢           ⁢   123         ⁢     P   ⁡     (     α   31     )           ]       .                     [   12   ]             
 
   One point about the marginalization constraints. One might wonder why we do not also have terms like 
         ∑     α   123       ⁢         λ     1   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁡     [       P   ⁡     (     α   123     )       -       ∑     α     1   ⁢   \   ⁢           ⁢   123         ⁢     P   ⁡     (     α   1     )           ]           
 
which enforce that region  1  properly marginalizes down to region  123 . We omit these terms because they are redundant with the marginalization equations already included in G 1,2,3.  
 
   Marginalization is a linear operator. Of the three possible constraints relating regions i, ij, and ijk, that region i marginalize down to region ij, that ij marginalize down to ijk, and that region i marginalize down to ijk, we only need two, and the third is linearly dependent on the other two equations. 
   The Kikuchi approximation to the Gibbs free energy can be generalized to the case of an arbitrary collection of regions in a relatively straightforward way, but we need to establish some additional more notation. Let r denote a region chosen from the set of all relevant regions R. Let S(r) denote the set of sub-regions of r and T(r) denote the set of super-regions of r. Define a “direct sub-region” of r as a sub-region that does not have a super-region that is also a sub-region of r. Thus, in our three cluster example, regions  12  and  13  are direct sub-regions of region  1 , but region  123  is not. Let S d (r) denote the set of direct sub-regions of r and T d (r) denote the set of direct super-regions of r. Associate with each region r a “over-counting number” d r , defined recursively by 
               d   r     =     1   -       ∑     t   ∈     T   ⁡     (   r   )           ⁢       d   t     .                 [   13   ]             
 
   The largest regions with no super-regions are defined to have a double-counting number of one. In the three-cluster case, we have d 1 =d 2 =d 3 =1, d 12 =d 23 =d 31 =−1, and d 123 =1. The over-counting number is needed to insure that each link is ultimately counted exactly once. 
   The generalization of equation [12] for the Kikuchi approximation to the Gibbs free energy for the case of an arbitrary collection of regions is: 
                   G   =       ⁢       ∑     r   ∈   R       ⁢     [         d   r     ⁡     (       U   r     -     T   ⁢           ⁢     S   r         )       +       γ   r     ⁡     [     1   -       ∑     α   r       ⁢     P   ⁡     (     α   r     )           ]       +                           ⁢       ∑     s   ∈       S   d     ⁡     (   r   )           ⁢       ∑     α   s       ⁢         λ     r   ⁢   \   ⁢   s       ⁡     (     α   s     )       ⁡     [       P   ⁡     (     α   s     )       -       ∑     α     r   ⁢   \   ⁢   s         ⁢     P   ⁡     (     α   r     )           ]           ]     ,                 [   14   ]             
 
where U r  and S r  are the internal energy and entropy of the region r.
 
   We want to find the cluster region probabilities that minimize the Kikuchi free energy while obeying the marginalization and normalization constraints. These probabilities are the correct marginal probabilities under the Kikuchi approximation. 
   To find equations for those probabilities, we differentiate equation [14] with respect to each of the region probabilities for each possible assignment of values to a region and set the result to zero. The resulting equations, illustrated for the three-cluster example of  FIG. 4   a , are:
 
 E (α 1 )+ T+T  ln  P (α 1 )+γ 1 =λ 1\12 (α 12 +λ 1\31 (α 31 )  [15]
 
 E (α 2 )+ T+T  ln  P (α 2 )+γ 2 =λ 2\12 (α 12 )+λ 2\23 (α 23 )  [16]
 
 E (α 3 )+ T+T  ln  P (α 3 )+γ 3 =λ 3\23 (α 23 )+λ 2\31 (α 31 )  [17]
 
− E (α 12 )− T−T  ln  P (α 12 )+γ 12 =−λ 1\12 (α 12 )−λ 2\12 (α 12 )+λ 12\123 (α 123 )  [18]
 
 −E (α 23 )− T−T  ln  P (α 23 )+γ 23 =−λ 2\23 (α 23 )−λ 3\23 (α 23 )+λ 23\123 (α 123 )  [19]
 
− E (α 31 )− T−T  ln  P (α 31 )+γ 31 =−λ 1\31 (α 31 )−λ 3\31 (α 31 )+λ 31\123 (α 123 )  [20]
 
 E (α 123 )+ T+T  ln  P (α 123 )+γ 123 =−λ 12\123 (α 123 )−λ 12\123 (α 123 )−λ 31\123 (α 123 )  [21]
 
Exponentiating both sides and rearranging terms of each equation, we have the following set of equations for the marginal posterior probabilities: 
               P   ⁡     (     α   1     )       =       k   1     ⁢     exp   ⁡     (       -     E   ⁡     (     α   1     )         T     )       ⁢     exp   ⁡     (           λ     1   /   12       ⁡     (     α   12     )       +       λ     1   ⁢   \31       ⁡     (     α   31     )         T     )                 [   22   ]                 P   ⁡     (     α   2     )       =       k   2     ⁢     exp   ⁡     (       -     E   ⁡     (     α   2     )         T     )       ⁢     exp   ⁡     (           λ     2   /   12       ⁡     (     α   12     )       +       λ     2   ⁢   \23       ⁡     (     α   23     )         T     )                 [   23   ]                 P   ⁡     (     α   3     )       =       k   3     ⁢     exp   ⁡     (       -     E   ⁡     (     α   3     )         T     )       ⁢     exp   ⁡     (           λ     3   /   23       ⁡     (     α   23     )       +       λ     3   ⁢   \31       ⁡     (     α   31     )         T     )                 [   24   ]                 P   ⁡     (     α   12     )       =       k   12     ⁢     exp   ⁡     (     -       E   ⁡     (     α   12     )       T       )       ⁢     exp   (                 λ     1   /   12       ⁡     (     α   12     )       +       λ     2   ⁢   \12       ⁡     (     α   12     )       -                 λ     12   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )             T     )               [   25   ]                 P   ⁡     (     α   23     )       =       k   23     ⁢     exp   ⁡     (     -       E   ⁡     (     α   23     )       T       )       ⁢     exp   (                 λ     2   /   23       ⁡     (     α   23     )       +       λ     3   ⁢   \23       ⁡     (     α   23     )       -                 λ     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )             T     )               [   26   ]                 P   ⁡     (     α   31     )       =       k   31     ⁢     exp   ⁡     (     -       E   ⁡     (     α   31     )       T       )       ⁢     exp   (                 λ     3   /   31       ⁡     (     α   31     )       +       λ     1   ⁢   \31       ⁡     (     α   31     )       -                 λ     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )             T     )               [   27   ]                   P   ⁡     (     α   123     )       =       k   123     ⁢     exp   ⁡     (     -       E   ⁡     (     α   123     )       T       )       ⁢     exp   (               -       λ     12   /   123       ⁡     (     α   123     )         -                   λ     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       -                 λ     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )             T     )         ,           [   28   ]             
 
where the k&#39;s are normalization constants, different for each equation, that normalize each marginal probability. Each of these equations is actually a collection of equations. Thus, if we focus on equation [22], we get one equation for each instantiation of α 1 . On the right hand side of this equation, α 12  and α 31  are completely determined by α 1 , because regions  12  and  31  are sub-regions of region  1 .
 
   Of course, we also need to differentiate the Gibb&#39;s free energy with respect to the λ and γ Lagrange multipliers. Doing that gives us the desired marginalization and normalization conditions for the region probabilities. 
   From Lagrange Multipliers to Messages 
   In the previous section, we derived a set of self-consistent equations for region probabilities and Lagrange multipliers by differentiating the Kikuchi approximation of the Gibbs free energy. These equations are a solution to the problem of finding marginal posterior probabilities at the level of the Kikuchi approximation. 
   In our new method, we develop equivalent and more convenient formulations of the same solution, in terms of a convergent “message-passing” method. By defining  320  the Lagrange multipliers, see step  320 , in terms of another set of quantities, called “messages,” we obtain a different but equivalent set of equations for the cluster probabilities. 
   Our method works by treating the self-consistent equations as message update rules that are iterated until a termination condition is reached, for example, a fixed number of iterations, or the solution converges  330 , at which point the marginal posterior probabilities  332  can be determined from the converged messages  340 . Before the first update, we assign initial values  331  to the messages  321 . The initial values can be random or special values, e.g., all random positive numbers, or all ones. 
   In general, there are many equivalent sets of message definitions and message-update rules that correspond to the same Kikuchi approximation. Some particular message definitions and message-update rules, which we describe later, have particularly nice properties and reduce to the already known ordinary message-passing methods when applied to the Bethe approximation. In this section, we want to describe the general properties that should be satisfied by messages so that any particular message-passing method is equivalent to the corresponding Kikuchi approximation. 
   We have used the marginalization relations to relate region probabilities to probabilities of their intersection regions. For the three-cluster example, equations [22]-[28] describe how the probabilities are related to the region energies, and the normalization and marginalization Lagrange multipliers. We ignore the normalization Lagrange multipliers (the γ&#39;s) for now, knowing that these simply give a multiplicative scalar which normalizes the final probabilities. 
   Our goal is to express messages in terms of the λ Lagrange multipliers. It will turn out that the marginalization constraint relations will then give us a set of fixed point equations for the messages, which we will interpret as the message update rules  321 . 
   We stack all of the λ Lagrange multipliers to create a vector {right arrow over (λ)}. In this vector, there is one λ Lagrange multiplier for each linearly independent marginalization constraint, times the number of different possible variable assignments in the cluster region being marginalized down. For our three cluster example, the vector {right arrow over (μ)} includes nine sets of Lagrange multipliers: λ 1\12 (α 12 ), λ 1\31 (α 31 ), λ 2/12 (α 12 ), λ 2/23 (α 23 ), λ 3/23 (α 23 ), λ 3/31 (α 31 ), λ 12/123 (α 123 ), λ 23/23 (α 123 ), and λ 31/123 (α 123 ), which we take to be stacked in that order. The total dimensionality of the vector {right arrow over (λ)} is D λ =2D 12 +2D 23 +2D 31 +3 D 123 , where, for example, D 12  is the dimensionality of α 12 . 
   In our example, equations [22-28] give the cluster probabilities in terms of the Lagrange multipliers {right arrow over (λ)}. We take the logarithm of all these equations, and define the local quantities 
     L (α)= E (α)+ T  ln  P (α)  [29] 
   for each cluster. Then we summarize these equations by:
 
 {right arrow over (L)}=Aλ,   [30]
 
where {right arrow over (L)} is a vector of the L&#39;s in the seven regions taken in the order  1 ,  2 ,  3 ,  12 ,  23 ,  31 , and  123 , and {right arrow over (L)} has dimensionality:
 
 D   L   ≡D   1   +D   2   +D   3   +D   12   +D   23   +D   31   +D   123 .
 
A is a matrix with D L  rows and D λ  columns, but it has a special block form, which we express as: 
             A   =       (           1   ~           1   ~           0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           0   ~               0   ~           0   ~           1   ~           1   ~           0   ~           0   ~           0   ~           0   ~           0   ~               0   ~           0   ~           0   ~           0   ~           1   ~           1   ~           0   ~           0   ~           0   ~               1   ~           0   ~           1   ~           0   ~           0   ~           0   ~           -     1   ~             0   ~           0   ~               0   ~           0   ~           0   ~           1   ~           1   ~           0   ~           0   ~           -     1   ~             0   ~               0   ~           1   ~           0   ~           0   ~           0   ~           1   ~           0   ~           0   ~           -     1   ~                 0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           -     1   ~             -     1   ~             -     1   ~             )     .             [   31   ]             
 
   Each entry in this matrix actually denotes a sub-matrix. For example, the {tilde over ( 1 )} in the upper left corner denotes a sub-matrix of D 1  rows and D 12  columns which is equal to one when the nodes in α 12  agree with the corresponding nodes in α 1 , and is equal to zero otherwise. This becomes clear in a more specific example. 
   If region  1  includes two nodes S a  and S b , and region  2  includes the single node S b , and each node can be in two states that we label “1” and “2,” then α 1  can be in any of the four states S a =1, S b =1; S a =1, S b =2; S a =2, S b =1; S a =2, S b =2 and α 12  can be any of the two states S b =1; S b =2, and the sub-matrix {tilde over (1)} in the top left corner of A is expressed as: 
         (         1       0           0       1           1       0           0       1         )     .       
 
   In general, the self-consistent equations derived from a Kikuchi approximation can be summarized in the form of a matrix equation {right arrow over (L)}=A{right arrow over (λ)} and a set of normalization and marginalization conditions. 
   We desire an alternative formulation for our solution in terms of “messages” and self-consistent message equations. We still use the same normalization and marginalization conditions on the cluster probabilities, but we redefine the Lagrange multipliers A in terms of messages. 
   We store the logarithms of all the messages between the regions in an ordered vector {right arrow over (m)}. To be commensurate with the Lagrange multipliers that we seek to summarize, we normally let the dimensionality of {right arrow over (m)} be the same as the dimensionality of {right arrow over (λ)}. In general, the vector {right arrow over (m)} can have different dimensionality than {right arrow over (λ)}, but the vector needs to span the same sub-space of constraints on the lattice so that we can re-write the Lagrange multiplier {right arrow over (λ)} in terms of messages {right arrow over (m)}. 
   Thus, for our example, we generate sets of logarithms of messages commensurate with {right arrow over (λ)} as m 1\12 (α 12 ), m 1/31 (α 31 ), m 2\12 (α 12 ), m 2\23 (α 23 ), m 3\23 (α 2 3), m 3\31 (α 31 ), M 12\123 (α 123 ), M 23\123 (α 123 ), and m 31\123 (α 123 ). The vector m stores these messages in that order. 
   There is a set of self-consistent equations for the cluster probabilities in terms of the messages where the equations have the matrix form:
 
 L=B{right arrow over (m)},   [32]
 
or equivalently:
 
 A{right arrow over (λ)}=B{right arrow over (m)},   [33]
 
where B is a “selection” matrix that determines the choice of the message-passing method. This matrix is specified below.
 
   The matrix B and the vector {right arrow over (m)} constitute a valid reformulation of the Kikuchi solution as long as the system described by equation [33] has at least one solution that can be written in the form of a matrix equation:
 
 {right arrow over (m)}=C{right arrow over (λ)}.   [34]
 
   Any valid reformulation of the Kikuchi solution can be used as the basis for our message-passing method. 
   To illustrate this idea, we return to our three-cluster example of  FIG. 4   a , for which we have already chosen the vector {right arrow over (m)}. We can now choose many different matrices B, but we use one that arises from a scheme that we describe in more detail below. 
   Recall that the m&#39;s defined above are the logarithms of messages, which we denote by M&#39;s. We now set the marginal posterior probabilities of the regions to obey the set of equations: 
                     ⁢       P   ⁡     (     α   1     )       =       k   1     ⁢     exp   ⁡     (     -       E   ⁡     (     α   1     )       T       )       ⁢       M     3   ⁢   \31       ⁡     (     α   31     )       ⁢       M     2   ⁢   \12       ⁡     (     α   12     )       ⁢       M     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                   [   35   ]                       ⁢       P   ⁡     (     α   2     )       =       k   2     ⁢     exp   ⁡     (     -       E   ⁡     (     α   2     )       T       )       ⁢       M     1   ⁢   \12       ⁡     (     α   12     )       ⁢       M     3   ⁢   \23       ⁡     (     α   23     )       ⁢       M     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                   [   36   ]                       ⁢       P   ⁡     (     α   3     )       =       k   3     ⁢     exp   ⁡     (     -       E   ⁡     (     α   3     )       T       )       ⁢       M     1   ⁢   \31       ⁡     (     α   31     )       ⁢       M     2   ⁢   \23       ⁡     (     α   23     )       ⁢       M     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                   [   37   ]                 P   ⁡     (     α   12     )       =       k   12     ⁢     exp   ⁡     (     -       E   ⁡     (     α   12     )       T       )       ⁢       M     1   ⁢   \12       ⁡     (     α   12     )       ⁢       M     2   ⁢   \12       ⁡     (     α   12     )       ⁢       M     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁢       M     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                 [   38   ]                 P   ⁡     (     α   23     )       =       k   23     ⁢     exp   ⁡     (     -       E   ⁡     (     α   23     )       T       )       ⁢       M     3   ⁢   \23       ⁡     (     α   23     )       ⁢       M     3   ⁢   \23       ⁡     (     α   23     )       ⁢       M     12   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁢       M     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                 [   39   ]                 P   ⁡     (     α   31     )       =       k   31     ⁢     exp   ⁡     (     -       E   ⁡     (     α   31     )       T       )       ⁢       M     1   ⁢   \31       ⁡     (     α   31     )       ⁢       M     3   ⁢   \31       ⁡     (     α   31     )       ⁢       M     123   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁢       M     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )                 [   40   ]                   p   ⁡     (     α   123     )       =       k   123     ⁢     exp   ⁡     (     -       E   ⁡     (     α   123     )       T       )       ⁢       M     12   ⁢   \   ⁢           ⁢   123       ⁡     (     α   23     )       ⁢       M     23   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )       ⁢       M     31   ⁢   \   ⁢           ⁢   123       ⁡     (     α   123     )           ,           [   41   ]             
 
where again the k&#39;s are normalization constants that vary for each equation, as for equations [22-28] above.
 
   Taking the logarithm of these equations, and recalling the order of the m&#39;s given above, we see that equations [35-41] are equivalent to the choice 
             B   =       (           0   ~           0   ~           1   ~           0   ~           0   ~           1   ~           0   ~           1   ~           0   ~               1   ~           0   ~           0   ~           0   ~           1   ~           0   ~           0   ~           0   ~           1   ~               0   ~           1   ~           0   ~           1   ~           0   ~           0   ~           1   ~           0   ~           0   ~               1   ~           0   ~           1   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~               0   ~           0   ~           0   ~           1   ~           1   ~           0   ~           1   ~           0   ~           1   ~               0   ~           1   ~           0   ~           0   ~           0   ~           1   ~           1   ~           1   ~           0   ~               0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~           1   ~           )     .             [   42   ]             
 
   The choice of B and {right arrow over (m)} give an equivalent reformulation of the region probabilities when there is a solution to the equation:
 
 {right arrow over (m)}=C{right arrow over (λ)}   [43]
 
where
 
 C=B   +   A,   [44]
 
and B +  is the pseudo-inverse of B. Of course, we can always compute a C matrix as above, but for the matrix to represent a true solution, we must verify that matrix equation
 
 BC=A   [45]
 
is satisfied.
 
   If a solution to A{right arrow over (λ)}=B{right arrow over (m)} exists for a particular choice of matrix B and message vectors {right arrow over (m)}, we discard the original Lagrange multipliers λ and work entirely with the messages. In this case, we guarantee that the self-consistent equations for the messages will ultimately give the same cluster probabilities as those given by the Kikuchi approximation. 
   The next step is to determine the self-consistent equations for the messages. To do this, we need to combine the equations for the cluster probabilities in terms of messages with the marginalization conditions on the cluster probabilities. In terms of our example, we use, for instance, the equation P(α 12 )=Σ α     1\12   P(α 1 ) along with the equations for P(α 1 ) and P(α 12 ) in terms of messages to obtain 
                   M     1   ⁢   \12       ⁢     M     3   ⁢   \   ⁢           ⁢   123         =     k   ⁢       ∑     α     1   ⁢   \12         ⁢       exp   ⁡     (         E   ⁡     (     α   12     )       -     E   ⁡     (     α   1     )         T     )       ⁢     M     3   ⁢   \31               ,           [   46   ]             
 
where k is again a normalization constant. In all, there will be one such equation for each marginalization constraint.
 
   We use the D λ  equations of the form of equation [46] in our message-passing method, by interpreting them as message-update rules. In this interpretation, any messages on the right-hand-side of an equation are treated as the messages at iteration t, while the messages on the left-hand-side of the equation are the desired messages at iteration t+1. We start, for example, with random messages  331 , and at each iteration replace the “old” messages on the right hand side of the equation with “new” messages from the left-hand side. In practice, the messages usually converge to a fixed point. When they converge, the fixed point corresponds to the solution in which we are interested. 
   As for all methods of this type, we can update the messages synchronously or asynchronously, and we can update the messages with some linear combination of the “old” and “new” messages. Our method is an iterative method for the solution of nonlinear equations, and as such, its convergence properties may be improved by using standard prior-art techniques for such methods, see “Iterative Methods for Linear and Nonlinear Equations”, C. T. Kelley, 1995. 
   Regarding the normalization constants k, we could continue to set these normalization constants by requiring that the total cluster probabilities sum to one. However, another procedure that works equally well, and is easy to implement, temporarily scales the messages by requiring that the sum of all the components of a message to equal a given arbitrary constant while iterating the self-consistent equations. Reasonable choices for the constant are one, or the dimensionality of the message. Thus, for instance, we can require that: 
                 ∑     α   12       ⁢       M     1   ⁢   \12       ⁡     (     α   12     )         =   1.           [   47   ]             
 
   After iterating the message equations to convergence, we re-scale the messages to guarantee that the region probabilities are properly normalized. 
   We have described the messages as being associated with a region r and one of its direct sub-regions s. We can equivalently describe the message as going from a set of “source” nodes to a set of “destination” nodes. The “source” nodes are those nodes in region r that are not in direct sub-region s, while the “destination” nodes are those nodes in s. 
   To obtain probability functions defined on a subset of the nodes in a region, one simply marginalizes the region probability by summing it over those nodes that are in the region but not in the subset of interest. 
   We can also determine the maximum a posteriori probability values of the nodes in a region rather than the region probabilities. For the prior-art “standard” belief propagation method, a simple modification suffices to obtain the approximate MAP values of the nodes. The necessary modification is to replace all sums over node values in the message-update rules with the value of the maximum, i.e., the “argmax,” over the same node values. The same modification can also be used to obtain the MAP values of regions for our method. Alternatively, we can use the physics formulation of the Markov network, and set the temperature T to a very small positive constant. In the limit T→0, we recover region probabilities that are entirely dominated by the MAP values of the nodes. 
   The message-update equations for some arbitrary B matrix is not, in general, convenient to solve. With an arbitrary B matrix, one might find that a message between two nodes on one side of the network would depend on messages between other nodes that are very far away. This is an undesirable property, both because it seems unintuitive, and because it means that solving the message-update equations will involve matrix multiplications with very large matrices. Finding the free energy for arbitrary B matrices also involve large matrix multiplications or inversions. 
   In order that iterating the message update equations be an efficient operation, we desire that the matrix B is sparse and local, i.e., only a few non-zero elements for each row or column, and only nearby messages influence each other. 
   In the next section, we describe a “canonical” message-passing method that yields these desired properties. 
   A Canonical Method 
   In the previous section, we described the properties that must be satisfied by messages and their associated message-update rules, which we call the “message-passing method,” in order that the messages give results equivalent to the Kikuchi approximation. In general, there may be many different message-passing methods that are all equivalent to the same Kikuchi approximation. In this section, we describe how to select one particular message-passing method that we call the “canonical” method. 
   Our canonical method gives the same message-update rules as the standard loopy message-passing method when applied at the level of the Bethe approximation. More generally, and as an advantage, our canonical method leads to local message-update rules that are relatively easy and convenient to solve because they correspond to a sparse B matrix. 
   We start with a Markov network with local compatibility functions φ ij  and evidence functions ψ i . The overall probability of a configuration of states s a , s b , . . . is expressed as. 
                 P   ⁡     (       s   a     ,     s   b     ,   …     )       =       1   Z     ⁢       ∏     i   ,   j       ⁢         ϕ   ij     ⁡     (       s   i     ,     s   j       )       ⁢       ∏   i     ⁢       ψ   i     ⁡     (     s   i     )                 ,           [   48   ]             
 
where the first product runs over all linked neighbors, i and j.
 
   Using  FIG. 5 , we illustrate this procedure with a specific example. In this example, nine nodes labeled a through i, are arranged in a 3×3 lattice  500 . The only statistical dependencies or links φ ij (s i ,s j ) included are the ones connecting nearest neighbors in the lattice. 
   General Procedure 
   The detailed steps of a general method is described with respect to FIG.  6 . In step  601 , a network  600  of nodes and links is grouped  601  into clusters or “super-nodes”  650  to be used in the approximation. These clusters can have a simple geometric shape, repeated over the lattice. Alternatively, the clusters can be triangles or squares of an irregular network, or the clusters can be some other arbitrary choice of node clusters best suited for the approximation. The set of clusters must cover all the links in the Markov network, and the clusters must be small enough so that we are able to perform the generalized belief propagation operations described below. 
   In our example, we group the network  500  into clusters: (abde), (bcef), (degh), and (efhi)  501 - 504  of FIG.  5 . This set of clusters “covers” the lattice  500 . That is, every link between nodes which influence each other is completely included in at least one of the four clusters we have selected. Of course, we can select a different collection of clusters which completely covers the lattice. That would just be a different Kikuchi approximation. 
   As stated before, the size of the clusters is proportional to the accuracy of the approximation. If we chose a cluster (abcdefghi), i.e., all the nodes in the system, then our approximation is exact. While that grouping may be feasible with such a small example, in general, we will perform summations whose number grows exponentially with the size of the cluster. Therefore, in a practical application, the number of nodes in a cluster is limited. 
   The prior art Bethe approximation is obtained when we select as the clusters all the pairs of nodes that influence each other. In our example, that would mean partitioning the nodes pairwise into clusters (ab), (bc), (de), (ef), (gh), (hi), (ad), (be), (cf), (dg), (eh), and (fi). Because our four clusters are larger than the twelve clusters of the Bethe approximation, we obtain more accurate results. 
   In step  602 , we identify a collection of relevant regions  651  by recursively generating intersections of clusters, for our example, the regions, (be), (de) (fe), (he), and (e). We discard duplicate regions. 
   In step  603 , we arrange the regions into a top-to-bottom hierarchy  652  of their intersections. The hierarchy for our specific example is shown in more detail in FIG.  7 . This hierarchy has the property that each region is connected only to its “direct sub-regions” and “direct super-regions.” A sub-region s is a “direct sub-region” of another region r if there are no other regions in our collection that are super-regions of s and sub-regions of r. In our example, regions (be) and (de) are both direct sub-regions of region (abde), but region (e) is not. Region r is a direct super-region of region s if and only if region s is a direct sub-region of region r. 
   In step  604 , we identify messages M  653  which connect all regions with their direct sub-regions. In our example, we would identify messages M abde\be , M abde\de , M bcef\be , M bcef\fe , M degh\de , M degh he , M efhi\fe , M efhi\he , M be\e , M de\e , M fe\e , and M he\e . 
   We can identify these messages using a more compact notation that we illustrate with one example:
 
 M   be   ad   ≡M   abde\be .  [47]
 
   For this message, we send a message from the upper nodes a and d to the lower nodes b and e. We can consider the upper nodes to be the “source” nodes for the message, and the lower nodes to be the “destination” nodes. Each of the messages between a region and its direct sub-region has dimensionality corresponding to the dimensionality of the sub-region. Thus, M be   ad  has the same dimensionality as region (be). When we want to emphasize that fact, we express the message as M be   ad (S b , s e ). 
   In step  605 , we construct a probability function P(α R ) and a local potential Φ(α R ) for each region R. We construct a vector {right arrow over (L)} out of the quantities L(α)≡ln P(α)−ln Φ(α). For our example, we need to construct probabilities P(s a ,s b ,s d ,s e ), P(s b ,s c ,s e ,s f ), P(s d ,s e ,s g ,s h ), P(s e ,s f ,s h ,s i ), P(s b ,s e ), P(s d ,s e ), P(s f ,s e ), P(s h ,s e ) and P(s e ). The local potentials Φ(α R ) are constructed by combining all the original potentials φ ij  and ψ i  that belong to the region R. Thus, for example,
 
Φ( s   a   ,s   b   ,s   d   ,s   e )=φ ab ( s   a   ,s   b )φ ad ( s   a   ,s   d ) φ be ( s   b   ,s   e )φ de ( s   d   ,s   e )ψ a ( s   a )ψ b ( s   b )ψ d ( s   d )ψ e ( s   e ),  [48]
 
while Φ(s b ,s e )=φ be (s b ,s e )ψ b (s b )ψ e (s e ) and Φ(s e )=ψ(s e )
 
   Each probability function has the dimensionality of the region it describes. For example, if node b can be in any of three states and node e can be in any of four states, then P(α be ) is described by 3*4=12 numbers. 
   In step  606 , we specify the matrix B  656  that determines the selection of the message-passing method. This matrix will operate on the vector {right arrow over (m)} created from the logarithms of the messages specified in step  604 . The matrix B has a block form that we explained when describing equation [33]. This special block form “hides” the details of the different possible values of the nodes within each message or region. Using this block form, the matrix B  655  has N R  rows and N M  columns, where N R  is the number of regions, and N M  is the number of messages. Each entry in the matrix is either a {tilde over (0)} matrix or a {tilde over (1)} matrix. We determine the entries of the matrix B by the following sub-step  606  for each entry: 
   (a) Label the region corresponding to the row of the entry R R , and the region and sub-region of the message corresponding to the column of the entry R C  and S C  respectively. By R C \S C , we denote the set of nodes that are in R C  but not in S C . 
   (b) If the nodes in SC are the same as the nodes in R R , or if the nodes are a sub-set of the nodes in R R , and if all the nodes in R C \S C  are not in R R , then the entry is a {tilde over (1)} matrix. Otherwise, the entry is a {tilde over (0)} matrix. 
   Explained more intuitively, this rule says that every region gets messages that start at source nodes that are outside of the region and end at destination nodes that are inside of the region. In our example, assuming the regions are listed in the order (abde), (bcef), (degh), (efhi), (be), (de), (fe), (he), (e), and the messages are ordered as we listed them above, the matrix B is: 
             B   =       (           0   ~           0   ~           1   ~           0   ~           1   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~               1   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           0   ~           0   ~           1   ~           0   ~           0   ~               0   ~           1   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~           0   ~           1   ~           0   ~               0   ~           0   ~           0   ~           1   ~           0   ~           1   ~           0   ~           0   ~           1   ~           1   ~           0   ~           0   ~               1   ~           0   ~           1   ~           0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~           1   ~               0   ~           1   ~           0   ~           0   ~           1   ~           0   ~           0   ~           0   ~           1   ~           0   ~           1   ~           1   ~               0   ~           0   ~           0   ~           1   ~           0   ~           0   ~           1   ~           0   ~           1   ~           1   ~           0   ~           1   ~               0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           0   ~           1   ~           1   ~           1   ~           1   ~           0   ~               0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           0   ~           1   ~           1   ~           1   ~           1   ~           )     .             [   49   ]             
 
   We explain one of these entries: the {tilde over (1)} matrix in the first row, third column. The first row corresponds to the region (abde), while the third column corresponds to the message M be   cf . Both the nodes c and f are outside of the region (abde) and both the nodes b and e are inside the region (abde), so the conditions for choosing a {tilde over (1)} matrix are met for this entry. 
   One important advantage of this rule is that when it is applied to the messages and regions obtained from the Bethe approximation, the rule will always result in a matrix B that will ultimately yield the standard “loopy” belief propagation. Another important advantage is that this rule will normally give back a matrix B that results in a system of equations A{right arrow over (λ)}==B{right arrow over (m)} that is solvable. Another advantage is that this rule will result in a B matrix that is sparse and local. 
   In step  607 , we exponentiate the equations represented by the matrix equation {right arrow over (L)}=B{right arrow over (m)} to obtain the equations 656 relating the region probabilities to the messages. For our example, we obtain nine equations from the nine rows of the matrix equation. As an example, we show how to construct the equation for the first row. The first row of the B matrix corresponds to the region (abde). Reading across the first row, we see that there are {tilde over (1)} sub-matrices in the third, fifth, eleventh, and twelfth columns, which correspond to the messages M be   cf , M de   gh , M e   f , and M e   h  Therefore, the equation for the first row is:
 
 P ( s   a   , s   b   ,s   d   ,s   e )=Φ( s   a   ,s   b   ,s   d   ,s   e ) M   be   cf (s b   ,s   e ) M   de   gh ( s   d   ,s   e ) M   e   f ( s   e ) M   e   h ( s   e ).  [50]
 
The other equations are constructed in the same way. For example, the equation for the fifth row is
 
 P (i s b   ,s   e )=Φ(i s b   ,s   e ) M   be   ad (i s b   ,s   e ) M   be   cf ( s   b   ,s   e ) M   e   d ( s   e ) M   e   f ( s   e ) M   e   h ( s   e )  [51]
 
In step  608 , we express the N m  constraint equations on the region probabilities, and substitute in equations relating the region probabilities to the messages in order to obtain a set of self-consistent equations M c  (update rules) for messages  657 .
 
   In our example, we have twelve constraint equations. In the canonical method, there are always exactly as many constraint equations as there are messages. One of the constraint equations in our example relates P(s a ,s b ,s d ,s e ) to P(s b ,s e ): 
               P   ⁡     (       s   b     ,     s   e       )       =       ∑       s   b     ,     s   e         ⁢       P   ⁡     (       s   a     ,     s   b     ,     s   d     ,     s   e       )       .               [   52   ]             
 
   Using the results from the previous step, we obtain the self-consistent equation for the messages from the marginalization (abde)→(be): 
                   M   be   ad     ⁡     (       s   b     ,     s   e       )       ⁢       M   e   d     ⁡     (     s   e     )         =       ∑       s   a     ⁢     s   d         ⁢         ϕ   ab     ⁡     (       s   a     ,     s   b       )       ⁢       ϕ   ad     ⁡     (       s   a     ,     s   d       )       ⁢       ϕ   be     ⁡     (       s   b     ,     s   e       )       ⁢       ψ   a     ⁡     (     s   a     )       ⁢       ψ   d     ⁡     (     s   d     )       ⁢         M   de   gh     ⁡     (       s   d     ,     s   e       )       .                 [   53   ]             
 
   Eleven other similar equations can be obtained from the constraint equations. From the marginalization of region (abde)→(de) we obtain: 
                   M   de   ad     ⁡     (       s   d     ,     s   e       )       ⁢       M   e   b     ⁡     (     s   e     )         =       ∑       s   a     ⁢     s   b         ⁢         ϕ   ad     ⁡     (       s   a     ,     s   d       )       ⁢       ϕ   ab     ⁡     (       s   a     ,     s   b       )       ⁢       ϕ   de     ⁡     (       s   d     ,     s   e       )       ⁢       ψ   a     ⁡     (     s   a     )       ⁢       ψ   b     ⁡     (     s   b     )       ⁢       M   be   cf     ⁡     (       s   d     ,     s   e       )                   [   54   ]                 From   ⁢           ⁢     (   bcef   )       -&gt;       (   be   )     :                                   M   be   cf     ⁡     (       s   b     ,     s   e       )       ⁢       M   e   f     ⁡     (     s   e     )         =       ∑       s   c     ⁢     s   f         ⁢         ϕ   bc     ⁡     (       s   b     ,     s   c       )       ⁢       ϕ   cf     ⁡     (       s   c     ,     s   f       )       ⁢       ϕ   be     ⁡     (       s   b     ,     s   e       )       ⁢       ψ   c     ⁡     (     s   c     )       ⁢       ψ   f     ⁡     (     s   f     )       ⁢       M   fe   ik     ⁡     (       s   f     ,     s   e       )                   [   55   ]                 From   ⁢           ⁢     (   bcef   )       -&gt;       (   fe   )     :                                   M   fe   cb     ⁡     (       s   f     ,     s   e       )       ⁢       M   e   b     ⁡     (     s   e     )         =       ∑       s   c     ⁢     s   b         ⁢         ϕ   fc     ⁡     (       s   f     ,     s   c       )       ⁢       ϕ   cb     ⁡     (       s   c     ,     s   b       )       ⁢       ϕ   fe     ⁡     (       s   f     ,     s   e       )       ⁢       ψ   b     ⁡     (     s   b     )       ⁢       ψ   f     ⁡     (     s   f     )       ⁢       M   be   ad     ⁡     (       s   b     ,     s   e       )                   [   56   ]                 From   ⁢           ⁢     (   degh   )       -&gt;       (   de   )     :                                   M   de   gh     ⁡     (       s   d     ,     s   e       )       ⁢       M   e   h     ⁡     (     s   e     )         =       ∑       s   g     ⁢     s   h         ⁢         ϕ     d   ⁢           ⁢   g       ⁡     (       s   d     ,     s   g       )       ⁢       ϕ   gh     ⁡     (       s   g     ,     s   h       )       ⁢       ϕ   hc     ⁡     (       s   h     ,     s   c       )       ⁢       ψ   g     ⁡     (     s   g     )       ⁢       ψ   h     ⁡     (     s   h     )       ⁢       M   he   if     ⁡     (       s   h     ,     s   c       )                   [   57   ]                 From   ⁢           ⁢     (   degh   )       -&gt;       (   he   )     :                                   M   he   gd     ⁡     (       s   h     ,     s   c       )       ⁢       M   c   d     ⁡     (     s   e     )         =       ∑       s   g     ⁢     s   d         ⁢         ϕ   gh     ⁡     (       s   g     ,     s   h       )       ⁢       ϕ   gd     ⁡     (       s   g     ,     s   d       )       ⁢       ϕ   de     ⁡     (       s   d     ,     s   e       )       ⁢       ψ   d     ⁡     (     s   d     )       ⁢       ψ   g     ⁡     (     s   g     )       ⁢       M     d   ⁢           ⁢   c     ab     ⁡     (       s   d     ,     s   c       )                   [   58   ]                 From   ⁢           ⁢     (   efhi   )       -&gt;       (   fe   )     :                                   M   fe   ih     ⁡     (       s   f     ,     s   e       )       ⁢       M   e   h     ⁡     (     s   c     )         =       ∑       s   i     ⁢     s   h         ⁢         ϕ   fi     ⁡     (       s   f     ,     s   i       )       ⁢       ϕ   hi     ⁡     (       s   h     ,     s   i       )       ⁢       ϕ   fe     ⁡     (       s   f     ,     s   e       )       ⁢       ψ   h     ⁡     (     s   h     )       ⁢       ψ   i     ⁡     (     s   i     )       ⁢       M   he   gd     ⁡     (       s   h     ,     s   e       )                   [   59   ]                 From   ⁢           ⁢     (   efhi   )       -&gt;       (   he   )     :                                   M   he   fi     ⁡     (       s   h     ,     s   e       )       ⁢       M   e   f     ⁡     (     s   e     )         =       ∑       s   i     ⁢     s   j         ⁢         ϕ   hi     ⁡     (       s   h     ,     s   i       )       ⁢       ϕ   fi     ⁡     (       s   f     ,     s   i       )       ⁢       ϕ   fe     ⁡     (       s   f     ,     s   e       )       ⁢       ψ   f     ⁡     (     s   f     )       ⁢       ψ   i     ⁡     (     s   i     )       ⁢       M   fe   cb     ⁡     (       s   f     ,     s   e       )                   [   60   ]                 From   ⁢           ⁢     (   be   )       -&gt;       (   e   )     :                                 M   c   b     ⁡     (   e   )       =       ∑     s   b       ⁢         ϕ   be     ⁡     (       s   b     ,     s   e       )       ⁢       ψ   b     ⁡     (     s   b     )       ⁢       M   be   ad     ⁡     (       s   b     ,     s   e       )       ⁢       M   be   cf     ⁡     (       s   b     ,     s   e       )       ⁢       M   b   a     ⁡     (     s   b     )       ⁢       M   b   c     ⁡     (     s   b     )                   [   61   ]                 From   ⁢           ⁢     (   de   )       -&gt;       (   e   )     :                                 M   e   d     ⁡     (   e   )       =       ∑     s   d       ⁢         ϕ   de     ⁡     (       s   d     ,     s   e       )       ⁢       ψ   d     ⁡     (     s   d     )       ⁢       M   de   ab     ⁡     (       s   d     ,     s   e       )       ⁢       M   de   gf     ⁡     (       s   d     ,     s   e       )       ⁢       M   d   a     ⁡     (     s   d     )       ⁢       M   d   g     ⁡     (     s   d     )                   [   62   ]                 From   ⁢           ⁢     (   fe   )       -&gt;       (   e   )     :                                 M   e   f     ⁡     (   e   )       =       ∑     s   f       ⁢         ϕ   fe     ⁡     (       s   f     ,     s   e       )       ⁢       ψ   f     ⁡     (     s   f     )       ⁢       M   fe   cb     ⁡     (       s   f     ,     s   e       )       ⁢       M   fe   ih     ⁡     (       s   f     ,     s   e       )       ⁢       M   f   c     ⁡     (     s   f     )       ⁢       M   f   i     ⁡     (     s   f     )                   [   63   ]                 From   ⁢           ⁢     (   he   )       -&gt;       (   e   )     :                                 M   c   h     ⁡     (   e   )       =       ∑     s   h       ⁢         ϕ   he     ⁡     (       s   h     ,     s   e       )       ⁢       ψ   h     ⁡     (     s   h     )       ⁢       M   he   gd     ⁡     (       s   h     ,     s   e       )       ⁢       M   he   if     ⁡     (       s   h     ,     s   e       )       ⁢       M   h   g     ⁡     (     s   h     )       ⁢         M   h   i     ⁡     (     s   h     )       .                 [   64   ]             
 
In step  609 , we solve the self-consistent message equations 657 by iteratively updating the values according to the rules, beginning with some initial message values  658  and some “evidence” ψ 659 . The initial values  658  can be random or special values, e.g., all random positive numbers, or all ones. The “evidence” is given by the values of the Variables.
 
   For this sub-step, there are no guarantees of convergence, though for many cases in practice, such systems of equations will quickly converge. One can continue updating the message-update equations until they satisfy some termination condition, or alternatively stop after a given number of iterations. 
   For our example, in order to obtain some numerical results, we need to specify the values of the variables defining the model. We choose the case where all the nodes can be in one of two states, and where the local potentials φ ij (s i ,s j ) can be written as: 
                   ϕ   ij     ⁡     (       s   i     ,     s   j       )       =     (             exp   ⁡     (       J   ij     /   T     )       ⁢     exp   ⁡     (       -     J   ij       /   T     )                     exp   ⁡     (       -     J   ij       /   T     )       ⁢     exp   ⁡     (       J   ij     /   T     )               )       ,           [   65   ]             
 
where J ij  is a bond strength and T is the temperature parameter. This is known as the Ising model of statistical physics. We set all the bond strengths between nearest neighbors J ij =1 and the temperature T=2. We also set the ψ i (s i ) “evidence” potentials to be uniform for all nodes i: 
                 ψ   i     ⁡     (     s   i     )       =       (         1           1         )     .             [   66   ]             
 
   This corresponds to the Ising model in a zero field. 
   Convergent dynamics are obtained for this model by taking, at each iteration, the new messages to be an average of the “old” messages and the new computed messages. The messages from one node to one node are determined first, and then these results are used to determine the two node to two node messages. In general, one can order the message-update equations so that the messages that depend on the fewest nodes are solved first, so that those results can be used on the left-hand-side of the equations for the later messages. 
   Next, we solve for the region marginal probabilities  660  using the converged values of the messages and the equations 656 previously derived. We insure that the region probabilities are normalized so that they sum to one. 
   Interestingly, for our example, the final messages obtained from a “run” depends on the initial messages. However, the final converged region probabilities derived from the final messages always are the same. This reflects a general phenomena, which is the fact that when there are more messages than regions, the messages form an over-complete representation of the region probabilities. 
   The numerical results obtained using our four cluster Kikuchi approximation are excellent and much better than those obtained from the prior art pairwise Bethe approximation. 
   To take one example, the exactly computed value of the probability function P(s b ,s e ) is, to six significant digits: 
               P   ⁡     (       s   b     ,     s   e       )       =       (         0.406496       0.093504           0.093504       0.406496         )     .             [   66   ]             
 
   Our approximation yields: 
               P   ⁡     (       s   b     ,     s   e       )       =       (         0.406659       0.093341           0.093341       0.406659         )     .             [   67   ]             
 
while the result from standard belief propagation, equivalent to using the Bethe approximation, is: 
               P   ⁡     (       s   b     ,     s   e       )       =       (         0.365529       0.134471           0.134471       0.365529         )     .             [   68   ]             
 
   Thus, our generalized belief propagation method has eliminated more than 99.6 percent of the error associated with the prior art “standard” belief propagation in this case. This is a significant improvement over the prior art. 
   Calculating other numerical quantities gives similar improvements for our example. 
   Determining the Kikuchi Free Energy 
   So far, we have described a process for generating message-passing methods. We have not yet mentioned the Kikuchi free energy calculations that motivated our work. In fact, our method as described above has practical use by itself. On the other hand, for some applications, our method may be of interest to determined the Kikuchi free energy, as well as other physical quantities, such as the internal energy, the entropy, the specific heat, magnetizations, susceptibilities, and possible critical temperatures that can be derived from the Kikuchi free energy. 
   The Kikuchi approximation to the Gibbs free energy includes the following parts: the internal energy (enthalpy) U, entropic term −TS, and Lagrange multiplier terms constraining the normalization and marginalizations of the region probabilities. The full formula for the Kikuchi approximation to the Gibbs free energy is given in equation [14]. 
   For the internal energy and entropy parts, one must remember to weight each region&#39;s contribution by its over-counting number dr. After the message-passing method has converged, the Lagrange multiplier terms all sum to zero and can be ignored, because the corresponding constraints are satisfied. 
   Application of the Canonical Generalized Belief Propagation Method to Some Important Markov Networks 
   It may be helpful if we explicitly express the equations obtained using the described canonical method for some common Markov networks. We consider a square lattice with clusters consisting of all the four-node squares in the lattice, and a triangular lattice with clusters consisting of all the three-node triangles in the lattice. 
   Square Lattice 
   In a square lattice of nodes each node is connected to its four nearest neighbors. FIG.  2 ( a ) is an example of a square lattice. This is an important Markov network for image processing or computer vision applications. Using each possible four-node loop as a cluster, we derive a set of message-passing rules which improve the accuracy of the computed marginal probabilities over the Bethe approximation&#39;s performance. To obtain improved performance, we introduce double-indexed messages, i.e., arrays of numbers, in addition to the single-indexed messages, i.e., vectors that are part of the Bethe approximation message-passing. 
   Following the implementation rules described above, we derive the message-passing rules, and marginal probabilities in terms of those messages. These, we list below. We list only the marginalization and propagation equations for the regions away from the edges of the array of nodes. 
   The regions obtained from the intersections of the original square clusters are regions consisting of two nodes connected by a link, and regions consisting of a single node. 
   The marginal probability of a region consisting of a single node is expressed as:
 
 P ( S   a )= M   a   c   M   a   b   M   a   c   M   a   d ψ a ,  [73]
 
where P(S a ) is the marginal probability for each of the different possible states S a , of the random variable at node a, and M e   a  is the converged value of the message from ource node e to destination node a, and similarly for the messages from the other nodes neighboring node a. Each of those messages is a vector of the dimensionality of the number of different possible states at node a. To avoid cluttering these formulae, we have not suppressed the functional dependence of the messages; to make it explicit, one would write for example M a   d (S a ). FIG.  8 ( a ) is a graphical representation of equation [73]. Each arrow symbolizes a single-indexed message.
 
   The marginal probability of a region consisting of two linked nodes is expressed as:
 
 P ( S   a   ,S   b )= M   a   e   M   a   c   M   a   d   M   b   f   M   b   g   M   b   h   M   ab   ef   M   ab   ch φ ab ψ a φ b ,  [74]
 
where the terms are defined analogously as with equation [73], and, for example, M ab   ch  means the double-indexed message from source nodes ch to destination nodes ab. Here, the value φ ab , is the compatibility matrix between nodes a and b, and is a function of S a  and S b . FIG.  8 ( b ) is a graphical representation of Equation [74]. An arrow dragging a line symbolizes a double-indexed message, and a simple line connecting two nodes symbolizes a compatibility matrix.
 
   The marginal probability of a square region is expressed as:
 
 P ( S   a   , S   b   ,S   f   ,S   e )= M   a   c   M   a   d   M   b   g   M   b   h   M   f   k   M   f   l   M   e   i   M   e   j   M   ab   ch   M   fb   lg   M   ef   jk   M   ea   id   φ   ab φ ae φ bf φ ef ψ a ψ b ψ f ψ f ψ e   [75]
 
with the notation defined as for the equations above. FIG.  8 ( c ) is a graphical representation of Equation [75].
 
   By marginalizing equation [74] over S b  and setting the result equal to equation [73], we obtain one of the two sets of self-consistent message equations that are satisfied by the converged values of the messages:
 
 M   a   b   =M   b   f   M   b   g   M   b   h   M   ab   ef   M   ab   ch   φ   ab ψ b .  [76]
 
     FIG. 9  is a graphical representation of equation [76]. 
   By marginalizing equation [75] over S e  and S f , and setting the result equal to equation [74], we obtain the other set of self-consistent message equations: 
               M   ab   ef     =           M   f   k     ⁢     M   f   l     ⁢     M   e   i     ⁢     M   e   j     ⁢     M   fb   lg     ⁢     M   ef   jk     ⁢     M   ea   id     ⁢     φ   ae     ⁢     φ   ef     ⁢     φ   fb     ⁢     ψ   e     ⁢     ψ   f           M   a   e     ⁢     M   b   f         .             [   77   ]             
 
   For the values of M a   e  and M b   f  in equation [77], we use the values determined from equation [76].  FIG. 10  is a graphical representation of equation [77]. 
   Triangular Lattice 
   A triangular lattice is another Markov network of particular interest for modeling two dimensional datasets. FIG.  2 ( b ) is an example of a triangular lattice. Analogously with the equations and notation as described above, we described the following. 
   The marginal probability of a single-node region is expressed as:
 
 P ( S   a )= M   a   b   M   a   c   M   a   d   M   a   e   M   a   i   M   a   l   ψ   a .  [78]
 
   FIG.  11 ( a ) is a graphical representation of equation [78]. 
   The marginal probability of a region consisting of two linked nodes is expressed as:
 
 P ( S   a   , S   e )=M a   b   M   a   c   M   a   d   M   a   i   M   a   l   M   e   d   M   e   f   M   e   g   M   e   h   M   e   i   M   ae   d   M   ae   i φ ae ψ a ψ e .  [79]
 
   FIG.  11 ( b ) is a graphical representation of equation [79]. 
   The marginal probability of a triangle region is expressed as:
 
 P (S a   , S   e   , S   i )=M a   l   M   a   b   M   a   c   M   a   d   M   e   d   M   e   f   M   e   g   M   e   h   M   i   h   M   i   j   M   i   k   M   i   l   M   ai   l   M   ae   e   M   ei   h φ ae φ ai φ ei ψ a ψ e ψ i .  [80]
 
   FIG.  11 ( c ) is a graphical representation of equation [80]. 
   By marginalizing equation [79] over S e , and setting the result equal to [78], we obtain the self-consistent message equation:
 
 M   a   e   =M   e   d   M   e   f   M   e   g   M   e   h   M   e   i   M   ae   d   M   ae   i φ ae ψ e   [81]
 
     FIG. 12  is a graphical representation of equation [81]. 
   By marginalizing equation [80] over S i , and setting the result equal to equation [79], we obtain the self-consistent message equation: 
               M   ae   i     =           M   k   l     ⁢     M   i   k     ⁢     M   i   j     ⁢     M   i   h     ⁢     M   ai   l     ⁢     M   ei   h     ⁢     φ   ai     ⁢     φ   ei     ⁢     ψ   i           M   a   i     ⁢     M   e   i         .             [   82   ]             
 
     FIG. 13  is a graphical representation of equation [82]. As described above for the square lattice, for the values of M a   i  and M e   i  in equation [82], we use the values determined from equation [81] during the same iteration. 
   Modified Loopy Super-Node Method 
   We now describe an alternative embodiment of our invention. We call this embodiment the “modified loopy super-node method.” This method is partially motivated by Pearl&#39;s “clustering method”, and the related “junction tree method” which are prior-art methods that has been employed to obtain exact answers for Markov networks with only a few loops, see “Learning in Graphical Models”, edited by M. I. Jordan, 1998. 
   In the junction tree method, one generates a Markov network equivalent to the original one by grouping the original nodes into “super-nodes.” New φ compatibility matrices and ψ evidence functions are also generated for the super-nodes such that the probability of any state using the super-node formulation is equivalent to its probability in the original Markov network. If the super-node Markov network has no loops, one can apply standard belief-propagation to determine exactly the desired marginal probabilities, even if the original Markov network had some loops. Using the standard belief propagation method on a super-node network that was designed to have no loops is called the “junction tree method.” 
   Of course, if the super-node network still has loops, one is still faced with a difficult problem which standard belief propagation will not solve exactly. Nevertheless, one might consider the obvious “naïve” method of using ordinary loopy belief propagation on the super-node network. This “naïve” method, which one might call the “loopy super-node method,” sometimes gives acceptable results, but empirical testing shows that it also can give very poor results for some simple networks. 
   In our alternative embodiment of our invention, we make a modification to the loopy super-node method which guarantees that it converges. Our modified method also gives results that are equivalent to using a Kikuchi approximation with clusters corresponding to the chosen super-nodes. Thus, our “modified loopy super-node method” is an alternative method that obtains the same results as our “canonical” method described above. 
   For concreteness, we illustrate the modified loopy super-node method using the same specific Markov network model and choice of clusters that we used to illustrate the “canonical” method, see FIG.  14 . This network consists of nine nodes (α through i), and we choose four arbitrary clusters (abde), (bcef), (degh), and (efhi). These four clusters are also referred to as “super-nodes.” 
   Constructing A Super-Node Network 
   We begin by reformulating the average energy U. The Kikuchi approximation for the average energy is in fact exactly correct when we use the correct marginal probabilities. For our example network, the average energy is expressed within the Kikuchi approximation as: 
             U   =         ∑     α   abde       ⁢           ⁢       P   ⁡     (     α   abde     )       ⁢     E   ⁡     (     α   abde     )           +       ∑     α   bcef       ⁢           ⁢       P   ⁡     (     α   bcef     )       ⁢     E   ⁡     (     α   bcef     )           +       ∑     α   degh       ⁢           ⁢       P   ⁡     (     α   degh     )       ⁢     E   ⁡     (     α   degh     )           +       ∑     α   efhi       ⁢           ⁢       P   ⁡     (     α   efhi     )       ⁢     E   ⁡     (     α   efhi     )           -       ∑     α   be       ⁢           ⁢       P   ⁡     (     α   be     )       ⁢     E   ⁡     (     α   be     )           -       ∑     α   de       ⁢           ⁢       P   ⁡     (     α   de     )       ⁢     E   ⁡     (     α   de     )           -       ∑     α   je       ⁢           ⁢       P   ⁡     (     α   je     )       ⁢     E   ⁡     (     α   je     )           -       ∑     α   he       ⁢           ⁢       P   ⁡     (     α   he     )       ⁢     E   ⁡     (     α   he     )           +       ∑     α   e       ⁢           ⁢       P   ⁡     (     α   e     )       ⁢       E   ⁡     (     α   e     )       .                   [   83   ]             
 
   This expression includes terms that sum over the intersection regions (be), (de), fe), (he), and (e). As for the canonical method above, we want to eliminate these terms and have an expression that only contains sums over the super-node regions. We can easily do that because each of the sums over the intersection regions can be expressed as a sum over a super-node region. For example, 
                 ∑     α   be       ⁢           ⁢       P   ⁡     (     α   be     )       ⁢     E   ⁡     (     α   be     )           =       ∑     α   abde       ⁢           ⁢       P   ⁡     (     α   abde     )       ⁢       E   ⁡     (     α   be     )       .                 [   84   ]             
 
   This equation is true because of the marginalization formulae for P(α be ): 
                 ∑     α   abde       ⁢           ⁢       P   ⁡     (     α   abde     )       ⁢     E   ⁡     (     α   be     )           =       ⁢       ∑     α   be       ⁢       ∑     α   ad       ⁢       P   ⁡     (     α   abde     )       ⁢     E   ⁡     (     α   be     )                         ⁢     [   85   ]                   =       ⁢       ∑     α   be       ⁢           ⁢       E   ⁡     (     α   be     )       ⁢       ∑     α   ad       ⁢           ⁢     P   ⁡     (     α   abde     )               ⁢                       ⁢     [   86   ]                 =       ⁢       ∑     α   be       ⁢       E   ⁡     (     α   be     )       ⁢       P   ⁡     (     α   be     )       .                     ⁢     [   87   ]               
 
   Therefore, the Kikuchi average energy can be expressed as: 
             U   =         ∑     α   abde       ⁢           ⁢       P   ⁡     (     α   abde     )       ⁢       E   ~     ⁡     (     α   abde     )           +       ∑     α   bcef       ⁢           ⁢       P   ⁡     (     α   bcef     )       ⁢       E   ~     ⁡     (     α   bcef     )           +       ∑     α   degh       ⁢           ⁢       P   ⁡     (     α   degh     )       ⁢       E   ~     ⁡     (     α   degh     )           +       ∑     α   efhi       ⁢           ⁢       P   ⁡     (     α   efhi     )       ⁢         E   ~     ⁡     (     α   efhi     )       .                   [   88   ]             
 
   The {tilde over (E)} terms are not uniquely determined. They depend on how we choose to distribute the intersection region terms. One choice is: 
                 E   ~     ⁡     (     α   abde     )       =       E   ⁡     (     α   abde     )       -     E   ⁡     (     α   be     )       +     E   ⁡     (     α   e     )                 [   89   ]                   E   ~     ⁡     (     α   bcef     )       =       E   ⁡     (     α   bcef     )       -     E   ⁡     (     α   ef     )                 [   90   ]                   E   ~     ⁡     (     α   ghde     )       =       E   ⁡     (     α   ghde     )       -     E   ⁡     (     α   de     )                 [   91   ]                   E   ~     ⁡     (     α   efhi     )       =       E   ⁡     (     α   efhi     )       -       E   ⁡     (     α   he     )       .               [   92   ]             
 
   Our goal is to construct a Markov network between the super-nodes that is equivalent to the original Markov network. Let us label the four super-nodes by the numbers  1 ,  2 ,  3 , and  4 , see  FIG. 15   a . We construct the evidence functions using the equation, for super-node  1 .
 
{tilde over (ψ)} 1 (α 1 )= e   −{tilde over (E)}(α     1     )/T ,  [93]
 
and similarly for the other super-nodes.
 
   The compatibility matrices between the super-node regions are chosen so that if two super-nodes are in consistent states, then the compatibility function is one, otherwise the compatibility function is zero. For example, if super-node  1  is in a first “super-node” state such that node b is in some first “node” state, and super-node  2  is in a second “super-node” state such that node b is in a second “node” state, than the two super-nodes are in inconsistent “super-node” states. The compatibility matrix {tilde over (φ)} 12 (α 1 , α 2 ) should equal zero for those particular states. 
   If we define the evidence vectors and compatibility matrices as described, then the joint probability for super-node states is: 
                 P   ~     ⁡     (       α   1     ,     α   2     ,     α   3     ,     α   4       )       =       1   Z     ⁢       ∏   n     ⁢           ⁢           ψ   ~     n     ⁡     (     α   n     )       ⁢       ∏   mn     ⁢           ⁢         φ   ~     mn     ⁡     (       α   m     ,     α   n       )                       [   94   ]             
 
(n and m are super-node indices) will exactly agree with the joint probability P defined for the original nodes.
 
   We summarize our construction in  FIG. 15   a . We define a new “super-node” graph  1500  that has four super-nodes  1501 - 1504 : 1≡(abde), 2≡(bcef), 3≡(degh), and 4≡(efhi). We denote the local “evidence potentials” for the four super-nodes by {tilde over (ψ)}. We set the pairwise connections (links) {tilde over (φ)}  1511 - 1514  between the super-nodes so that super-nodes must agree on shared nodes. By construction, the super-node network  15   a  has the same probability distribution as the original network of FIG.  14 . 
   In order that our super-node network is consistent with the Kikuchi approximation to the Gibbs free energy, we also must enforce all the constraints between the regions involved in the Kikuchi approximation. We aim for a minimal set of constraints (Lagrange multipliers). Note that in the canonical method, we used an over-complete set of constraints. The following set of marginalization constraints are sufficient for our example network: 
                 ∑     α   ad       ⁢     P   ⁡     (     α   abde     )         =       P   ⁡     (     α   be     )       =       ∑     α   ef       ⁢     P   ⁡     (     α   bcef     )                   [   95   ]                   ∑     α   bc       ⁢     P   ⁡     (     α   bcef     )         =       P   ⁡     (     α   ef     )       =       ∑     α   hi       ⁢     P   ⁡     (     α   efhi     )                   [   96   ]                   ∑     α   fi       ⁢     P   ⁡     (     α   efhi     )         =       P   ⁡     (     α   eh     )       =       ∑     α   dg       ⁢     P   ⁡     (     α   degh     )                   [   97   ]                   ∑     α   gh       ⁢     P   ⁡     (     α   degh     )         =       P   ⁡     (     α   de     )       =       ∑     α   ab       ⁢     P   ⁡     (     α   abde     )                   [   98   ]                     ∑     α   be       ⁢     P   ⁡     (     α   be     )         =     P   ⁡     (     α   e     )         ,           [   99   ]             
 
in addition to the standard normalization constraints on the super-node regions.
 
   With these choices, the Kikuchi free energy for this example network takes the following form: 
             U   =         ∑     α   1       ⁢           ⁢       P   ⁡     (     α   1     )       ⁢     E   ~     ⁢     (     α   1     )         +       ∑     α   2       ⁢           ⁢       P   ⁡     (     α   2     )       ⁢     E   ~     ⁢     (     α   2     )         +       ∑     α   3       ⁢           ⁢       P   ⁡     (     α   3     )       ⁢     E   ~     ⁢     (     α   3     )         +       ∑     α   4       ⁢           ⁢       P   ⁡     (     α   4     )       ⁢     E   ~     ⁢     (     α   4     )         +     T   ⁡     [         ∑     α   1       ⁢           ⁢       P   ⁡     (     α   1     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   1     )           +       ∑     α   2       ⁢           ⁢       P   ⁡     (     α   2     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   2     )           +       ∑     α   3       ⁢           ⁢       P   ⁡     (     α   3     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   3     )           +       ∑     α   4       ⁢           ⁢       P   ⁡     (     α   4     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   4     )             ]       -     T   [         ∑     α   be       ⁢           ⁢       P   ⁡     (     α   be     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   be     )           +       ∑     α   de       ⁢           ⁢       P   ⁡     (     α   de     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   de     )           +       ∑     α   fe       ⁢           ⁢       P   ⁡     (     α   fe     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   fe     )           +       ∑     α   he       ⁢           ⁢       P   ⁡     (     α   he     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   he     )             ]     +     T   ⁢       ∑     α   e       ⁢           ⁢       P   ⁡     (     α   e     )       ⁢   ln   ⁢           ⁢     P   ⁡     (     α   e     )             +       γ   1     [     1   -       ∑     α   1       ⁢           ⁢     P   ⁡     (     α   1     )           ]     +       γ   2     [     1   -       ∑     α   2       ⁢           ⁢     P   ⁡     (     α   2     )           ]     +       γ   3     [     1   -       ∑     α   3       ⁢           ⁢     P   ⁡     (     α   3     )           ]     +       γ   4     [     1   -       ∑     α   4       ⁢           ⁢     P   ⁡     (     α   4     )           ]     +       ∑     α   be       ⁢           ⁢         λ     1   ⁢   \   ⁢   be       ⁡     (     α   be     )       [       P   ⁡     (     α   be     )       -       ∑     α     1   ⁢   \   ⁢   be         ⁢           ⁢     P   ⁡     (     α   1     )           ]       +       ∑     α   be       ⁢           ⁢         λ     2   ⁢   \   ⁢   be       ⁡     (     α   be     )       [       P   ⁡     (     α   be     )       -       ∑     α     1   ⁢   \   ⁢   be         ⁢           ⁢     P   ⁡     (     α   2     )           ]       +       ∑     α   de       ⁢           ⁢         λ     1   ⁢   \   ⁢   de       ⁡     (     α   de     )       [       P   ⁡     (     α   de     )       -       ∑     α     1   ⁢   \   ⁢   de         ⁢           ⁢     P   ⁡     (     α   1     )           ]       +       ∑     α   de       ⁢           ⁢         λ     3   ⁢   \   ⁢   de       ⁡     (     α   de     )       [       P   ⁡     (     α   de     )       -       ∑     α     3   ⁢   \   ⁢   de         ⁢           ⁢     P   ⁡     (     α   3     )           ]       +       ∑     α   fe       ⁢           ⁢         λ     2   ⁢   \   ⁢   fe       ⁡     (     α   fe     )       [       P   ⁡     (     α   fe     )       -       ∑     α     2   ⁢   \   ⁢   fe         ⁢           ⁢     P   ⁡     (     α   2     )           ]       +       ∑     α   fe       ⁢           ⁢         λ     4   ⁢   \   ⁢   fe       ⁡     (     α   fe     )       [       P   ⁡     (     α   fe     )       -       ∑     α     4   ⁢   \   ⁢   fe         ⁢           ⁢     P   ⁡     (     α   4     )           ]       +       ∑     α   he       ⁢           ⁢         λ     3   ⁢   \   ⁢   he       ⁡     (     α   he     )       [       P   ⁡     (     α   he     )       -       ∑     α     3   ⁢   \   ⁢   he         ⁢           ⁢     P   ⁡     (     α   3     )           ]       +       ∑     α   he       ⁢           ⁢         λ     4   ⁢   \   ⁢   he       ⁡     (     α   he     )       [       P   ⁡     (     α   he     )       -       ∑     α     4   ⁢   \   ⁢   he         ⁢           ⁢     P   ⁡     (     α   4     )           ]       +       ∑     α   e       ⁢           ⁢           λ     be   ⁢   \   ⁢   e       ⁡     (     α   e     )       [       P   ⁡     (     α   e     )       -       ∑     α     be   ⁢   \   ⁢   e         ⁢           ⁢     P   ⁡     (     α   be     )           ]     .                 [   100   ]             
 
   When we differentiate the Kikuchi free energy with respect to the super-node region probabilities, we obtain:
 
 P (α 1 )= k   1 {tilde over (ψ)} 1 (α 1 )λ 1\de (α be )λ 1\de (α de )  [101]
 
 P (α 2 )= k   2 {tilde over (ψ)} 2 (α 2 )λ 2\be (α be )λ 2\fe (α fe )  [102]
 
 P (α 3 )= k   3 {tilde over (ψ)} 3 (α 3 )λ 3\de (α de )λ 3\he (α he )  [103]
 
 P (α 4 )= k   4 {tilde over (ψ)} 4 (α 4 )λ 4\fe (α fe )λ 4\he (α he )  [104]
 
   Note that these equations are essentially identical to those that would be obtained from the naïve loopy belief propagation method on the super-node graph. For example, using the naïve loopy belief propagation method, the marginal probability at super-node  1  would be:
 
 P (α 1 )= k{tilde over (ψ)}   1 (α 1 ) M   1   2 (α 1 ) M   1   3 (α 1 ),  [105]
 
where M 1   2 (α 1 ) is the message from source super-node  2  to destination super-node  1 . At first sight, there is a difference with equation [101] because M 1   2 (α 1 ) seems to depend on the state of all four nodes (abde). In fact, when we take the compatibility matrices into account, we finds that in the naïve loopy belief propagation method, the messages between super-nodes only depend on the states of the nodes that they share. Thus we can make the identifications M 1   2 (α be )=λ 1\be (α be ), M 1   3 (α de )=λ 1\de (α de ), M 2   1 (α be )=λ 2\be (α be ), M 2   4 (α fe )=λ 2\fe (α fe ), M 3   1 (α de )=λ 3\de (α de ), M 3   4 (α he )=λ 3\he (α he ), M 4   2 (α fe )=λ 4\fe (α fe ), and M 4   3 (α he )=λ 4\he (α he ).
 
   In  FIG. 15   b , we draw graphically these messages passed in the naïve loopy belief propagation method on the super-node graph. 
   When we substitute the region probabilities from equations [101-104] into the constraint equations [95-98], we obtain: 
                 k   1     ⁢       ∑     α     1   /   be         ⁢           ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       λ     1   ⁢   \   ⁢   be       ⁡     (     α   be     )       ⁢       λ     1   ⁢   \   ⁢   de       ⁡     (     α   de     )             =       k   2     ⁢       ∑     α     2   /   be         ⁢           ψ   ~     2     ⁡     (     α   2     )       ⁢       λ     2   ⁢   \   ⁢   be       ⁡     (     α   be     )       ⁢       λ     2   ⁢   \   ⁢   fe       ⁡     (     α   fe     )                     [   106   ]                   k   1     ⁢       ∑     α     1   /   de         ⁢           ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       λ     1   ⁢   \   ⁢   be       ⁡     (     α   be     )       ⁢       λ     1   ⁢   \   ⁢   de       ⁡     (     α   de     )             =       k   3     ⁢       ∑     α     3   /   de         ⁢           ψ   ~     3     ⁡     (     α   3     )       ⁢       λ     3   ⁢   \   ⁢   de       ⁡     (     α   de     )       ⁢       λ     3   ⁢   \   ⁢   he       ⁡     (     α   he     )                     [   107   ]                   k   2     ⁢       ∑     α     2   /   fe         ⁢           ⁢           ψ   ~     2     ⁡     (     α   2     )       ⁢       λ     2   ⁢   \   ⁢   be       ⁡     (     α   be     )       ⁢       λ     2   ⁢   \   ⁢   fe       ⁡     (     α   fe     )             =       k   4     ⁢       ∑     α     4   /   fe         ⁢           ψ   ~     4     ⁡     (     α   4     )       ⁢       λ     4   ⁢   \   ⁢   fe       ⁡     (     α   fe     )       ⁢       λ     4   ⁢   \   ⁢   he       ⁡     (     α   he     )                     [   108   ]                   k   3     ⁢       ∑     α     3   /   he         ⁢           ⁢           ψ   ~     3     ⁡     (     α   3     )       ⁢       λ     3   ⁢   \   ⁢   de       ⁡     (     α   de     )       ⁢       λ     3   ⁢   \   ⁢   he       ⁡     (     α   he     )             =                 ⁢                 ⁢       k   4     ⁢       ∑     α     4   /   he         ⁢           ψ   ~     4     ⁡     (     α   4     )       ⁢       λ     4   ⁢   \   ⁢   fe       ⁡     (     α   fe     )       ⁢         λ     4   ⁢   \   ⁢   he       ⁡     (     α   he     )       .                       [   109   ]             
 
   These equations will be satisfied when we make the identification between the Lagrange multipliers λ and the loopy belief propagation messages indicated previously, and require that the messages obey the standard propagation equations. 
   Take for example, equation [106]. We can simplify this as follows: 
                 k   1     ⁢       M   1   2     ⁡     (     α   be     )       ⁢       ∑     α     1   ⁢   \   ⁢   be         ⁢           ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       M   1   3     ⁡     (     α   de     )             =       k   2     ⁢       M   2   1     ⁡     (     α   be     )       ⁢       ∑     α     2   ⁢   \   ⁢   be         ⁢           ⁢           ψ   ~     2     ⁡     (     α   2     )       ⁢         M   2   4     ⁡     (     α   fe     )       .                   [   110   ]             
 
   But if we satisfy the standard belief propagation equations on the super-node graph 
                 M   1   2     ⁡     (     α   be     )       =     k   ⁢       ∑     α2   ⁢   \   ⁢   be       ⁢           ψ   ~     2     ⁡     (     α   2     )       ⁢       M   2   4     ⁡     (     α   fe     )                     [   111   ]                     M   2   1     ⁡     (     α   be     )       =     k   ⁢       ∑     α1   ⁢   \   ⁢   be       ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       M   1   3     ⁡     (     α   de     )               ,           [   112   ]             
 
then equation [110] will be satisfied. Thus equations [106-109] are equivalent to the naïve loopy belief propagation equations for the super-node network.
 
   However, there exist additional equations that need to be considered in the Kikuchi formalism that give rise to a modification of the naïve loopy belief propagation method. In particular, when we differentiate the Kikuchi approximation to the Gibbs free energy with respect to P(α de ), P(α fc ), P(α he ), P(α be ), and P(α e ), we obtain the equations:
 
 P (α de )= k   de λ 1\de (α de )λ 3\de (α de )  [113]
 
 P (α fe )= k   fe λ 2\fe (α fe )λ 4\fe (β fe )  [114]
 
 P (α he )= k   he λ 3\he (α he )λ 4\he (α he )  [115]
 
 P (α be )= k   be λ 1\be (α be )λ 2\be (α be )/λ be\e (α e )  [116]
 
 P (α e )= k   e /λ be\e (α e )  [117]
 
   The first three of these equations are satisfied automatically when we identify the λ&#39;s 1% with belief propagation messages as before. For example, for equation [113], we have: 
                     P   ⁡     (     α   de     )       =       ∑     1   ⁢   \   ⁢   de       ⁢     P   ⁡     (     α   1     )                     =       k   1     ⁢       ∑     1   ⁢   \   ⁢   de       ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       M   1   2     ⁡     (     α   be     )       ⁢       M   1   3     ⁡     (     α   de     )                         =       k   1     ⁢       M   1   3     ⁡     (     α   de     )       ⁢       ∑     1   ⁢   \   ⁢   de       ⁢           ψ   ~     1     ⁡     (     α   1     )       ⁢       M   1   2     ⁡     (     α   be     )                         =         k   1     ⁢       M   1   3     ⁡     (     α   de     )       ⁢       M   3   1     ⁡     (     α   de     )         =       k   1     ⁢       λ     1   ⁢   \   ⁢   de       ⁡     (     α   de     )       ⁢       λ     3   ⁢   \   ⁢   de       ⁡     (     α   de     )                         [   118   ]             
 
   However, equations [116-117] are not necessarily satisfied when we take the λ&#39;s to have the same values as the belief propagation messages. There is another condition, which can be obtained from the constraint equation 
         P   ⁡     (     α   e     )       =       ∑     α   b       ⁢           ⁢       P   ⁡     (     α   be     )       .           
 
Using this equation, we find: 
                   ∑     α   b       ⁢         λ     1   ⁢   \   ⁢   be       ⁡     (     α   be     )       ⁢       λ     2   ⁢   \   ⁢   be       ⁡     (     α   be     )           =   k     ,           [   119   ]             
 
where k is some constant. As usual, the actual value of the constant is not important; what is important in this case is the fact that this sum should not depend on the state of node e. We can guarantee that all the derivative equations [106-109] and [113-119] are satisfied if we identify the λ&#39;s with loopy belief propagation messages, but make sure that they satisfy the additional constraint of equation [119].
 
   We now define a “normalization” operator. In  FIGS. 15   c  and  15   d , the normalization operator is indicated by ellipses  1530 ,  1541 - 1544 . The normalization operator takes as input the messages M 1   2 (α be ) and M 2   1 (α be ) and returns as output normalized messages Norm(M 1   2 (α be )) and Norm(M 2   1 (α be )) defined by: 
               Norm   ⁡     (       M   1   2     ⁡     (     α   be     )       )       =         M   1   2     ⁡     (     α   be     )             ∑     α   b       ⁢         M   1   2     ⁡     (     α   be     )       ⁢       M   2   1     ⁡     (     α   be     )                       [   120   ]                 Norm   ⁡     (       M   2   1     ⁡     (     α   be     )       )       =           M   2   1     ⁡     (     α   be     )             ∑     α   b       ⁢         M   1   2     ⁡     (     α   be     )       ⁢       M   2   1     ⁡     (     α   be     )               .             [   121   ]             
 
   By construction: 
                   ∑     α   b       ⁢       Norm   ⁡     (       M   1   2     ⁡     (     α   be     )       )       ⁢     Norm   ⁡     (       M   2   1     ⁡     (     α   be     )       )           =   1     ,           [   122   ]             
 
so if we identify the λ&#39;s with normalized belief propagation messages, equation [119] will be satisfied. The normalization constraint [119] can be satisfied simultaneously with the ordinary belief propagation constraints implicit in equations [106-109], if we follow the modified loopy junction tree method (see  FIG. 15   c ). For this example network, that means that we iteratively solve the belief-propagation equations for the super-node lattice, taking care at every iteration to apply the normalization operator to messages M 1   2 (α be ) and M 2   1 (α be ).
 
   Applying this method to our example network yields results identical to those obtained from the canonical method, as expected. The results are significantly more accurate than those obtained from the “naïve” loopy super-node method. 
   The Modified Loopy Super-Node Method for a General Markov Network 
   We have described the modified loopy super-node method for our example network. We now describe how to use this method for an arbitrary network with arbitrary groupings of nodes into super-nodes. A general version of the method includes the following steps as shown in FIG.  16 . 
   In step  1601 , group all of the nodes of the network  1600  into a set of intersecting clusters  1650 . As stated above, the grouping can be heterogeneous and arbitrary. As an advantage of the arbitrary clustering according to the invention, the user can trade accuracy for computational complexity. Larger clusters give better results, but take more time to resolve. Groups of nodes that are less relevant can be grouped into smaller clusters. 
   In step  1602 , determine a minimal number of marginalization constraints  1651  that need to be satisfied between the clusters  1650 . 
   In step  1603 , construct a super-node network  1652 . In the network  1652 , each cluster of nodes is represented by just one super-node  1653 . Super-nodes that share one of the marginalization constraints determined in step  1602  are connected by a super-link  1654 . 
   In step  1604 , the super-node network  1652  is searched to locate closed loops of super-nodes that contain at least one common node. For each such closed loop, determine a normalization operator  1655 . 
   In step  1605 , update the messages between super-nodes using standard belief propagation. 
   In step  1606 , replace the messages by their normalized values using the corresponding normalization operator, and repeat step  1605  until convergence in step  1607 . 
   If we have a fixed point of the modified loopy super-node method, then it is equivalent to the result obtained from minimizing the Kikuchi free energy. 
   Application to Decoding Error-Correcting Codes 
   An “error-correcting” code is an encoding of digital, e.g., binary, messages. The code adds redundancy that is designed to protect the transmission of the messages from corruption by noise. Typically, the sender of a message transmits “blocks” of bits (binary digits), where each block contains the “data bits” of the original message, plus some additional “check bits” which help to decode the message if it arrives at a receiver in a corrupted form. For example, a check bit may encode the parity of the sum of selected data bits. 
   Markov networks have been widely used to represent error-correcting codes, see “Good Error-Correcting Codes based on Very Sparse Matrices”, by D. MacKay, IEEE Transactions on Information Theory, March, 1999. In the Markov network formulation of an error-correcting code, some of the nodes of the Markov network will correspond to the data bits and the check bits, and the links between the nodes will enforce the appropriate relationships between data bits and check bits. 
   The standard decoding algorithm used for some error-correcting codes is the loopy belief propagation method, using either marginal or MAP probabilities, run on the Markov network that corresponds to the error-correcting code, see R. McEliece, D. MacKay, and J. Cheng, IEEE J. Selected Areas in Communication, 1997. When the MAP version of belief propagation is used, the decoded states of the bits are just the MAP states of the corresponding nodes. When the marginal probability version of belief propagation is used, the decoded states of the bits are taken to be those states of the corresponding nodes that have the highest marginal probability. 
   In decoding according to our invention, the loopy belief propagation method is replaced by the method according to the invention. Our method provides improved decoding for error-correcting codes. 
   Other Applications 
   The belief propagation method as described herein can be used in a number of applications. It can be used in computer vision problems where scenes need to be estimated, see U.S. patent application Ser. No. 09/203,108, “Estimating Scenes Using Statistical Properties of Images and Scenes,” filed by Freeman et al. on Nov. 30, 1998, also see U.S. patent application Ser. No. 09/236,839, “Estimating Targets Using Statistical Properties of Observations of Known Targets,” filed by Freeman et al. on Jan. 25, 1999. It can also be used in object recognition systems such as the air-to-ground targeting system described in U.S. Pat. No. 5,963,653, “Hierarchical information fusion object recognition system and method,” issued to McNary et al. on Oct. 5, 1999. A number of other applications that are well suited for the invention are mentioned in U.S. Pat. No. 5,802,256, “Generating improved belief networks,” issued to Heckerman, et al. on Sep. 1, 1998, for example, crop production estimation, program debugging, coastal ocean environments prediction, diagnosing linear lightwave networks. Speech recognition applications that can use the present invention are described in U.S. Pat. No. 5,623,609, “Computer system and computer-implemented process for phonology-based automatic speech recognition,” issued to Kaye et al. on Apr. 22, 1997. 
   In this description of the invention, we used specific terms and examples. It is to be understood that various other adaptations and modifications may be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.