Introduction
Probabilistic graphical models (PGMs) provide a rigorous mathematical framework for representing statistical dependencies and performing inference under uncertainty in high-dimensional systems [1 , 2 ] . They have found broad applications in state estimation [3 , 4 ] , Bayesian inference and learning [5 , 6 ] , and system identification [7 , 8 ] . Among PGMs, factor graphs provide a natural representation of the factorization structure of a joint distribution by separating variable nodes from factor nodes, and support message-passing inference through the sum-product algorithm [9 , 10 ] . Factor graphs have been successfully applied to a wide range of inference problems, including robot perception [11 ] , cooperative localization [12 ] , and multitarget tracking [13 , 14 , 15 ] . In this paper, we consider marginal inference on loopy factor graphs.
Inference on factor graphs with loops presents significant challenges. Message-passing algorithms, also known as belief propagation (BP) algorithms, effectively leverage local structural information [9 ] . While BP is theoretically guaranteed to be exact on tree-structured graphs, its performance on factor graphs with loops – often referred to as loopy BP (LBP) – is less reliable. LBP is not guaranteed to converge and may converge to inaccurate fixed points [16 , 17 , 18 ] . Meanwhile, for Gaussian variables, BP presents a long-standing challenge: it may fail to converge, and even when it does converge, it often yields inexact variances [19 , 20 ] . These limitations stem from BP treating incoming messages as independent, an assumption that breaks down in the presence of loops, particularly short loops that introduce strong correlations among neighboring nodes [21 ] .
Substantial efforts have been devoted to mitigating loop effects in probabilistic graphical model inference. Classical clustering methods [22 Sec. 4.4.1] address loops by grouping variables into clusters, so that loop-induced correlations are handled locally within each cluster and message passing is performed between clusters. This broad principle is further developed in region-based inference frameworks, most notably generalized belief propagation (GBP) [23 , 24 ] , where messages are passed between possibly overlapping regions in a region graph. For GBP, however, the marginal accuracy and computational cost depend on the selected region graph, while a generally optimal and fully automatic region-selection rule is still lacking, and effective region-graph construction typically relies on manual design or application-specific heuristics [25 ] . This limitation motivates inference schemes in which enlarged neighborhoods are constructed automatically from the topology of the factor graph, rather than from a manually designed region graph.
A different line of work, without manual region-graph construction, captures short-range loop-induced correlations by enlarging the local neighborhood of each node. Kirkley et al. [21 ] proposed a self-consistent message-passing framework for Ising models that defines larger neighborhoods to capture short-range correlations, improving accuracy over BP while eliminating the need for manual region decomposition. Building on [21 ] , subsequent work [26 ] combines tensor networks with alternative neighborhood definitions to further refine approximation accuracy. However, the methods in [21 , 26 ] are developed for discrete pairwise MRFs, and extending them to general bipartite factor graphs is non-trivial due to topological and functional differences. Specifically, these approaches rely on aggregating messages over a larger Markov blanket, which is naturally defined in MRFs where variables are directly connected. In contrast, factor graphs exhibit a strict bipartite structure in which variable nodes never interact directly but are conditionally linked solely through intermediate factor nodes. Mapping these MRF-based neighborhoods to a factor graph does not reflect the alternating variable–factor structure and therefore does not directly yield a message-passing formulation for general bipartite factor graphs, necessitating a distinct formulation of neighborhood expansion and the associated message-passing rules. Moreover, in contrast to the discrete pairwise MRFs considered in [21 , 26 ] , the factor graphs considered here may involve continuous variables. Although [21 ] establishes exactness under its bounded primitive-cycle condition, it does not establish that the message updates converge in a finite number of iterations, nor is this exactness result established for general bipartite factor graphs.
A separate line of work focuses on Gaussian graphical models, where accurate variance estimation poses a long-standing challenge. To improve the accuracy and convergence of Gaussian BP (GaBP) in loopy graphs, several variants of message-passing schemes have been developed, such as feedback message passing [27 ] , and variance-improvement algorithms [20 ] . Notably, the regularized GaBP algorithm (sGaBP-m) [28 , 29 ] , designed for pairwise Markov graphs, employs a regularization parameter to guarantee convergence to the exact marginal means. While sGaBP-m yields exact means upon convergence with sufficient regularization, selecting the regularization parameter remains a heuristic process, and the estimated variances are still approximate without guarantees. Furthermore, the framework of sGaBP-m is tailored for pairwise Markov graphs and may not generalize directly to generic factor graphs [29 ] .
In summary, prior approaches face different limitations. Region-based methods such as GBP depend on the selected region graph, the effective construction of which remains problem-dependent and typically relies on manual design or application-specific heuristics; the neighborhood-expansion method in [21 ] is formulated for discrete pairwise MRFs and does not directly cover general bipartite factor graphs with continuous variables; and Gaussian-specific variants, such as GaBP and sGaBP-m, still cannot guarantee accurate variance estimates. These limitations motivate the present work, particularly for factor graphs with short loops.
In response, we propose the extended neighborhood message passing (ENMP) method for inference on loopy factor graphs. Unlike region-based methods such as GBP, for which effective region-graph construction remains problem-dependent and typically relies on manual design or application-specific heuristics, ENMP automatically constructs an extended neighborhood directly from the bipartite factor-graph topology to capture loop-induced correlations. A single tunable parameter controls the size of this neighborhood, trading off inference accuracy against computational complexity. We formulate general message-passing update rules for factorized probability models and further specialize them to Gaussian factor graphs, deriving closed-form updates in canonical parameters. We analyze ENMP under two inference regimes. In the exact regime, where the extended neighborhoods are large enough to fully capture the loop-induced correlations in the factor graph, the ENMP message updates converge to a unique fixed point in a finite number of iterations and yield the exact marginals; such exactness and convergence within a finite number of iterations are not established for general bipartite factor graphs in [21 ] . For Gaussian factor graphs in particular, the exact regime yields not only exact marginal means but also exact marginal variances, addressing the well-known variance inaccuracy of loopy GaBP in this regime [19 ] . In the approximate regime, ENMP provides approximate marginals. The main contributions of this work are summarized as follows:
We propose ENMP, a message-passing framework that automatically constructs extended neighborhoods from the bipartite factor-graph topology to capture loop-induced correlations, without requiring the manual design or application-specific heuristics typically used for region-graph construction in GBP [23 , 25 ] . A single tunable parameter controls
the neighborhood size, providing a tradeoff between inference accuracy and computational complexity. The framework applies to both discrete and continuous variables and admits closed-form updates for Gaussian factor graphs.
We show that, in the exact regime, the ENMP message updates converge to a unique fixed point in finitely many iterations, yielding exact marginal beliefs; for Gaussian factor graphs, both the marginal means and variances are exact. In the approximate regime, ENMP provides approximate marginals.
We evaluate ENMP on Gaussian factor graphs arising from power-system state estimation over standard IEEE bus test cases, and on a discrete Ising factor graph. The results show that the inference accuracy of ENMP generally improves as the size of the extended neighborhoods increases, and that the method achieves exact marginal inference on several systems in both settings. On the larger Gaussian systems, ENMP also outperforms the tested sGaBP-m configurations in both mean and variance estimation accuracy, while the Ising experiments confirm its applicability to discrete factor graphs.
The remainder of this article is organized as follows. § 2 formulates the inference problem on factor graphs. § 3 introduces the ENMP framework, including the automated construction of extended neighborhoods and the resulting message-passing update rules for general and Gaussian distributions. § 4 evaluates ENMP against the tested baselines on Gaussian power-system state estimation benchmarks and on discrete Ising factor graphs. Finally, § 5 concludes the article.
Modeling and Problem Formulation
Consider a joint probability distribution function (PDF) or a probability mass function (PMF) P ( x ) P(\mathbf{x}) P ( x ) of a random vector x = [ x 1 , x 2 , … , x n x ] T \mathbf{x} = [x_1, x_2, \ldots, x_{n_x}]^\mathsf{T} x = [ x 1 , x 2 , … , x n x ] T , where the variables can be either continuous or discrete. Let G = ( X , F , E ) \mathcal{G} = (\mathcal{X}, \mathcal{F}, \mathcal{E}) G = ( X , F , E ) be the corresponding factor graph of P ( x ) P(\mathbf{x}) P ( x ) . Here, X = { x 1 , x 2 , … , x n x } \mathcal{X} = \{x_1, x_2, \ldots, x_{n_x}\} X = { x 1 , x 2 , … , x n x } and F = { f 1 , f 2 , … , f n f } \mathcal{F} = \{f_1, f_2, \ldots, f_{n_f}\} F = { f 1 , f 2 , … , f n f } denote the sets of variable nodes and factor nodes, respectively, where n x = ∣ X ∣ n_x = |\mathcal{X}| n x = ∣ X ∣ and n f = ∣ F ∣ n_f = |\mathcal{F}| n f = ∣ F ∣ ; E \mathcal{E} E is the set of edges connecting variable nodes and factor nodes.
Each factor node f a ∈ F f_a \in\mathcal{F} f a ∈ F represents a local function that depends only on a subset of variables x a ⊆ X \mathbf{x}_a \subseteq\mathcal{X} x a ⊆ X , i.e., the variable nodes connected to f a f_a f a . Given these definitions, P ( x ) P(\mathbf{x}) P ( x ) can be decomposed as,
P ( x ) = 1 Z ψ ( x ) = 1 Z ∏ f a ∈ F f a ( x a ) , (1) P(\mathbf{x}) = \frac{1}{Z}\psi(\mathbf{x}) = \frac{1}{Z}\prod_{f_a\in\mathcal{F}} f_a(\mathbf{x}_a), \tag*{(1)} P ( x ) = Z 1 ψ ( x ) = Z 1 f a ∈ F ∏ f a ( x a ) , (1)
where Z Z Z is the partition function.
We aim to infer the marginal PDF of a specific variable x i x_i x i (i = 1 , 2 , … , n x i = 1, 2, \ldots, n_x i = 1 , 2 , … , n x ), which can be written as,
P ( x i ) = ∫ P ( x ) d x i = ∫ 1 Z ∏ f a ∈ F f a ( x a ) d x i , (2) P(x_i) = \int P(\mathbf{x})\,d\mathbf{x}^{i} = \int\frac{1}{Z}\prod_{f_a\in\mathcal{F}} f_a(\mathbf{x}_a)\,d\mathbf{x}^{i}, \tag*{(2)} P ( x i ) = ∫ P ( x ) d x i = ∫ Z 1 f a ∈ F ∏ f a ( x a ) d x i , (2)
where x i \mathbf{x}^{i} x i denotes the vector x \mathbf{x} x excluding the component x i x_i x i .
Direct computation of the marginalization in (2) involves high-dimensional integration (or summation), which is generally computationally intractable for large-scale graphs. BP [9 ] avoids this global marginalization by iteratively passing local messages m i → a ( x i ) m_{i\to a}(x_i) m i → a ( x i ) and m a → i ( x i ) m_{a\to i}(x_i) m a → i ( x i ) between variable node x i x_i x i and factor node f a f_a f a along each edge. The BP updates and the resulting belief b i ( x i ) b_i(x_i) b i ( x i ) of x i x_i x i are given by
m i → a ( x i ) ∝ ∏ f b ∈ N x i ∖ { f a } m b → i ( x i ) , m_{i\to a}(x_i) \propto\prod_{f_b\in\mathcal{N}_{x_i}\setminus\{f_a\}} m_{b\to i}(x_i), m i → a ( x i ) ∝ f b ∈ N x i ∖ { f a } ∏ m b → i ( x i ) ,
m a → i ( x i ) ∝ ∫ f a ( x a ) ∏ x j ∈ N f a ∖ { x i } m j → a ( x j ) d x a ∖ i , m_{a\to i}(x_i) \propto\int f_a(\mathbf{x}_a)\prod_{x_j\in\mathcal{N}_{f_a}\setminus\{x_i\}}m_{j\to a}(x_j)\,d\mathbf{x}_{a\setminus i}, m a → i ( x i ) ∝ ∫ f a ( x a ) x j ∈ N f a ∖ { x i } ∏ m j → a ( x j ) d x a ∖ i ,
b i ( x i ) ∝ ∏ f a ∈ N x i m a → i ( x i ) . b_i(x_i) \propto\prod_{f_a\in\mathcal{N}_{x_i}}m_{a\to i}(x_i). b i ( x i ) ∝ f a ∈ N x i ∏ m a → i ( x i ) .
where N v \mathcal{N}_v N v denotes the set of immediate neighbors of node v v v , and x a ∖ i \mathbf{x}_{a\setminus i} x a ∖ i denotes x a \mathbf{x}_a x a excluding x i x_i x i .
BP performs exact inference on trees but struggles in loopy graphs because it treats incoming messages as independent. This assumption breaks down in the presence of short loops, which introduce strong correlations and cause message feedback. Consequently, BP often fails to distinguish new information from recirculated beliefs, leading to oscillation and inaccurate variance estimates [20 , 21 ] . To overcome these challenges and achieve accurate inference in such densely loopy factor graphs, we propose the ENMP method in the following section.
The ENMP Method
In this section, we propose the ENMP method for inference in loopy factor graphs and establish its update rules for both general and Gaussian distributions.
Extended neighborhood modeling
Inspired by [21 ] , we propose an extended neighborhood for each variable node to account for loop-induced correlations among larger groups of neighboring nodes. Different from [21 ] , which defines larger neighborhoods over MRFs where variables interact directly, our formulation is tailored to the bipartite topology of factor graphs and applies to both discrete and continuous variable domains. Specifically, if a variable node x i x_i x i and its neighborhood nodes are contained in a loop of length less than a given value, then all other nodes within this loop are considered as extended neighbors.
To formalize these concepts, we introduce the following definitions of walks, paths, and loops. For two nodes u u u and v v v in G \mathcal{G} G , a walk from u u u to v v v is a node sequence w = ( v 0 , v 1 , … , v ℓ ) w=(v_0,v_1,\ldots,v_\ell) w = ( v 0 , v 1 , … , v ℓ ) such that v 0 = u v_0=u v 0 = u , v ℓ = v v_\ell=v v ℓ = v , and v k − 1 v_{k-1} v k − 1 and v k v_k v k are adjacent in G \mathcal{G} G for every k = 1 , 2 , … , ℓ k=1,2,\ldots,\ell k = 1 , 2 , … , ℓ . The length of w w w is defined as ℓ ( w ) = ℓ \ell(w)=\ell ℓ ( w ) = ℓ . A path from u u u to v v v is a walk p = ( v 0 , v 1 , … , v ℓ ) p=(v_0,v_1,\ldots,v_\ell) p = ( v 0 , v 1 , … , v ℓ ) in which the nodes v 0 , v 1 , … , v ℓ v_0,v_1,\ldots,v_\ell v 0 , v 1 , … , v ℓ are pairwise distinct. Let Path ( u , v ) \operatorname{Path}(u,v) Path ( u , v ) denote the set of all such paths from u u u to v v v in G \mathcal{G} G . More generally, for a subgraph H \mathcal{H} H of G \mathcal{G} G and two nodes u u u and v v v in H \mathcal{H} H , Path H ( u , v ) \operatorname{Path}_{\mathcal{H}}(u,v) Path H ( u , v ) denotes the set of all paths from u u u to v v v in H \mathcal{H} H . For a path p = ( v 0 , v 1 , … , v ℓ ) p=(v_0,v_1,\ldots,v_\ell) p = ( v 0 , v 1 , … , v ℓ ) , its length is ℓ ( p ) = ℓ \ell(p)=\ell ℓ ( p ) = ℓ . A loop in G \mathcal{G} G is a closed walk C = ( v 0 , v 1 , … , v ℓ ) C=(v_0,v_1,\ldots,v_\ell) C = ( v 0 , v 1 , … , v ℓ ) with ℓ ≥ 3 \ell\ge3 ℓ ≥ 3 such that v ℓ = v 0 v_\ell=v_0 v ℓ = v 0 and the nodes v 0 , v 1 , … , v ℓ − 1 v_0,v_1,\ldots,v_{\ell-1} v 0 , v 1 , … , v ℓ − 1 are pairwise distinct. Its length is ∣ C ∣ = ℓ \lvert C\rvert=\ell ∣ C ∣ = ℓ .
For any node set S ⊆ X ∪ F \mathcal{S}\subseteq\mathcal{X}\cup\mathcal{F} S ⊆ X ∪ F , let G [ S ] \mathcal{G}[\mathcal{S}] G [ S ] denote the subgraph of G \mathcal{G} G that retains the node set S \mathcal{S} S together with all edges of G \mathcal{G} G connecting any two nodes in S \mathcal{S} S . For a subgraph H \mathcal{H} H , a walk w w w , a path p p p , and a loop C C C , let V ( H ) V(\mathcal{H}) V ( H ) , V ( w ) V(w) V ( w ) , V ( p ) V(p) V ( p ) , and V ( C ) V(C) V ( C ) denote their corresponding node sets. The length of the longest loop in G \mathcal{G} G is denoted by L max \mathcal{L}_{\max} L m a x .
To formulate ENMP on a bipartite factor graph, we introduce three types of neighborhoods: the preliminary r r r -neighborhood, the extended r r r -neighborhood, and the residual r r r -neighborhood. Their formal definitions are given below.
Definition 1 [Preliminary r r r -neighborhood] The preliminary r r r -neighborhood, M i ( r ) M_i^{(r)} M i ( r ) , of a variable node x i ∈ X x_i\in\mathcal{X} x i ∈ X is defined as the subgraph of G \mathcal{G} G induced by x i x_i x i , its immediate neighbors, and all paths of length at most r r r between any two distinct neighbors of x i x_i x i that do not pass through x i x_i x i . Specifically,
P i ( r ) = { p ∣ p ∈ Path G [ ( X ∪ F ) ∖ { x i } ] ( u , v ) , u , v ∈ N x i , u ≠ v , ℓ ( p ) ≤ r } , \mathcal{P}_i^{(r)}=\left\{p\mid p\in\operatorname{Path}_{\mathcal{G}[(\mathcal{X}\cup\mathcal{F})\setminus\{x_i\}]}(u,v),\ u,v\in\mathcal{N}_{x_i},\ u\ne v,\ \ell(p)\le r\right\}, P i ( r ) = { p ∣ p ∈ Path G [( X ∪ F ) ∖ { x i }] ( u , v ) , u , v ∈ N x i , u = v , ℓ ( p ) ≤ r } , M i ( r ) = G [ { x i } ∪ N x i ∪ ⋃ p ∈ P i ( r ) V ( p ) ] . M_i^{(r)}=\mathcal{G}\left[\{x_i\}\cup\mathcal{N}_{x_i}\cup\bigcup_{p\in\mathcal{P}_i^{(r)}}V(p)\right]. M i ( r ) = G { x i } ∪ N x i ∪ p ∈ P i ( r ) ⋃ V ( p ) . Similarly, the preliminary r r r -neighborhood of a factor node f a ∈ F f_a\in\mathcal{F} f a ∈ F , denoted by M f a ( r ) M_{f_a}^{(r)} M f a ( r ) , is defined as
P f a ( r ) = { p ∣ p ∈ Path G [ ( X ∪ F ) ∖ { f a } ] ( u , v ) , u , v ∈ N f a , u ≠ v , ℓ ( p ) ≤ r } , \mathcal{P}_{f_a}^{(r)}=\left\{p\mid p\in\operatorname{Path}_{\mathcal{G}[(\mathcal{X}\cup\mathcal{F})\setminus\{f_a\}]}(u,v),\ u,v\in\mathcal{N}_{f_a},\ u\ne v,\ \ell(p)\le r\right\}, P f a ( r ) = { p ∣ p ∈ Path G [( X ∪ F ) ∖ { f a }] ( u , v ) , u , v ∈ N f a , u = v , ℓ ( p ) ≤ r } , M f a ( r ) = G [ { f a } ∪ N f a ∪ ⋃ p ∈ P f a ( r ) V ( p ) ] . M_{f_a}^{(r)}=\mathcal{G}\left[\{f_a\}\cup\mathcal{N}_{f_a}\cup\bigcup_{p\in\mathcal{P}_{f_a}^{(r)}}V(p)\right]. M f a ( r ) = G { f a } ∪ N f a ∪ p ∈ P f a ( r ) ⋃ V ( p ) .
Definition 2 [Extended r r r -neighborhood] The extended r r r -neighborhood, N i ( r ) N_i^{(r)} N i ( r ) , of a variable node x i x_i x i is constructed by recursively incorporating the preliminary r r r -neighborhoods of the included factor nodes. For a node set S ⊆ X ∪ F \mathcal{S}\subseteq\mathcal{X}\cup\mathcal{F} S ⊆ X ∪ F , define
T ( S ) = S ∪ ⋃ f a ∈ S ∩ F V ( M f a ( r ) ) . T(\mathcal{S})=\mathcal{S}\cup\bigcup_{f_a\in\mathcal{S}\cap\mathcal{F}}V(M_{f_a}^{(r)}). T ( S ) = S ∪ f a ∈ S ∩ F ⋃ V ( M f a ( r ) ) .
Consider the sequence initialized with S i ( 0 ) = V ( M i ( r ) ) S_i^{(0)}=V(M_i^{(r)}) S i ( 0 ) = V ( M i ( r ) ) and updated via S i ( k + 1 ) = T ( S i ( k ) ) S_i^{(k+1)}=T(S_i^{(k)}) S i ( k + 1 ) = T ( S i ( k ) ) . Since G \mathcal{G} G is finite, there exists K ≤ ∣ F ∣ K\le\lvert\mathcal{F}\rvert K ≤ ∣ F ∣ such that S i ( K + 1 ) = S i ( K ) S_i^{(K+1)}=S_i^{(K)} S i ( K + 1 ) = S i ( K ) . The extended r r r -neighborhood is defined as N i ( r ) = G [ S i ( K ) ] N_i^{(r)}=\mathcal{G}[S_i^{(K)}] N i ( r ) = G [ S i ( K ) ] .
Definition 3 [Residual r r r -neighborhood] Given the extended r r r -neighborhoods N i ( r ) N_i^{(r)} N i ( r ) and N j ( r ) N_j^{(r)} N j ( r ) of two distinct variable nodes x i x_i x i and x j x_j x j with x j ∈ V ( N i ( r ) ) x_j\in V(N_i^{(r)}) x j ∈ V ( N i ( r ) ) , let Δ j \ i = { x j } ∪ ( V ( N j ( r ) ) ∖ V ( N i ( r ) ) ) \Delta_{j\backslash i}=\{x_j\}\cup(V(N_j^{(r)})\setminus V(N_i^{(r)})) Δ j \ i = { x j } ∪ ( V ( N j ( r ) ) ∖ V ( N i ( r ) )) . To include the variable nodes connected to each factor node in Δ j \ i \Delta_{j\backslash i} Δ j \ i , the residual r r r -neighborhood is defined as
N j \ i ( r ) = G [ Δ j \ i ∪ ⋃ f a ∈ Δ j \ i ∩ F N f a ] . N_{j\backslash i}^{(r)}=\mathcal{G}\left[\Delta_{j\backslash i}\cup\bigcup_{f_a\in\Delta_{j\backslash i}\cap\mathcal{F}}\mathcal{N}_{f_a}\right]. N j \ i ( r ) = G Δ j \ i ∪ f a ∈ Δ j \ i ∩ F ⋃ N f a .
Having defined the preliminary, extended, and residual r r r -neighborhoods, Algorithm 1 provides an explicit implementation of the recursive construction of N i ( r ) N_i^{(r)} N i ( r ) in Definition 2.
Algorithm 1 Generation of the extended r r r -neighborhood N i ( r ) N_i^{(r)} N i ( r )
Require: The factor graph G = ( X , F , E ) \mathcal{G}=(\mathcal{X},\mathcal{F},\mathcal{E}) G = ( X , F , E ) , the variable node x i ∈ X x_i\in\mathcal{X} x i ∈ X , and the value of r r r ;
Ensure: The extended r r r -neighborhood N i ( r ) N_i^{(r)} N i ( r ) ;
Generate the preliminary r r r -neighborhood M i ( r ) M_i^{(r)} M i ( r ) by Definition 1;
Let S i = V ( M i ( r ) ) S_i=V(M_i^{(r)}) S i = V ( M i ( r ) ) , S i o l d = ∅ S_i^{\mathrm{old}}=\varnothing S i old = ∅ , and F v i s i t e d = ∅ \mathcal{F}_{\mathrm{visited}}=\varnothing F visited = ∅ ;
while S i ≠ S i o l d S_i\ne S_i^{\mathrm{old}} S i = S i old do
S i o l d = S i \quad S_i^{\mathrm{old}}=S_i S i old = S i , E = ∅ E=\varnothing E = ∅ , and F c u r r e n t = S i ∩ F \mathcal{F}_{\mathrm{current}}=S_i\cap\mathcal{F} F current = S i ∩ F ;
\quad for each factor f a ∈ F c u r r e n t ∖ F v i s i t e d f_a\in\mathcal{F}_{\mathrm{current}}\setminus\mathcal{F}_{\mathrm{visited}} f a ∈ F current ∖ F visited do
\qquad Generate the preliminary r r r -neighborhood M f a ( r ) M_{f_a}^{(r)} M f a ( r ) ;
\qquad if V ( M f a ( r ) ) ⊈ S i V(M_{f_a}^{(r)})\not\subseteq S_i V ( M f a ( r ) ) ⊆ S i then
E = E ∪ ( V ( M f a ( r ) ) ∖ S i ) \qquad\quad E=E\cup(V(M_{f_a}^{(r)})\setminus S_i) E = E ∪ ( V ( M f a ( r ) ) ∖ S i ) ;
\qquad end if
\quad end for
F v i s i t e d = F v i s i t e d ∪ F c u r r e n t \quad\mathcal{F}_{\mathrm{visited}}=\mathcal{F}_{\mathrm{visited}}\cup\mathcal{F}_{\mathrm{current}} F visited = F visited ∪ F current ;
S i = S i ∪ E \quad S_i=S_i\cup E S i = S i ∪ E ;
end while
Let N i ( r ) = G [ S i ] N_i^{(r)}=\mathcal{G}[S_i] N i ( r ) = G [ S i ] ;
Return N i ( r ) N_i^{(r)} N i ( r ) .
Algorithm 1 realizes the recursive sequence S i ( k + 1 ) = T ( S i ( k ) ) S_i^{(k+1)}=T(S_i^{(k)}) S i ( k + 1 ) = T ( S i ( k ) ) in Definition 2. At each iteration, the preliminary r r r -neighborhoods of the unvisited factor nodes in the current node set are incorporated through E = ⋃ f a ( V ( M f a ( r ) ) ∖ S i ) E=\bigcup_{f_a}(V(M_{f_a}^{(r)})\setminus S_i) E = ⋃ f a ( V ( M f a ( r ) ) ∖ S i ) , and the node set is updated accordingly. Since each factor node is expanded at most once, the number of factor-node expansion operations is bounded by ∣ F ∣ \lvert\mathcal{F}\rvert ∣ F ∣ . Therefore, Algorithm 1 terminates regardless of the longest loop length L max \mathcal{L}_{\max} L m a x and returns exactly the extended r r r -neighborhood N i ( r ) N_i^{(r)} N i ( r ) defined in Definition 2.
Because of the bipartite structure of a factor graph, every path in G [ ( X ∪ F ) ∖ { v } ] G[(\mathcal{X} \cup\mathcal{F}) \setminus\{v\}] G [( X ∪ F ) ∖ { v }] between two distinct nodes in N v N_v N v has an even length, i.e., 2 , 4 , 6 , … 2, 4, 6, \ldots 2 , 4 , 6 , … . Consequently, only even values of r r r can enlarge the preliminary r r r -neighborhood, while r = 0 r = 0 r = 0 includes no such path. Figure 1 (a) illustrates the preliminary 6-neighborhood, while Figure 1 (b) illustrates the corresponding extended and residual 6-neighborhoods on the same factor graph, with x 1 x_1 x 1 as the focal variable node.
Figure 1. (a) Preliminary 6-neighborhood M 1 ( 6 ) M_1^{(6)} M 1 ( 6 ) of variable node x 1 x_1 x 1 and the additional node sets V ( M f 3 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) V(M_{f_3}^{(6)}) \setminus V(M_1^{(6)}) V ( M f 3 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) and V ( M f 9 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) V(M_{f_9}^{(6)}) \setminus V(M_1^{(6)}) V ( M f 9 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) .
(b) Extended 6-neighborhood N 1 ( 6 ) N_1^{(6)} N 1 ( 6 ) of variable node x 1 x_1 x 1 and residual 6-neighborhood N 4 ∖ 1 ( 6 ) N_{4\setminus1}^{(6)} N 4 ∖ 1 ( 6 ) .
Fig. 1. Illustration of the preliminary, extended, and residual r r r -neighborhoods on the same factor graph for r = 6 r = 6 r = 6 . The focal variable node x 1 x_1 x 1 is shown in purple, and the highlighted node sets are identified by the legends in the respective panels.
For the preliminary r r r -neighborhood shown in Figure 1 (a), V ( M 1 ( 0 ) ) = { x 1 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } V(M_1^{(0)}) = \{x_1, f_1, f_2, f_4, f_6, f_7, f_{10}\} V ( M 1 ( 0 ) ) = { x 1 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } , and V ( M 1 ( 2 ) ) = V ( M 1 ( 0 ) ) V(M_1^{(2)}) = V(M_1^{(0)}) V ( M 1 ( 2 ) ) = V ( M 1 ( 0 ) ) since the minimum loop length is six. For r = 4 r = 4 r = 4 , V ( M 1 ( 4 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 10 } V(M_1^{(4)}) = \{x_1, x_2, x_3, x_4, x_5, f_1, f_2, f_3, f_4, f_5, f_6, f_7, f_{10}\} V ( M 1 ( 4 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 10 } . For r = 6 r = 6 r = 6 , V ( M 1 ( 6 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 , f 9 , f 10 } V(M_1^{(6)}) = \{x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, f_1, f_2, f_3, f_4, f_5, f_6, f_7, f_8, f_9, f_{10}\} V ( M 1 ( 6 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 , f 9 , f 10 } .
For the extended r r r -neighborhood shown in Figure 1 (b), V ( N 1 ( 0 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } V(N_1^{(0)}) = \{x_1, x_2, x_3, x_4, x_5, x_6, x_8, f_1, f_2, f_4, f_6, f_7, f_{10}\} V ( N 1 ( 0 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } , and V ( N 1 ( 2 ) ) = V ( N 1 ( 0 ) ) V(N_1^{(2)}) = V(N_1^{(0)}) V ( N 1 ( 2 ) ) = V ( N 1 ( 0 ) ) . For r = 4 r = 4 r = 4 , V ( N 1 ( 4 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , x 11 , x 12 , x 13 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 10 , f 14 , f 15 } V(N_1^{(4)}) = \{x_1, x_2, x_3, x_4, x_5, x_6, x_8, x_{11}, x_{12}, x_{13}, f_1, f_2, f_3, f_4, f_5, f_6, f_7, f_{10}, f_{14}, f_{15}\} V ( N 1 ( 4 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , x 11 , x 12 , x 13 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 10 , f 14 , f 15 } . For r = 6 r = 6 r = 6 , V ( N 1 ( 6 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , x 11 , x 12 , x 13 , x 14 , x 15 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 , f 9 , f 10 , f 14 , f 15 } V(N_1^{(6)}) = \{x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_{11}, x_{12}, x_{13}, x_{14}, x_{15}, f_1, f_2, f_3, f_4, f_5, f_6, f_7, f_8, f_9, f_{10}, f_{14}, f_{15}\} V ( N 1 ( 6 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 , x 8 , x 11 , x 12 , x 13 , x 14 , x 15 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 , f 9 , f 10 , f 14 , f 15 } . In particular, the orange and green node sets in Figure 1 (a), V ( M f 3 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) V(M_{f_3}^{(6)}) \setminus V(M_1^{(6)}) V ( M f 3 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) and V ( M f 9 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) V(M_{f_9}^{(6)}) \setminus V(M_1^{(6)}) V ( M f 9 ( 6 ) ) ∖ V ( M 1 ( 6 ) ) , respectively, are incorporated through the recursive construction of the extended r r r -neighborhood.
Figure 1 (b) also illustrates the residual r r r -neighborhood. For r = 0 r = 0 r = 0 , V ( N 4 ( 0 ) ) = { x 1 , x 4 , x 5 , x 9 , x 10 , f 4 , f 5 , f 11 , f 12 } V(N_{4}^{(0)}) = \{x_1, x_4, x_5, x_9, x_{10}, f_4, f_5, f_{11}, f_{12}\} V ( N 4 ( 0 ) ) = { x 1 , x 4 , x 5 , x 9 , x 10 , f 4 , f 5 , f 11 , f 12 } . Together with V ( N 1 ( 0 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } V(N_1^{(0)}) = \{x_1, x_2, x_3, x_4, x_5, x_6, x_8, f_1, f_2, f_4, f_6, f_7, f_{10}\} V ( N 1 ( 0 ) ) = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 8 , f 1 , f 2 , f 4 , f 6 , f 7 , f 10 } , this gives V ( N 4 ∖ 1 ( 0 ) ) = { x 4 , x 5 , x 9 , x 10 , f 5 , f 11 , f 12 } V(N_{4\setminus1}^{(0)}) = \{x_4, x_5, x_9, x_{10}, f_5, f_{11}, f_{12}\} V ( N 4 ∖ 1 ( 0 ) ) = { x 4 , x 5 , x 9 , x 10 , f 5 , f 11 , f 12 } . Note that x 5 x_5 x 5 is included in V ( N 4 ∖ 1 ( 0 ) ) V(N_{4\setminus1}^{(0)}) V ( N 4 ∖ 1 ( 0 ) ) since it is connected to the factor node f 5 f_5 f 5 . For r = 6 r = 6 r = 6 , V ( N 4 ∖ 1 ( 6 ) ) = { x 4 , x 9 , x 10 , f 11 , f 12 , f 13 } V(N_{4\setminus1}^{(6)}) = \{x_4, x_9, x_{10}, f_{11}, f_{12}, f_{13}\} V ( N 4 ∖ 1 ( 6 ) ) = { x 4 , x 9 , x 10 , f 11 , f 12 , f 13 } .
Remark 1: The dominant computational cost of Algorithm 1 arises from enumerating paths of length at most r r r between distinct neighbors of each node (Definition 1), of which computational complexity is O ( ( max u ∈ X ∪ F ∣ N u ∣ ) r ) O((\max_{u \in\mathcal{X} \cup\mathcal{F}} |N_u|)^r) O (( max u ∈ X ∪ F ∣ N u ∣ ) r ) . In practice, to reduce the computational cost, we can employ two exactness-preserving pruning rules. First, for a focal node v v v , any path joining two neighbors of v v v without passing through v v v forms a loop through v v v with the two incident edges; the search is thus confined to the corresponding biconnected component (BCC), computed by the standard depth-first lowpoint algorithm [30 ] , discarding tree-like branches that do not belong to such loops. Second, a multi-source breadth-first search from N v N_v N v on G ∖ { v } G \setminus\{v\} G ∖ { v } gives the shortest-hop distance dist v ( w ) \operatorname{dist}_v(w) dist v ( w ) from w w w to its nearest node in N v N_v N v ; when a partial path of length ℓ \ell ℓ is extended by one edge to a candidate node w w w , the extension is pruned once ℓ + 1 + dist v ( w ) > r \ell+ 1 + \operatorname{dist}_v(w) > r ℓ + 1 + dist v ( w ) > r , since any continuation through w w w exceeds the length bound r r r before reaching another neighbor. Since dist v ( ⋅ ) \operatorname{dist}_v(\cdot) dist v ( ⋅ ) is a lower bound on the remaining path length [31 ] , this rule removes only infeasible branches. The two pruning rules together leave the returned neighborhood unchanged and substantially reduce the computational cost.
General message passing rules
Given the definitions of the preliminary r r r -neighborhood , extended r r r -neighborhood , and residual r r r -neighborhood , we now derive the general ENMP update rules. For notational brevity, we omit the superscript r r r in the remainder of this article (e.g., using N j ∖ i N_{j\setminus i} N j ∖ i to refer to N j ∖ i ( r ) N_{j\setminus i}^{(r)} N j ∖ i ( r ) ). For a neighborhood N N N , either an extended neighborhood N i N_i N i or a residual neighborhood N j ∖ i N_{j\setminus i} N j ∖ i , let X N = V ( N ) ∩ X \mathcal{X}_N = V(N) \cap\mathcal{X} X N = V ( N ) ∩ X and F N = V ( N ) ∩ F \mathcal{F}_N = V(N) \cap\mathcal{F} F N = V ( N ) ∩ F denote its variable-node set and factor-node set, respectively. For x k ∈ x N x_k \in\boldsymbol{x}_N x k ∈ x N , let x N ∖ k = x N ∖ { x k } \boldsymbol{x}_{N\setminus k} = \boldsymbol{x}_N \setminus\{x_k\} x N ∖ k = x N ∖ { x k } . When the variables in x N \boldsymbol{x}_N x N are ordered, x N \boldsymbol{x}_N x N denotes the resulting stacked vector.
Consider the message-passing process rooted at a variable node x i x_i x i . The key idea of ENMP is to separate the computation of the global potential function ψ ( x ) \psi(\boldsymbol{x}) ψ ( x ) in (1) into local computations over the extended and residual neighborhoods. Specifically, let T i ( ℓ ) \mathcal{T}_i^{(\ell)} T i ( ℓ ) denote the set of neighborhoods in the ℓ \ell ℓ th layer of the recursive expansion starting from the extended neighborhood N i \mathcal{N}_i N i of x i x_i x i . These layers are defined by
T i ( 1 ) = { N i } , T i ( 2 ) = { N j ∖ i ∣ x j ∈ x N i ∖ i } , T i ( ℓ + 1 ) = ⋃ N j ∖ h ∈ T i ( ℓ ) { N k ∖ j ∣ x k ∈ x N j ∖ h ∖ j } , ℓ ≥ 2. (3) \begin{aligned}
\mathcal{T}_i^{(1)} &= \{\mathcal{N}_i\},\\
\mathcal{T}_i^{(2)} &= \{\mathcal{N}_{j\setminus i}\mid x_j\in\boldsymbol{x}_{\mathcal{N}_i\setminus i}\},\\
\mathcal{T}_i^{(\ell+1)} &= \bigcup_{\mathcal{N}_{j\setminus h}\in\mathcal{T}_i^{(\ell)}}\{\mathcal{N}_{k\setminus j}\mid x_k\in\boldsymbol{x}_{\mathcal{N}_{j\setminus h}\setminus j}\},\quad\ell\ge2. \tag*{(3)}
\end{aligned} T i ( 1 ) T i ( 2 ) T i ( ℓ + 1 ) = { N i } , = { N j ∖ i ∣ x j ∈ x N i ∖ i } , = N j ∖ h ∈ T i ( ℓ ) ⋃ { N k ∖ j ∣ x k ∈ x N j ∖ h ∖ j } , ℓ ≥ 2. (3)
The sets { T i ( ℓ ) } ℓ ≥ 1 \{\mathcal{T}_i^{(\ell)}\}_{\ell\ge1} { T i ( ℓ ) } ℓ ≥ 1 define a layered recursive expansion starting from N i \mathcal{N}_i N i . If T i ( K + 1 ) = ∅ \mathcal{T}_i^{(K+1)}=\emptyset T i ( K + 1 ) = ∅ for some finite K K K , then the expansion terminates after K K K layers.
Based on this layered expansion, we first derive an exact hierarchical decomposition of ψ ( x ) \psi(\boldsymbol{x}) ψ ( x ) and the corresponding message-passing equations for r ≥ L max − 2 r\ge L_{\max}-2 r ≥ L m a x − 2 . We then discuss how the same equations can be used as an approximation when r < L max − 2 r<L_{\max}-2 r < L m a x − 2 .
1) Exact regime
When r ≥ L max − 2 r\ge L_{\max}-2 r ≥ L m a x − 2 , every loop in the factor graph G \mathbb{G} G has length at most r + 2 r+2 r + 2 . Under this condition, the recursive expansion starting from N i \mathcal{N}_i N i terminates after a finite number K K K of layers, with T i ( K + 1 ) = ∅ \mathcal{T}_i^{(K+1)}=\emptyset T i ( K + 1 ) = ∅ . The global potential function ψ ( x ) \psi(\boldsymbol{x}) ψ ( x ) then admits the hierarchical decomposition
ψ ( x ) = ∏ ℓ = 1 K ∏ N ∈ T i ( ℓ ) Φ N ( x N ) , (4) \psi(\boldsymbol{x})=\prod_{\ell=1}^{K}\prod_{\mathcal{N}\in\mathcal{T}_i^{(\ell)}}\Phi_{\mathcal{N}}(\boldsymbol{x}_{\mathcal{N}}), \tag*{(4)} ψ ( x ) = ℓ = 1 ∏ K N ∈ T i ( ℓ ) ∏ Φ N ( x N ) , (4)
where N = N i \mathcal{N}=\mathcal{N}_i N = N i in the first layer and N \mathcal{N} N is a residual neighborhood in every subsequent layer. The corresponding local potential function is defined by
Φ N ( x N ) = ∏ f a ∈ f N f a ( x a ) . (5) \Phi_{\mathcal{N}}(\boldsymbol{x}_{\mathcal{N}})=\prod_{f_a\in\mathcal{f}_{\mathcal{N}}}f_a(x_a). \tag*{(5)} Φ N ( x N ) = f a ∈ f N ∏ f a ( x a ) . (5)
If a neighborhood N \mathcal{N} N contains no factor node, then f N = ∅ \mathcal{f}_{\mathcal{N}}=\emptyset f N = ∅ , and (5) gives Φ N ( x N ) = 1 \Phi_{\mathcal{N}}(\boldsymbol{x}_{\mathcal{N}})=1 Φ N ( x N ) = 1 . Such a case arises when V ( N j ) ⊆ V ( N i ) V(\mathcal{N}_j)\subseteq V(\mathcal{N}_i) V ( N j ) ⊆ V ( N i ) : then V ( N j ∖ i ) = { x j } V(\mathcal{N}_{j\setminus i})=\{x_j\} V ( N j ∖ i ) = { x j } and Φ N j ∖ i ( x N j ∖ i ) = 1 \Phi_{\mathcal{N}_{j\setminus i}}(\boldsymbol{x}_{\mathcal{N}_{j\setminus i}})=1 Φ N j ∖ i ( x N j ∖ i ) = 1 . For example, in Figure 1 (b), when r ≥ 4 r\ge4 r ≥ 4 , V ( N 11 ) ⊆ V ( N 1 ) V(\mathcal{N}_{11})\subseteq V(\mathcal{N}_1) V ( N 11 ) ⊆ V ( N 1 ) and V ( N 11 ∖ 1 ) = { x 11 } V(\mathcal{N}_{11\setminus1})=\{x_{11}\} V ( N 11 ∖ 1 ) = { x 11 } , so Φ N 11 ∖ 1 ( x N 11 ∖ 1 ) = 1 \Phi_{\mathcal{N}_{11\setminus1}}(\boldsymbol{x}_{\mathcal{N}_{11\setminus1}})=1 Φ N 11 ∖ 1 ( x N 11 ∖ 1 ) = 1 .
The following lemma establishes the separation and termination properties of the recursive expansion and guarantees the exactness of (4).
Lemma 1 Consider a connected factor graph G \mathbb{G} G containing at least one loop, and let r ≥ L max − 2 r\ge L_{\max}-2 r ≥ L m a x − 2 . For every variable node x i x_i x i , the following properties hold.
( P 1 ) (P1) ( P 1 ) For every x j ∈ x N i ∖ i x_j\in\boldsymbol{x}_{\mathcal{N}_i\setminus i} x j ∈ x N i ∖ i , V ( N j ∖ i ) ∩ V ( N i ) = { x j } V(\mathcal{N}_{j\setminus i})\cap V(\mathcal{N}_i)=\{x_j\} V ( N j ∖ i ) ∩ V ( N i ) = { x j } .
( P 2 ) (P2) ( P 2 ) For every x j ∈ x N i ∖ i x_j\in\boldsymbol{x}_{\mathcal{N}_i\setminus i} x j ∈ x N i ∖ i , let D j ∖ i D_{j\setminus i} D j ∖ i denote the union of the node sets of N j ∖ i \mathcal{N}_{j\setminus i} N j ∖ i and all residual r r r -neighborhoods generated recursively from it by (3). Equivalently,
D j ∖ i = V ( N j ∖ i ) ∪ ⋃ x k ∈ x N j ∖ i ∖ j D k ∖ j . (6) D_{j\setminus i}=V(\mathcal{N}_{j\setminus i})\cup\bigcup_{x_k\in\boldsymbol{x}_{\mathcal{N}_{j\setminus i}\setminus j}}D_{k\setminus j}. \tag*{(6)} D j ∖ i = V ( N j ∖ i ) ∪ x k ∈ x N j ∖ i ∖ j ⋃ D k ∖ j . (6) Then D j ∖ i D_{j\setminus i} D j ∖ i induces a connected subgraph of G \mathbb{G} G , D j ∖ i ∩ V ( N i ) = { x j } D_{j\setminus i}\cap V(\mathcal{N}_i)=\{x_j\} D j ∖ i ∩ V ( N i ) = { x j } , and, for any two distinct variables x j 1 , x j 2 ∈ x N i ∖ i x_{j_1},x_{j_2}\in\boldsymbol{x}_{\mathcal{N}_i\setminus i} x j 1 , x j 2 ∈ x N i ∖ i , D j 1 ∖ i ∩ D j 2 ∖ i = ∅ D_{j_1\setminus i}\cap D_{j_2\setminus i}=\emptyset D j 1 ∖ i ∩ D j 2 ∖ i = ∅ .
( P 3 ) (P3) ( P 3 ) For any variables x j 1 , x j 2 , … , x j n x_{j_1},x_{j_2},\ldots,x_{j_n} x j 1 , x j 2 , … , x j n , with j 0 = i j_0=i j 0 = i , satisfying
x j 1 ∈ x N i ∖ i , x j ℓ + 1 ∈ x N j ℓ ∖ j ℓ − 1 , ℓ = 1 , … , n − 1 , x_{j_1}\in\boldsymbol{x}_{\mathcal{N}_{i\setminus i}},\qquad x_{j_{\ell+1}}\in\boldsymbol{x}_{\mathcal{N}_{j_\ell\setminus j_{\ell-1}}},\quad\ell=1,\ldots,n-1, x j 1 ∈ x N i ∖ i , x j ℓ + 1 ∈ x N j ℓ ∖ j ℓ − 1 , ℓ = 1 , … , n − 1 , the variables x i , x j 1 , x j 2 , … , x j n x_i,x_{j_1},x_{j_2},\ldots,x_{j_n} x i , x j 1 , x j 2 , … , x j n are pairwise distinct. Consequently, the recursive expansion in (3) is acyclic and satisfies T i ( K + 1 ) = ∅ \mathcal{T}_i^{(K+1)}=\emptyset T i ( K + 1 ) = ∅ for some K ≤ ∣ X ∣ K\le|\mathcal{X}| K ≤ ∣ X ∣ .
( P 4 ) (P4) ( P 4 ) The factor-node sets f N \mathcal{f}_{\mathcal{N}} f N , N ∈ ⋃ ℓ = 1 K T i ( ℓ ) \mathcal{N}\in\bigcup_{\ell=1}^{K}\mathcal{T}_i^{(\ell)} N ∈ ⋃ ℓ = 1 K T i ( ℓ ) , form a partition of F \mathcal{F} F . Consequently, the hierarchical decomposition (4) holds with equality.
The proof of Lemma 1, together with an auxiliary result, is provided in Appendix A.
Since the decomposition (4) holds with equality under r ≥ L max − 2 r\ge L_{\max}-2 r ≥ L m a x − 2 , the marginal PDF of x i x_i x i can be expressed as
q i ( x i ) ∝ ∫ ∏ ℓ = 1 K ∏ N ∈ T i ( ℓ ) Φ N ( x N ) d x i . (7) q_i(x_i)\propto\int\prod_{\ell=1}^{K}\prod_{\mathcal{N}\in\mathcal{T}_i^{(\ell)}}\Phi_{\mathcal{N}}(\boldsymbol{x}_{\mathcal{N}})\,d\boldsymbol{x}^i. \tag*{(7)} q i ( x i ) ∝ ∫ ℓ = 1 ∏ K N ∈ T i ( ℓ ) ∏ Φ N ( x N ) d x i . (7)
To evaluate (7) recursively, for each x j ∈ x N i ∖ i x_j\in\boldsymbol{x}_{\mathcal{N}_i\setminus i} x j ∈ x N i ∖ i , define
Ψ j ∖ i = ∏ f a ∈ D j ∖ i ∩ F f a ( x a ) . (8) \Psi_{j\setminus i}=\prod_{f_a\in D_{j\setminus i}\cap\mathcal{F}}f_a(x_a). \tag*{(8)} Ψ j ∖ i = f a ∈ D j ∖ i ∩ F ∏ f a ( x a ) . (8)
Since T i ( 1 ) = N i \mathcal{T}_i^{(1)}=\mathcal{N}_i T i ( 1 ) = N i and D j ∖ i D_{j\setminus i} D j ∖ i contains N j ∖ i \mathcal{N}_{j\setminus i} N j ∖ i and all residual neighborhoods generated recursively from it, (P2) and (P4) of Lemma 1 give
ψ ( x ) = Φ N i ( x N i ) ∏ x j ∈ x N i ∖ i Ψ j ∖ i . (9) \psi(\boldsymbol{x})=\Phi_{\mathcal{N}_i}(\boldsymbol{x}_{\mathcal{N}_i})\prod_{x_j\in\boldsymbol{x}_{\mathcal{N}_i\setminus i}}\Psi_{j\setminus i}. \tag*{(9)} ψ ( x ) = Φ N i ( x N i ) x j ∈ x N i ∖ i ∏ Ψ j ∖ i . (9)
Moreover, by (6) and (P2) of Lemma 1,
Ψ j \ i = Φ N j \ i ( x N j \ i ) ∏ x k ∈ x N j \ i \ j Ψ k \ j . (10) \Psi_{j\backslash i}=\Phi_{\mathcal{N}_{j\backslash i}}(\boldsymbol{x}_{\mathcal{N}_{j\backslash i}})\prod_{x_k\in\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}}\Psi_{k\backslash j}. \tag*{(10)} Ψ j \ i = Φ N j \ i ( x N j \ i ) x k ∈ x N j \ i \ j ∏ Ψ k \ j . (10)
Accordingly, let q i ← j ( x j ) q_{i\leftarrow j}(x_j) q i ← j ( x j ) denote the result of marginalizing Ψ j \ i \Psi_{j\backslash i} Ψ j \ i over all variables contained in D j \ i D_{j\backslash i} D j \ i except x j x_j x j . Using (9) and (10) , (7) can then be written recursively as
q i ( x i ) = 1 Z i ∫ Φ N i ( x N i ) ∏ x j ∈ x N i \ i q i ← j ( x j ) d x N i \ i (11) q_i(x_i)=\frac{1}{Z_i}\int\Phi_{\mathcal{N}_i}(\boldsymbol{x}_{\mathcal{N}_i})\prod_{x_j\in\boldsymbol{x}_{\mathcal{N}_i\backslash i}}q_{i\leftarrow j}(x_j)\,d\boldsymbol{x}_{\mathcal{N}_i\backslash i} \tag*{(11)} q i ( x i ) = Z i 1 ∫ Φ N i ( x N i ) x j ∈ x N i \ i ∏ q i ← j ( x j ) d x N i \ i (11)
with
q i ← j ( x j ) = ∫ Φ N j \ i ( x N j \ i ) ∏ x k ∈ x N j \ i \ j q j ← k ( x k ) d x N j \ i \ j , (12) q_{i\leftarrow j}(x_j)=\int\Phi_{\mathcal{N}_{j\backslash i}}(\boldsymbol{x}_{\mathcal{N}_{j\backslash i}})\prod_{x_k\in\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}}q_{j\leftarrow k}(x_k)\,d\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}, \tag*{(12)} q i ← j ( x j ) = ∫ Φ N j \ i ( x N j \ i ) x k ∈ x N j \ i \ j ∏ q j ← k ( x k ) d x N j \ i \ j , (12)
where 1 / Z i 1/Z_i 1/ Z i is the normalization constant.
Equations (11) and (12) establish the general update rules of ENMP, and the ENMP algorithm is summarized in Algorithm 2, where q i ← j t ( x j ) q^t_{i\leftarrow j}(x_j) q i ← j t ( x j ) denotes the message from x j x_j x j to x i x_i x i at the t t t th iteration.
Algorithm 2 The ENMP algorithm for inferring x i x_i x i .
Require: The factor graph G \mathsf{G} G , maximum iterations β \beta β , convergence criterion δ \delta δ , and the value of r r r ;
Ensure: Beliefs q ( x i ) q(x_i) q ( x i ) , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x ;
Generate extended r r r -neighborhood N i \mathcal{N}_i N i via Algorithm 1 for all x i x_i x i ;
Initialize t = 1 t=1 t = 1 , e = ∞ e=\infty e = ∞ ;
for all x i x_i x i , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x do
Initialize q i ← j 0 = c o n s t q^0_{i\leftarrow j}=\mathrm{const} q i ← j 0 = const , ∀ x j ∈ x N i \ i \forall x_j\in\boldsymbol{x}_{\mathcal{N}_i\backslash i} ∀ x j ∈ x N i \ i ;
end for
while e > δ e>\delta e > δ and t ≤ β t\le\beta t ≤ β do
for all x i x_i x i , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x do
for all x j ∈ x N i \ i x_j\in\boldsymbol{x}_{\mathcal{N}_i\backslash i} x j ∈ x N i \ i do
Compute q i ← j t ( x j ) q^t_{i\leftarrow j}(x_j) q i ← j t ( x j ) via (12) using { q j ← k t − 1 } \{q^{t-1}_{j\leftarrow k}\} { q j ← k t − 1 } , ∀ x k ∈ x N j \ i \ j \forall x_k\in\boldsymbol{x}_{\mathcal{N}_j\backslash i\backslash j} ∀ x k ∈ x N j \ i \ j ;
end for
end for
e ← max i , j ∥ q i ← j t − q i ← j t − 1 ∥ ∞ e\leftarrow\max_{i,j}\lVert q^t_{i\leftarrow j}-q^{t-1}_{i\leftarrow j}\rVert_\infty e ← max i , j ∥ q i ← j t − q i ← j t − 1 ∥ ∞ ;
t ← t + 1 t\leftarrow t+1 t ← t + 1 ;
end while
Compute beliefs q ( x i ) q(x_i) q ( x i ) via (11) for all i i i ;
Return q ( x i ) q(x_i) q ( x i ) .
Theorem 1 below establishes that, under the exact regime r ≥ L max − 2 r\ge\mathcal{L}_{\max}-2 r ≥ L m a x − 2 , the message updates (12) converge to a unique fixed point in at most ∣ X ∣ |\mathcal{X}| ∣ X ∣ iterations, and the resulting beliefs are the exact marginals.
Theorem 1 Consider a connected factor graph G \mathsf{G} G containing at least one loop. If r ≥ L max − 2 r\ge\mathcal{L}_{\max}-2 r ≥ L m a x − 2 , then the message updates (12) converge to a unique fixed point in at most ∣ X ∣ |\mathcal{X}| ∣ X ∣ iterations. Moreover, the resulting belief satisfies q i ( x i ) = P ( x i ) q_i(x_i)=P(x_i) q i ( x i ) = P ( x i ) for every variable node x i x_i x i .
PROOF.
We prove the three conclusions of the theorem in order.
(i) The message updates (12) converge in at most ∣ X ∣ |\mathcal{X}| ∣ X ∣ iterations.
For each message q i ← j ( x j ) q_{i\leftarrow j}(x_j) q i ← j ( x j ) , define its update depth by
d i ← j = 1 + max x k ∈ x N j \ i \ j d j ← k , max ∅ = 0. (13) d_{i\leftarrow j}=1+\max_{x_k\in\boldsymbol{x}_{\mathcal{N}_j\backslash i\backslash j}}d_{j\leftarrow k},\qquad\max\varnothing=0. \tag*{(13)} d i ← j = 1 + x k ∈ x N j \ i \ j max d j ← k , max ∅ = 0. (13)
For any residual neighborhood N b \ a ∈ T i ( ℓ ) N_{b\backslash a}\in\mathcal{T}^{(\ell)}_i N b \ a ∈ T i ( ℓ ) , (3) implies that N c \ b ∈ T i ( ℓ + 1 ) N_{c\backslash b}\in\mathcal{T}^{(\ell+1)}_i N c \ b ∈ T i ( ℓ + 1 ) for every x c ∈ x N b \ a \ b x_c\in\boldsymbol{x}_{N_{b\backslash a}\backslash b} x c ∈ x N b \ a \ b . Hence, d a ← b d_{a\leftarrow b} d a ← b depends only on the update depths associated with residual neighborhoods in T i ( ℓ + 1 ) \mathcal{T}^{(\ell+1)}_i T i ( ℓ + 1 ) . By Lemma 1 (P3), the recursive expansion is acyclic and T i ( K + 1 ) = ∅ \mathcal{T}^{(K+1)}_i=\varnothing T i ( K + 1 ) = ∅ for some K ≤ ∣ X ∣ K\le|\mathcal{X}| K ≤ ∣ X ∣ . The update depths can therefore be defined backward from layer K K K , where they equal one. Backward induction gives
d a ← b ≤ K − ℓ + 1 , N b \ a ∈ T i ( ℓ ) . d_{a\leftarrow b}\le K-\ell+1,\qquad N_{b\backslash a}\in\mathcal{T}^{(\ell)}_i. d a ← b ≤ K − ℓ + 1 , N b \ a ∈ T i ( ℓ ) .
Since N j \ i ∈ T i ( 2 ) N_{j\backslash i}\in\mathcal{T}^{(2)}_i N j \ i ∈ T i ( 2 ) , it follows that d i ← j ≤ K − 1 ≤ ∣ X ∣ d_{i\leftarrow j}\le K-1\le|\mathcal{X}| d i ← j ≤ K − 1 ≤ ∣ X ∣ .
For each message, define q ˉ i ← j ( x j ) \bar q_{i\leftarrow j}(x_j) q ˉ i ← j ( x j ) recursively by
q ˉ i ← j ( x j ) = ∫ Φ N j \ i ( x N j \ i ) ∏ x k ∈ x N j \ i \ j q ˉ j ← k ( x k ) d x N j \ i \ j , (14) \bar q_{i\leftarrow j}(x_j)=\int\Phi_{\mathcal{N}_{j\backslash i}}(\boldsymbol{x}_{\mathcal{N}_{j\backslash i}})\prod_{x_k\in\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}}\bar q_{j\leftarrow k}(x_k)\,d\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}, \tag*{(14)} q ˉ i ← j ( x j ) = ∫ Φ N j \ i ( x N j \ i ) x k ∈ x N j \ i \ j ∏ q ˉ j ← k ( x k ) d x N j \ i \ j , (14)
where the base case d i ← j = 1 d_{i\leftarrow j}=1 d i ← j = 1 requires no incoming messages, while for d i ← j > 1 d_{i\leftarrow j}>1 d i ← j > 1 , every message q j ← k q_{j\leftarrow k} q j ← k on the right-hand side has update depth strictly less than d i ← j d_{i\leftarrow j} d i ← j .
We now prove by induction on d i ← j d_{i\leftarrow j} d i ← j that
q i ← j t ( x j ) = q ˉ i ← j ( x j ) , t ≥ d i ← j . (15) q^t_{i\leftarrow j}(x_j)=\bar q_{i\leftarrow j}(x_j),\qquad t\ge d_{i\leftarrow j}. \tag*{(15)} q i ← j t ( x j ) = q ˉ i ← j ( x j ) , t ≥ d i ← j . (15)
If d i ← j = 1 d_{i\leftarrow j}=1 d i ← j = 1 , then x N j \ i \ j = ∅ \boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j}=\varnothing x N j \ i \ j = ∅ . Thus, the update of q i ← j q_{i\leftarrow j} q i ← j is independent of all incoming messages, and its first update gives q i ← j 1 = q ˉ i ← j q^1_{i\leftarrow j}=\bar q_{i\leftarrow j} q i ← j 1 = q ˉ i ← j . Since the same update is performed at every subsequent iteration, q i ← j t ( x j ) = q ˉ i ← j ( x j ) q^t_{i\leftarrow j}(x_j)=\bar q_{i\leftarrow j}(x_j) q i ← j t ( x j ) = q ˉ i ← j ( x j ) for all t ≥ 1 t\ge1 t ≥ 1 .
If d i ← j = s + 1 d_{i\leftarrow j}=s+1 d i ← j = s + 1 for some s ≥ 1 s\ge1 s ≥ 1 , suppose that (15) holds for all messages with update depth at most s s s . By (13) , every message q j ← k q_{j\leftarrow k} q j ← k with x k ∈ x N j \ i \ j x_k\in\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j} x k ∈ x N j \ i \ j has update depth at most s s s , so q j ← k t ( x k ) = q ˉ j ← k ( x k ) q^t_{j\leftarrow k}(x_k)=\bar q_{j\leftarrow k}(x_k) q j ← k t ( x k ) = q ˉ j ← k ( x k ) for every x k ∈ x N j \ i \ j x_k\in\boldsymbol{x}_{\mathcal{N}_{j\backslash i}\backslash j} x k ∈ x N j \ i \ j . Substituting q j ← k s ( x k ) = q ˉ j ← k ( x k ) q^s_{j\leftarrow k}(x_k)=\bar q_{j\leftarrow k}(x_k) q j ← k s ( x k ) = q ˉ j ← k ( x k ) into (12) gives q i ← j s + 1 ( x j ) = q ˉ i ← j ( x j ) q^{s+1}_{i\leftarrow j}(x_j)=\bar q_{i\leftarrow j}(x_j) q i ← j s + 1 ( x j ) = q ˉ i ← j ( x j ) , and hence q i ← j t ( x j ) = q ˉ i ← j ( x j ) q^t_{i\leftarrow j}(x_j)=\bar q_{i\leftarrow j}(x_j) q i ← j t ( x j ) = q ˉ i ← j ( x j ) for all t ≥ s + 1 t\ge s+1 t ≥ s + 1 . This completes the induction.
Since d i ← j ≤ ∣ X ∣ d_{i\leftarrow j}\le|\mathcal{X}| d i ← j ≤ ∣ X ∣ for every message, (15) implies that all messages satisfy q i ← j t = q ˉ i ← j q^t_{i\leftarrow j}=\bar q_{i\leftarrow j} q i ← j t = q ˉ i ← j for t ≥ ∣ X ∣ t\ge|\mathcal{X}| t ≥ ∣ X ∣ , regardless of initialization. Moreover, (14) shows that { q ˉ i ← j } \{\bar{q}_{i\leftarrow j}\} { q ˉ i ← j } satisfies the fixed-point equations of (12). Hence, the message updates converge to this fixed point in at most ∣ X ∣ |\mathcal{X}| ∣ X ∣ iterations.
(ii) The fixed point of the message updates (12) is unique.
We have shown that { q ˉ i ← j } \{\bar{q}_{i\leftarrow j}\} { q ˉ i ← j } is a fixed point of (12). To establish uniqueness, let { q i ← j ∗ } \{q^{*}_{i\leftarrow j}\} { q i ← j ∗ } be any fixed point. We prove by induction on d i ← j d_{i\leftarrow j} d i ← j that q i ← j ∗ = q ˉ i ← j q^{*}_{i\leftarrow j}=\bar{q}_{i\leftarrow j} q i ← j ∗ = q ˉ i ← j for every message.
By (12), the update of q i ← j q_{i\leftarrow j} q i ← j uses exactly the messages { q j ← k : x k ∈ X N j ∖ i ∖ j } \{q_{j\leftarrow k}:x_k\in\mathcal{X}_{N_j\setminus i\setminus j}\} { q j ← k : x k ∈ X N j ∖ i ∖ j } .
If d i ← j = 1 d_{i\leftarrow j}=1 d i ← j = 1 , then X N j ∖ i ∖ j = ∅ \mathcal{X}_{N_j\setminus i\setminus j}=\varnothing X N j ∖ i ∖ j = ∅ . Hence, the right-hand sides of (12) and (14) are identical. Since { q i ← j ∗ } \{q^{*}_{i\leftarrow j}\} { q i ← j ∗ } is a fixed point, the two equations give q i ← j ∗ = q ˉ i ← j q^{*}_{i\leftarrow j}=\bar{q}_{i\leftarrow j} q i ← j ∗ = q ˉ i ← j .
If d i ← j = s + 1 d_{i\leftarrow j}=s+1 d i ← j = s + 1 for some s ≥ 1 s\ge1 s ≥ 1 , assume that q a ← b ∗ = q ˉ a ← b q^{*}_{a\leftarrow b}=\bar{q}_{a\leftarrow b} q a ← b ∗ = q ˉ a ← b for every message with d a ← b ≤ s d_{a\leftarrow b}\le s d a ← b ≤ s . By (13), every message q j ← k q_{j\leftarrow k} q j ← k used in the update of q i ← j q_{i\leftarrow j} q i ← j satisfies d j ← k ≤ s d_{j\leftarrow k}\le s d j ← k ≤ s . Therefore,
q j ← k ∗ ( x k ) = q ˉ j ← k ( x k ) , x k ∈ X N j ∖ i ∖ j . q^{*}_{j\leftarrow k}(x_k)=\bar{q}_{j\leftarrow k}(x_k),\qquad x_k\in\mathcal{X}_{N_j\setminus i\setminus j}. q j ← k ∗ ( x k ) = q ˉ j ← k ( x k ) , x k ∈ X N j ∖ i ∖ j .
Since { q i ← j ∗ } \{q^{*}_{i\leftarrow j}\} { q i ← j ∗ } is a fixed point, (12), (14), and q j ← k ∗ = q ˉ j ← k q^{*}_{j\leftarrow k}=\bar{q}_{j\leftarrow k} q j ← k ∗ = q ˉ j ← k for every x k ∈ X N j ∖ i ∖ j x_k\in\mathcal{X}_{N_j\setminus i\setminus j} x k ∈ X N j ∖ i ∖ j imply q i ← j ∗ = q ˉ i ← j q^{*}_{i\leftarrow j}=\bar{q}_{i\leftarrow j} q i ← j ∗ = q ˉ i ← j . This completes the induction.
Since { q i ← j ∗ } \{q^{*}_{i\leftarrow j}\} { q i ← j ∗ } was arbitrary, every fixed point coincides with { q ˉ i ← j } \{\bar{q}_{i\leftarrow j}\} { q ˉ i ← j } . Therefore, the fixed point is unique.
(iii) The resulting beliefs satisfy q i ( x i ) = P ( x i ) q_i(x_i)=P(x_i) q i ( x i ) = P ( x i ) for every x i ∈ X x_i\in\mathcal{X} x i ∈ X .
The preceding results show that the message updates (12) converge to the unique fixed point { q ˉ i ← j } \{\bar{q}_{i\leftarrow j}\} { q ˉ i ← j } . Substituting these fixed-point messages into (11) and recursively applying (14) gives the marginalization in (7).
By Lemma 1 (P4), the hierarchical product in (7) equals the global potential function:
∏ ℓ = 1 K ∏ N ∈ T ( ℓ ) Φ N ( x N ) = ∏ f a ∈ F f a ( x a ) = ψ ( x ) . (16) \prod_{\ell=1}^{K}\prod_{N\in\mathcal{T}^{(\ell)}}\Phi_N(x_N)=\prod_{f_a\in\mathcal{F}}f_a(x_a)=\psi(x). \tag*{(16)} ℓ = 1 ∏ K N ∈ T ( ℓ ) ∏ Φ N ( x N ) = f a ∈ F ∏ f a ( x a ) = ψ ( x ) . (16)
Therefore,
q i ( x i ) = 1 Z i ∫ ψ ( x ) d x i − = P ( x i ) . (17) q_i(x_i)=\frac{1}{Z_i}\int\psi(x)\,dx^{i-}=P(x_i). \tag*{(17)} q i ( x i ) = Z i 1 ∫ ψ ( x ) d x i − = P ( x i ) . (17)
This holds for every x i ∈ X x_i\in\mathcal{X} x i ∈ X , so the resulting beliefs are the exact marginals. This completes the proof. □ \square □
Approximate regime
When r < L max − 2 r<\mathcal{L}_{\max}-2 r < L m a x − 2 , loops longer than r + 2 r+2 r + 2 exist in G G G , and the residual neighborhoods may reconnect outside N i N_i N i . In this case, the decomposition in (4) is not guaranteed to hold with equality, as correlations induced by loops longer than r + 2 r+2 r + 2 may not be fully captured by the extended neighborhoods. Nonetheless, as observed in [21 ] , long loops typically introduce weaker correlations than short ones, and their density is often low in practice. Accordingly, the message-passing equations (11) and (12) can still be applied as an approximation: they incorporate information associated with short loops captured within the extended neighborhoods, while the effects of longer loops are treated approximately.
Remark 2: Theorem 1 guarantees that the message updates (12) converge to a fixed point and yield the exact marginals when r ≥ L max − 2 r\ge\mathcal{L}_{\max}-2 r ≥ L m a x − 2 . However, when r < L max − 2 r<\mathcal{L}_{\max}-2 r < L m a x − 2 , the exact separation properties of Lemma 1 no longer hold, and the message updates (12) reduce to an approximate iterative method with no convergence guarantee, whose empirical convergence behavior is reported in Section 4. Algorithm 2 implements these updates.
Remark 3: The condition r ≥ L max − 2 r\ge\mathcal{L}_{\max}-2 r ≥ L m a x − 2 is sufficient but not necessary for exact inference: because Algorithm 1 recursively absorbs the preliminary r r r -neighborhoods of included factor nodes, N i ( r ) N_i^{(r)} N i ( r ) may already capture all loop-induced correlations at some r < L max − 2 r<\mathcal{L}_{\max}-2 r < L m a x − 2 . Since L max \mathcal{L}_{\max} L m a x is NP-hard to compute on general graphs, the exact threshold cannot be determined in advance. In practice, r r r serves as a tuning parameter: as r r r increases, the extended neighborhoods capture more loop-induced correlations and inference accuracy generally improves, at the cost of higher computational overhead (cf. Remark 1). The value of r r r should therefore be chosen according to the available computational resources.
Note that ENMP with r = 0 r=0 r = 0 does not in general reduce to BP, since the extended 0 0 0 -neighborhood still incorporates the variables connected through the neighboring factor nodes. Consequently, the resulting extended and residual 0 0 0 -neighborhoods differ from the local neighborhoods used by BP, and the ENMP updates in (11) and (12) are generally different from the BP updates.
The computation of (11) and (12) depends on the variable type. When x i x_i x i is discrete, the integrals reduce to sums over its sample space. For continuous non-Gaussian variables, analytical evaluation is rarely possible, and the required integrals are approximated numerically through quadrature, discretization, or sampling-based techniques [32 ] . In the Gaussian case, however, closed-form expressions exist, and by working in the precision form, marginalization becomes a purely algebraic operation, typically carried out via block matrix manipulations such as the Schur complement [33 ] .
Gaussian message passing rules
When the factor graph is Gaussian, the integrals in (11) and (12) admit closed-form solutions. Each local factor f a ( x a ) ∝ exp ( − 1 2 x a T Λ a x a + η a T x a ) f_a(x_a) \propto\exp\left(-\frac{1}{2}x_a^{\mathsf{T}}\Lambda_a x_a+\eta_a^{\mathsf{T}}x_a\right) f a ( x a ) ∝ exp ( − 2 1 x a T Λ a x a + η a T x a ) in (1) takes the Gaussian canonical form, where Λ a \Lambda_a Λ a and η a \eta_a η a are the local precision matrix and potential vector. Any incoming message q j ← k ( x k ) q_{j\leftarrow k}(x_k) q j ← k ( x k ) from the previous iteration can also be represented in Gaussian canonical form, i.e., q j ← k ( x k ) ∝ exp ( − 1 2 Λ j ← k x k 2 + η j ← k x k ) q_{j\leftarrow k}(x_k) \propto\exp\left(-\frac{1}{2}\Lambda_{j\leftarrow k}x_k^2+\eta_{j\leftarrow k}x_k\right) q j ← k ( x k ) ∝ exp ( − 2 1 Λ j ← k x k 2 + η j ← k x k ) . This representation includes the noninformative constant message, for which Λ j ← k = 0 \Lambda_{j\leftarrow k}=0 Λ j ← k = 0 and η j ← k = 0 \eta_{j\leftarrow k}=0 η j ← k = 0 . We assume that all eliminated precision blocks are positive definite whenever marginalization is required.
Consequently, computing the message q i ← j ( x j ) q_{i\leftarrow j}(x_j) q i ← j ( x j ) requires two steps: aggregating the incoming information into a joint Gaussian potential over x N j ∖ i x_{\mathcal{N}_{j\setminus i}} x N j ∖ i , and then marginalizing out the remaining variables. Let x u = x N j ∖ i ∖ j x_u=x_{\mathcal{N}_{j\setminus i}\setminus j} x u = x N j ∖ i ∖ j , and order the variables as x N j ∖ i = [ x j , x u T ] T x_{\mathcal{N}_{j\setminus i}}=[x_j,x_u^{\mathsf{T}}]^{\mathsf{T}} x N j ∖ i = [ x j , x u T ] T . The aggregated precision matrix Λ N j ∖ i \Lambda_{\mathcal{N}_{j\setminus i}} Λ N j ∖ i and potential vector η N j ∖ i \eta_{\mathcal{N}_{j\setminus i}} η N j ∖ i of this joint Gaussian potential are given by
Λ N j ∖ i = [ Λ j j Λ j u Λ u j Λ u u ] = ∑ f a ∈ F N j ∖ i [ Λ a ] e x t + ∑ x k ∈ x N j ∖ i ∖ j [ Λ j ← k ] e x t , (18) \Lambda_{\mathcal{N}_{j\setminus i}}=
\begin{bmatrix}
\Lambda_{jj} & \Lambda_{ju}\\
\Lambda_{uj} & \Lambda_{uu}
\end{bmatrix}
=\sum_{f_a\in\mathcal{F}_{\mathcal{N}_{j\setminus i}}}[\Lambda_a]_{\mathrm{ext}}+\sum_{x_k\in x_{\mathcal{N}_{j\setminus i}\setminus j}}[\Lambda_{j\leftarrow k}]_{\mathrm{ext}}, \tag*{(18)} Λ N j ∖ i = [ Λ j j Λ u j Λ j u Λ uu ] = f a ∈ F N j ∖ i ∑ [ Λ a ] ext + x k ∈ x N j ∖ i ∖ j ∑ [ Λ j ← k ] ext , (18)
η N j ∖ i = [ η j η u ] = ∑ f a ∈ F N j ∖ i [ η a ] e x t + ∑ x k ∈ x N j ∖ i ∖ j [ η j ← k ] e x t , \eta_{\mathcal{N}_{j\setminus i}}=
\begin{bmatrix}
\eta_j\\
\eta_u
\end{bmatrix}
=\sum_{f_a\in\mathcal{F}_{\mathcal{N}_{j\setminus i}}}[\eta_a]_{\mathrm{ext}}+\sum_{x_k\in x_{\mathcal{N}_{j\setminus i}\setminus j}}[\eta_{j\leftarrow k}]_{\mathrm{ext}}, η N j ∖ i = [ η j η u ] = f a ∈ F N j ∖ i ∑ [ η a ] ext + x k ∈ x N j ∖ i ∖ j ∑ [ η j ← k ] ext ,
where [ ⋅ ] e x t [\cdot]_{\mathrm{ext}} [ ⋅ ] ext denotes the zero-padded expansion of parameters matching the dimension of x N j ∖ i x_{\mathcal{N}_{j\setminus i}} x N j ∖ i , Λ j j \Lambda_{jj} Λ j j is the scalar block corresponding to x j x_j x j , Λ j u \Lambda_{ju} Λ j u and Λ u j \Lambda_{uj} Λ u j are the corresponding row and column blocks, respectively, Λ u u \Lambda_{uu} Λ uu is the block corresponding to x u x_u x u , and, since the aggregated precision matrix is symmetric, Λ u j = Λ j u T \Lambda_{uj}=\Lambda_{ju}^{\mathsf{T}} Λ u j = Λ j u T . When x u x_u x u is nonempty and Λ u u ≻ 0 \Lambda_{uu}\succ0 Λ uu ≻ 0 , marginalizing x u x_u x u gives
Λ i ← j = Λ j j − Λ j u Λ u u − 1 Λ u j , \Lambda_{i\leftarrow j}=\Lambda_{jj}-\Lambda_{ju}\Lambda_{uu}^{-1}\Lambda_{uj}, Λ i ← j = Λ j j − Λ j u Λ uu − 1 Λ u j ,
η i ← j = η j − Λ j u Λ u u − 1 η u . (19) \eta_{i\leftarrow j}=\eta_j-\Lambda_{ju}\Lambda_{uu}^{-1}\eta_u. \tag*{(19)} η i ← j = η j − Λ j u Λ uu − 1 η u . (19)
If V ( N j ∖ i ) = { x j } V(\mathcal{N}_{j\setminus i})=\{x_j\} V ( N j ∖ i ) = { x j } , then Φ N j ∖ i ( x j ) = 1 \Phi_{\mathcal{N}_{j\setminus i}}(x_j)=1 Φ N j ∖ i ( x j ) = 1 and no marginalization is required. The resulting noninformative message is represented by Λ i ← j = 0 \Lambda_{i\leftarrow j}=0 Λ i ← j = 0 and η i ← j = 0 \eta_{i\leftarrow j}=0 η i ← j = 0 .
Finally, the marginal belief q i ( x i ) q_i(x_i) q i ( x i ) is computed from the extended neighborhood N i \mathcal{N}_i N i . Let x v = x N i ∖ i x_v=x_{\mathcal{N}_i\setminus i} x v = x N i ∖ i , and order the variables as x N i = [ x i , x v T ] T x_{\mathcal{N}_i}=[x_i,x_v^{\mathsf{T}}]^{\mathsf{T}} x N i = [ x i , x v T ] T . The aggregated precision matrix and potential vector are
Λ N i = [ Λ i i Λ i v Λ v i Λ v v ] = ∑ f a ∈ F N i [ Λ a ] e x t + ∑ x j ∈ x N i ∖ i [ Λ i ← j ] e x t , \Lambda_{\mathcal{N}_i}=
\begin{bmatrix}
\Lambda_{ii} & \Lambda_{iv}\\
\Lambda_{vi} & \Lambda_{vv}
\end{bmatrix}
=\sum_{f_a\in\mathcal{F}_{\mathcal{N}_i}}[\Lambda_a]_{\mathrm{ext}}+\sum_{x_j\in x_{\mathcal{N}_i\setminus i}}[\Lambda_{i\leftarrow j}]_{\mathrm{ext}}, Λ N i = [ Λ ii Λ v i Λ i v Λ v v ] = f a ∈ F N i ∑ [ Λ a ] ext + x j ∈ x N i ∖ i ∑ [ Λ i ← j ] ext ,
η N i = [ η i η v ] = ∑ f a ∈ F N i [ η a ] e x t + ∑ x j ∈ x N i ∖ i [ η i ← j ] e x t . (20) \eta_{\mathcal{N}_i}=
\begin{bmatrix}
\eta_i\\
\eta_v
\end{bmatrix}
=\sum_{f_a\in\mathcal{F}_{\mathcal{N}_i}}[\eta_a]_{\mathrm{ext}}+\sum_{x_j\in x_{\mathcal{N}_i\setminus i}}[\eta_{i\leftarrow j}]_{\mathrm{ext}}. \tag*{(20)} η N i = [ η i η v ] = f a ∈ F N i ∑ [ η a ] ext + x j ∈ x N i ∖ i ∑ [ η i ← j ] ext . (20)
When x v x_v x v is nonempty and Λ v v ≻ 0 \Lambda_{vv}\succ0 Λ v v ≻ 0 , marginalizing x v x_v x v gives the canonical parameters of q i ( x i ) q_i(x_i) q i ( x i ) :
Λ i b e l = Λ i i − Λ i v Λ v v − 1 Λ v i , η i b e l = η i − Λ i v Λ v v − 1 η v . (21) \Lambda_i^{\mathrm{bel}}=\Lambda_{ii}-\Lambda_{iv}\Lambda_{vv}^{-1}\Lambda_{vi},\qquad\eta_i^{\mathrm{bel}}=\eta_i-\Lambda_{iv}\Lambda_{vv}^{-1}\eta_v. \tag*{(21)} Λ i bel = Λ ii − Λ i v Λ v v − 1 Λ v i , η i bel = η i − Λ i v Λ v v − 1 η v . (21)
If Λ i b e l > 0 \Lambda_i^{\mathrm{bel}}>0 Λ i bel > 0 , the estimated marginal mean and variance are then
Σ ^ i = ( Λ i b e l ) − 1 , μ ^ i = Σ ^ i η i b e l . (22) \widehat{\Sigma}_i=\left(\Lambda_i^{\mathrm{bel}}\right)^{-1},\qquad\widehat{\mu}_i=\widehat{\Sigma}_i\eta_i^{\mathrm{bel}}. \tag*{(22)} Σ i = ( Λ i bel ) − 1 , μ i = Σ i η i bel . (22)
If x N i ∖ i x_{\mathcal{N}_i\setminus i} x N i ∖ i is empty, no marginalization is required, Λ i b e l = Λ i i \Lambda_i^{\mathrm{bel}}=\Lambda_{ii} Λ i bel = Λ ii , and η i b e l = η i \eta_i^{\mathrm{bel}}=\eta_i η i bel = η i .
Consequently, the general ENMP framework (Algorithm 2) is specialized to Gaussian factor graphs by replacing (11) with (21) –(22) , and (12) with (19) .
Remark 4: BP yields exact means but inaccurate variances when it converges on Gaussian graphical models with loops. The Gaussian ENMP updates in (19) and (22) address this directly: when r ≥ L max − 2 r\geq\mathcal{L}_{\max}-2 r ≥ L m a x − 2 , Theorem 1 guarantees exact μ ^ i \widehat{\mu}_i μ i and Σ ^ i \widehat{\Sigma}_i Σ i ; when r < L max − 2 r<\mathcal{L}_{\max}-2 r < L m a x − 2 , ENMP tends to improve variance estimates over BP, as demonstrated empirically in § 4 .
Computational complexity analysis
Having analyzed the cost of constructing the extended neighborhoods via Algorithm 1, we now analyze the computational complexity of the message updates. Let ∣ x N j ∖ i ∣ \lvert x_{\mathcal{N}_{j\setminus i}}\rvert ∣ x N j ∖ i ∣ denote the number of variable nodes contained in the residual r r r -neighborhood N j ∖ i r \mathcal{N}_{j\setminus i}^{r} N j ∖ i r , where the superscript r r r is omitted for notational brevity. Since the size of this neighborhood depends on r r r , the choice of r r r affects the computational cost of each message update.
For discrete random variables, the integral in (12) reduces to a summation over all configurations, scaling exponentially as O ( C ∣ x N j ∖ i ∣ ) O\left(C^{\lvert x_{\mathcal{N}_{j\setminus i}}\rvert}\right) O ( C ∣ x N j ∖ i ∣ ) , where C C C is the size of the sample space. When the residual neighborhoods become too large for exhaustive summation, the message summation may be approximated by Monte Carlo sampling [21 ] . For Gaussian random variables, Gaussian messages admit closed-form solutions via matrix operations, yielding polynomial complexity O ( ∣ x N j ∖ i ∣ 3 ) O\left(\lvert x_{\mathcal{N}_{j\setminus i}}\rvert^3\right) O ( ∣ x N j ∖ i ∣ 3 ) dominated by matrix inversion. For non-Gaussian continuous random variables, if discretization approximation is adopted, it leads to a similar exponential cost as the case of discrete random variables with C C C denoting the number of sampling points used per variable.
In each iteration, ENMP computes ∣ x N i ∣ \lvert x_{\mathcal{N}_i}\rvert ∣ x N i ∣ messages for every variable node x i x_i x i . For discrete or discretized continuous variables, the per-iteration complexity is
C i t e r ( r ) = O ( ∑ x i ∈ X ∑ x j ∈ x N i ∖ i C ∣ x N j ∖ i ∣ ) . \mathcal{C}_{\mathrm{iter}}^{(r)}=O\left(\sum_{x_i\in\mathcal{X}}\sum_{x_j\in x_{\mathcal{N}_i\setminus i}}C^{\lvert x_{\mathcal{N}_{j\setminus i}}\rvert}\right). C iter ( r ) = O x i ∈ X ∑ x j ∈ x N i ∖ i ∑ C ∣ x N j ∖ i ∣ .
For Gaussian distributions, it reduces to C i t e r ( r ) = ∑ x i ∈ X ∑ x j ∈ x N i ∖ i O ( ∣ x N j ∖ i ∣ 3 ) \mathcal{C}_{\mathrm{iter}}^{(r)} = \sum_{x_i \in\mathcal{X}} \sum_{x_j \in x_{\mathcal{N}_i \setminus i}} \mathcal{O}(|x_{\mathcal{N}_j \setminus i}|^3) C iter ( r ) = ∑ x i ∈ X ∑ x j ∈ x N i ∖ i O ( ∣ x N j ∖ i ∣ 3 ) . Let I ( r ) I^{(r)} I ( r ) denote the number of iterations required for convergence at parameter r r r ; the cumulative computation time until convergence is then O ( I ( r ) C i t e r ( r ) ) \mathcal{O}\left(I^{(r)}\mathcal{C}_{\mathrm{iter}}^{(r)}\right) O ( I ( r ) C iter ( r ) ) .
Simulation and Validation
We evaluate ENMP in two settings that span the continuous and discrete regimes. The Gaussian setting addresses DC state estimation in electric power systems over standard IEEE bus test cases (14, 118, 300, and 1354 buses), of which factor graphs are densely loopy; here ENMP is benchmarked against BP, sGaBP-m, and GBP, with GBP included only on the IEEE 14-bus system (Section 4.1). For the discrete setting, we validate ENMP on an Ising factor graph, comparing against BP and GBP (Section 4.2). Collectively, these settings assess ENMP on both continuous Gaussian and discrete distributions on factor graphs. Both settings are conducted with N M C = 50 N_{\mathrm{MC}} = 50 N MC = 50 independent Monte Carlo (MC) trials per experimental configuration.
ENMP for DC state estimation problem
Factor graph model
We consider the DC state estimation problem in electric power systems [34 , 35 ] using standard IEEE bus test cases (14, 118, 300, and 1354 buses). The objective is to estimate the posterior distribution of the bus voltage phase angles x = [ x 1 , x 2 , … , x n x ] T \boldsymbol{x} = [x_1, x_2, \ldots, x_{n_x}]^{\mathrm{T}} x = [ x 1 , x 2 , … , x n x ] T at all buses; the general DC model framework is given in [34 ] .
The prior distribution of x \boldsymbol{x} x is p ( x ) = ∏ i = 1 n x p ( x i ) p(\boldsymbol{x}) = \prod_{i=1}^{n_x} p(x_i) p ( x ) = ∏ i = 1 n x p ( x i ) , and each x i x_i x i is assumed to be Gaussian and centered at the initial bus voltage angle estimates provided by the IEEE data, that is, p ( x i ) = N ( x i ; μ i , Λ x i − 1 ) p(x_i) = \mathcal{N}(x_i; \mu_i, \Lambda_{x_i}^{-1}) p ( x i ) = N ( x i ; μ i , Λ x i − 1 ) , where μ i \mu_i μ i is the voltage angle from the IEEE case data and Λ x i \Lambda_{x_i} Λ x i is the precision matrix.
Active power injection and power flow measurements are considered. The measurement z j z_j z j is defined as z j = h j ( x ) + ϵ j z_j = h_j(\boldsymbol{x}) + \epsilon_j z j = h j ( x ) + ϵ j , where ϵ j ∼ N ( 0 , Λ z j − 1 ) \epsilon_j \sim\mathcal{N}(0,\Lambda_{z_j}^{-1}) ϵ j ∼ N ( 0 , Λ z j − 1 ) . For an injection at bus i i i or a power flow on line ( i , k ) (i,k) ( i , k ) , h j ( ⋅ ) h_j(\cdot) h j ( ⋅ ) is given by [34 ] ,
h j ( x ) = { ∑ k ∈ H ( i ) B i k ( x i − x k ) , power injection , B i k ( x i − x k ) , power flow . (23) h_j(\boldsymbol{x}) =
\begin{cases}
\sum_{k \in\mathcal{H}(i)} B_{ik}(x_i-x_k), & \text{power injection},\\
B_{ik}(x_i-x_k), & \text{power flow}.
\end{cases} \tag*{(23)} h j ( x ) = { ∑ k ∈ H ( i ) B ik ( x i − x k ) , B ik ( x i − x k ) , power injection , power flow . (23)
where B i k B_{ik} B ik is the susceptance of the line between buses i i i and k k k , and H ( i ) \mathcal{H}(i) H ( i ) denotes the set of neighboring buses of bus i i i . Stacking all measurements gives z = A x + ϵ \boldsymbol{z} = \boldsymbol{A}\boldsymbol{x} + \boldsymbol{\epsilon} z = A x + ϵ , where A = [ a 1 T , a 2 T , … , a n z T ] T ∈ R n z × n x \boldsymbol{A} = [\boldsymbol{a}_1^{\mathrm{T}}, \boldsymbol{a}_2^{\mathrm{T}}, \ldots, \boldsymbol{a}_{n_z}^{\mathrm{T}}]^{\mathrm{T}} \in\mathbb{R}^{n_z \times n_x} A = [ a 1 T , a 2 T , … , a n z T ] T ∈ R n z × n x , n z n_z n z is the number of measurements, a j = [ a 1 , j , a 2 , j , … , a n x , j ] T \boldsymbol{a}_j = [a_{1,j}, a_{2,j}, \ldots, a_{n_x,j}]^{\mathrm{T}} a j = [ a 1 , j , a 2 , j , … , a n x , j ] T is
the coefficient vector of A \boldsymbol{A} A corresponding to z j z_j z j , and ϵ = [ ϵ 1 , ϵ 2 , … , ϵ n z ] T \boldsymbol{\epsilon} = [\epsilon_1,\epsilon_2,\ldots,\epsilon_{n_z}]^{\mathrm{T}} ϵ = [ ϵ 1 , ϵ 2 , … , ϵ n z ] T .
Given the measurement likelihood p ( z ∣ x ) = ∏ j = 1 n z p ( z j ∣ x ) = ∏ j = 1 n z N ( z j ; a j x , Λ z j − 1 ) p(\boldsymbol{z}\mid\boldsymbol{x}) = \prod_{j=1}^{n_z} p(z_j\mid\boldsymbol{x}) = \prod_{j=1}^{n_z} \mathcal{N}(z_j;\boldsymbol{a}_j\boldsymbol{x},\Lambda_{z_j}^{-1}) p ( z ∣ x ) = ∏ j = 1 n z p ( z j ∣ x ) = ∏ j = 1 n z N ( z j ; a j x , Λ z j − 1 ) , the posterior is,
p ( x ∣ z ) ∝ ∏ i = 1 n x p ( x i ) ∏ j = 1 n z p ( z j ∣ x ) . (24) p(\boldsymbol{x}\mid\boldsymbol{z}) \propto\prod_{i=1}^{n_x}p(x_i)\prod_{j=1}^{n_z}p(z_j\mid\boldsymbol{x}). \tag*{(24)} p ( x ∣ z ) ∝ i = 1 ∏ n x p ( x i ) j = 1 ∏ n z p ( z j ∣ x ) . (24)
Setting f i = p ( x i ) f_i = p(x_i) f i = p ( x i ) and g j = p ( z j ∣ x ) g_j = p(z_j\mid\boldsymbol{x}) g j = p ( z j ∣ x ) , we construct the factor graph for p ( x ∣ z ) p(\boldsymbol{x}\mid\boldsymbol{z}) p ( x ∣ z ) as illustrated in Figure 2 and Figure 3 . Figure 2 shows the IEEE 14-bus system in full detail, where the unknown variable nodes x i x_i x i are represented as circles and the factor nodes f i f_i f i and g j g_j g j , depicted as rectangles, indicate the associated conditional PDFs. Figure 3 shows the much larger IEEE 1354-bus system, illustrating the densely loopy topology with long loops that characterizes the larger benchmarks. The IEEE 14, 118, 300, and 1354-bus systems yield factor graphs with 14, 118, 300, and 1354 variable nodes and 35, 305, 838, and 3660 factor nodes, respectively.
Figure 2. The factor graph of the standard IEEE 14-bus test system. Variable nodes x i x_i x i are shown as circles; factor nodes f i f_i f i and g j g_j g j are shown as rectangles.
Figure 3. The factor graph of the IEEE 1354-bus system comprising 1354 variable nodes and 3660 factor nodes. The variable nodes x i x_i x i , factor nodes f i f_i f i and g j g_j g j are represented as blue circles, green boxes, and orange boxes, respectively.
Experimental setup and baselines
The prior mean of each bus angle is initialized to the MATPOWER-provided voltage angle with an additive Gaussian perturbation [36 ] , i.e., μ i = x i t r u e + ϵ i \mu_i = x_i^{\mathrm{true}} + \epsilon_i μ i = x i true + ϵ i , where x i t r u e x_i^{\mathrm{true}} x i true denotes the ground-truth bus voltage phase angle, and ϵ i ∼ N ( 0 , Λ x i − 1 ) \epsilon_i \sim\mathcal{N}(0,\Lambda_{x_i}^{-1}) ϵ i ∼ N ( 0 , Λ x i − 1 ) ; in each MC trial, { ϵ i } \{\epsilon_i\} { ϵ i } and { ϵ j } \{\epsilon_j\} { ϵ j } are independently redrawn, yielding a distinct factor-graph instance. The reference bus x 1 x_1 x 1 is anchored at zero by a tight prior with variance Λ x 1 − 1 = 10 − 10 \Lambda_{x_1}^{-1} = 10^{-10} Λ x 1 − 1 = 1 0 − 10 , while the remaining buses use prior variance Λ x i − 1 = 10 − 2 \Lambda_{x_i}^{-1} = 10^{-2} Λ x i − 1 = 1 0 − 2 and measurement-noise variance Λ z j − 1 = 10 − 3 \Lambda_{z_j}^{-1} = 10^{-3} Λ z j − 1 = 1 0 − 3 .
On the IEEE 14-bus system, we run ENMP, BP, sGaBPm, GBP-A, and GBP-B (see details later); on the larger IEEE 118-, 300-, and 1354-bus systems we run ENMP, BP, and sGaBP-m. For ENMP, r r r is increased in steps of two (r = 0 , 2 , 4 , … r = 0, 2, 4, \ldots r = 0 , 2 , 4 , … ). Messages of ENMP, BP, and GBP are initialized with mean 0 and variance 10 4 10^4 1 0 4 ; for sGaBP-m, all messages ( Q j i ( 0 ) , v j i ( 0 ) ) (Q_{ji}^{(0)}, v_{ji}^{(0)}) ( Q j i ( 0 ) , v j i ( 0 ) ) and initial means μ i ( − 1 ) \mu_i^{(-1)} μ i ( − 1 ) are set to zero (Algorithm B.2 in Section B.3 of Appendix § 8 ). All methods use a maximum of β = 300 \beta= 300 β = 300 iterations and convergence threshold δ = 10 − 4 \delta= 10^{-4} δ = 1 0 − 4 .
For GBP, two manually designed region graphs, GBP-A and GBP-B, with maximum region sizes of eight and eleven variable nodes (see Section B.2 of Appendix § 8 for detailed constructions), are evaluated only on the IEEE 14-bus system. GBP is not evaluated on the larger systems for two reasons. First, constructing an effective region graph requires manual inspection of the graph topology to identify variable groups that capture loop-induced correlations, a task that grows increasingly prohibitive with the number of nodes and loops. Second, the bipartite structure of factor graphs complicates region construction, since each factor node couples a different number of variables, resulting in complex overlaps among candidate regions. For instance, designing the two configurations (GBP-A and GBP-B) for the IEEE 14-bus system (14 variable nodes, 35 factor nodes) already required careful manual analysis, while extending
this to the IEEE 118-bus system (118 variable nodes, 305 factor nodes) was found impractical. This limitation motivates the automatic neighborhood construction in ENMP.
As sGaBP-m operates on a pairwise Markov graph, the model in (24) is first converted into its canonical Gaussian form with global precision matrix S \mathbf{S} S and potential vector b \mathbf{b} b (see Appendix § 8 .§ 3 ). The variable set X \mathcal{X} X is partitioned into p p p disjoint clusters by the METIS balanced partitioning algorithm [37 ] with edge weights derived from S \mathbf{S} S , where p = ⌈ α n x ⌉ p = \lceil\alpha n_x \rceil p = ⌈ α n x ⌉ with α ∈ { 0.02 , 0.05 , 0.10 , 0.20 , 0.50 , 1.00 } \alpha\in\{0.02, 0.05, 0.10, 0.20, 0.50, 1.00\} α ∈ { 0.02 , 0.05 , 0.10 , 0.20 , 0.50 , 1.00 } and the regularization parameter is swept over λ ∈ { 10 − 2 , 10 0 , 10 2 , 10 4 , 10 8 , 10 12 } \lambda\in\{10^{-2}, 10^0, 10^2, 10^4, 10^8, 10^{12}\} λ ∈ { 1 0 − 2 , 1 0 0 , 1 0 2 , 1 0 4 , 1 0 8 , 1 0 12 } . We compare ENMP against sGaBP-m only under this baseline configuration.
Implementations of all methods are provided in Appendix § 8 . All algorithms are implemented in MATLAB, except for the following steps that are accelerated by compiled C/MEX code: in ENMP, the path search in extended-neighborhood generation (Algorithm 1, invoked at Step 1 of Algorithm 2); and in sGaBP-m, the graph partitioning, which invokes the C-based METIS library [37 ] through a MEX interface.
Evaluation metrics
All evaluation metrics defined below are first computed for each individual MC trial and then averaged over all N M C N_{\mathrm{MC}} N MC trials.
To evaluate estimation accuracy, we use the average AKLD and RMSE for both marginal means and variances. Let p ( m ) ( x i ∣ z ) p^{(m)}(x_i|z) p ( m ) ( x i ∣ z ) and b ( m ) ( x i ) b^{(m)}(x_i) b ( m ) ( x i ) denote the exact and approximate marginals from the evaluated algorithm in the m m m -th trial, respectively, and let D ( p ∥ q ) D(p\|q) D ( p ∥ q ) denote the KL divergence between two univariate Gaussians N ( μ 1 , Λ 1 − 1 ) \mathcal{N}(\mu_1,\Lambda_1^{-1}) N ( μ 1 , Λ 1 − 1 ) and N ( μ 2 , Λ 2 − 1 ) \mathcal{N}(\mu_2,\Lambda_2^{-1}) N ( μ 2 , Λ 2 − 1 ) given by D ( p ∥ q ) = D(p\|q) = D ( p ∥ q ) =
1 2 [ ln Λ 2 − 1 Λ 1 − 1 + Tr ( Λ 2 Λ 1 − 1 ) + ( μ 1 − μ 2 ) T Λ 2 ( μ 1 − μ 2 ) − 1 ] . \frac{1}{2}\left[\ln\frac{\Lambda_2^{-1}}{\Lambda_1^{-1}}+\operatorname{Tr}(\Lambda_2\Lambda_1^{-1})+(\mu_1-\mu_2)^{\mathsf{T}}\Lambda_2(\mu_1-\mu_2)-1\right]. 2 1 [ ln Λ 1 − 1 Λ 2 − 1 + Tr ( Λ 2 Λ 1 − 1 ) + ( μ 1 − μ 2 ) T Λ 2 ( μ 1 − μ 2 ) − 1 ] .
These metrics are defined as
AKLD = 1 N M C ∑ m = 1 N M C 1 n x ∑ i = 1 n x D ( p ( m ) ( x i ∣ z ) ∥ b ( m ) ( x i ) ) , \operatorname{AKLD}=\frac{1}{N_{\mathrm{MC}}}\sum_{m=1}^{N_{\mathrm{MC}}}\frac{1}{n_x}\sum_{i=1}^{n_x}D\left(p^{(m)}(x_i|z)\mathbin\Vert b^{(m)}(x_i)\right), AKLD = N MC 1 m = 1 ∑ N MC n x 1 i = 1 ∑ n x D ( p ( m ) ( x i ∣ z ) ∥ b ( m ) ( x i ) ) ,
RMSE μ = 1 N M C ∑ m = 1 N M C 1 n x ∑ i = 1 n x ( μ ^ i , m − μ i , m t r u e ) 2 , \operatorname{RMSE}_{\mu}=\frac{1}{N_{\mathrm{MC}}}\sum_{m=1}^{N_{\mathrm{MC}}}\sqrt{\frac{1}{n_x}\sum_{i=1}^{n_x}\left(\hat{\mu}_{i,m}-\mu^{\mathrm{true}}_{i,m}\right)^2}, RMSE μ = N MC 1 m = 1 ∑ N MC n x 1 i = 1 ∑ n x ( μ ^ i , m − μ i , m true ) 2 ,
RMSE σ 2 = 1 N M C ∑ m = 1 N M C 1 n x ∑ i = 1 n x ( Λ ^ i , m − 1 − Λ i , m − 1 , t r u e ) 2 . \operatorname{RMSE}_{\sigma^2}=\frac{1}{N_{\mathrm{MC}}}\sum_{m=1}^{N_{\mathrm{MC}}}\sqrt{\frac{1}{n_x}\sum_{i=1}^{n_x}\left(\hat{\Lambda}^{-1}_{i,m}-\Lambda^{-1,\mathrm{true}}_{i,m}\right)^2}. RMSE σ 2 = N MC 1 m = 1 ∑ N MC n x 1 i = 1 ∑ n x ( Λ ^ i , m − 1 − Λ i , m − 1 , true ) 2 .
where μ ^ i , m \hat{\mu}_{i,m} μ ^ i , m and Λ ^ i , m − 1 \hat{\Lambda}^{-1}_{i,m} Λ ^ i , m − 1 are the estimated marginal mean and variance in the m m m -th trial, and μ i , m t r u e \mu^{\mathrm{true}}_{i,m} μ i , m true and Λ i , m − 1 , t r u e \Lambda^{-1,\mathrm{true}}_{i,m} Λ i , m − 1 , true are the corresponding exact reference values. If the AKLD or RMSE of a given trial exceeds 10 10 10^{10} 1 0 10 or 10 5 10^{5} 1 0 5 , respectively, it is capped at that value.
Furthermore, we compare the computational cost by considering the average number of iterations, the average computation time for message updates (Comp), and the pre-construction time (Pre). The Pre is defined as the generation time of the extended r r r -neighborhood for ENMP (Step 1 of Algorithm 2) and the cluster construction time for sGaBP-m; for GBP, the region graph is constructed manually and thus no pre-construction time is reported. Since the Pre depends only on the graph topology and parameter r r r (or p p p ), it is reported as a single value.
Results and analysis
The results validate the inference accuracy, convergence behavior, and computational cost of the tested methods. The experimental results for the IEEE 14-bus, IEEE 118-bus, IEEE 300-bus, and IEEE 1354-bus systems are presented in Figure 4 , Figure 5 , Figure 6 and Figure 7 . For sGaBP-m, the best-performing configuration of ( λ , α ) (\lambda,\alpha) ( λ , α ) is selected for each test system by minimizing the AKLD over the tested grid, and is shown as a horizontal baseline. Note that this selection inherently favors sGaBP-m, as it requires an exhaustive search over 6 × 6 = 36 6\times6=36 6 × 6 = 36 configurations; the majority of these configurations did not satisfy the convergence criterion within β = 300 \beta=300 β = 300 iterations and reach the prescribed caps, as detailed in Appendix § 10 . GBP-A and GBP-B are included only on the IEEE 14-bus system and are shown as horizontal baselines, since they are independent of r r r .
Figure 4. The AKLD of BP, sGaBP-m (best configuration), ENMP, and GBP (GBP-A and GBP-B, on IEEE 14 only) on the IEEE 14, 118, 300, and 1354 test systems. The best-performing sGaBP-m configuration ( λ , α ) (\lambda,\alpha) ( λ , α ) is annotated in each subplot. As r r r increases, the AKLD of ENMP decreases consistently, achieving exact marginal inference on the IEEE-14, IEEE-118, and IEEE-300 systems.
Figure 5. The RMSEμ _\mu μ and RMSEσ 2 _{\sigma^2} σ 2 of BP, sGaBP-m (best configuration), ENMP, and GBP (GBP-A and GBP-B, on IEEE 14 only) on the IEEE 14, 118, 300, and 1354 test systems, where (M) and (V) in the legend denote RMSEμ _\mu μ and RMSEσ 2 _{\sigma^2} σ 2 , respectively. ENMP shows a consistent decrease in both mean and variance errors as r r r increases.
Figure 6. The average number of iterations required for convergence of BP, sGaBP-m (best configuration), ENMP, and GBP (GBP-A and GBP-B, on IEEE 14 only) on the IEEE 14, 118, 300, and 1354 test systems. ENMP converges in fewer iterations as r r r increases, typically within 50 iterations for r ≥ 4 r \ge4 r ≥ 4 .
Figure 7. The Pre and Comp of BP, sGaBP-m (best configuration), ENMP, and GBP (GBP-A and GBP-B, on IEEE 14 only) on the IEEE 14, 118, 300, and 1354 test systems. The Pre values are reported as single values since they depend only on the graph topology.
Figure 4 and Figure 5 show that the AKLD, RMSE μ \operatorname{RMSE}_{\mu} RMSE μ , and RMSE σ 2 \operatorname{RMSE}_{\sigma^2} RMSE σ 2 of ENMP decrease as r r r increases. For the IEEE 14-bus and IEEE 118-bus systems, ENMP achieves exact marginal inference at r = 8 r=8 r = 8 , with this accuracy maintained for all larger tested values of r r r . For the IEEE 300-bus system, exact marginal inference is achieved at r = 10 r=10 r = 10 . In these three systems, exact marginal inference is confirmed by RMSE μ < 10 − 10 \operatorname{RMSE}_{\mu}<10^{-10} RMSE μ < 1 0 − 10 , RMSE σ 2 < 10 − 15 \operatorname{RMSE}_{\sigma^2}<10^{-15} RMSE σ 2 < 1 0 − 15 , and AKLD < 10 − 15 \operatorname{AKLD}<10^{-15} AKLD < 1 0 − 15 . For the IEEE 1354-bus system, exact marginal inference is not achieved within the tested range r ≤ 14 r\leq14 r ≤ 14 ; its AKLD and RMSE continue to decrease as r r r increases within this range. This improvement stems from the fact that a larger r r r causes the extended neighborhoods to capture more loop-induced correlations, thereby improving inference accuracy.
The baseline comparisons further distinguish mean and variance estimation performance. On the IEEE 14-bus system, GBP-A yields AKLD < 10 − 3 <10^{-3} < 1 0 − 3 , RMSE μ < 10 − 9 \operatorname{RMSE}_{\mu}<10^{-9} RMSE μ < 1 0 − 9 , and RMSE σ 2 < 10 − 5 \operatorname{RMSE}_{\sigma^2}<10^{-5} RMSE σ 2 < 1 0 − 5 , while GBP-B achieves exact marginal inference with AKLD < 10 − 17 <10^{-17} < 1 0 − 17 , RMSE μ < 10 − 14 \operatorname{RMSE}_{\mu}<10^{-14} RMSE μ < 1 0 − 14 , and RMSE σ 2 < 10 − 17 \operatorname{RMSE}_{\sigma^2}<10^{-17} RMSE σ 2 < 1 0 − 17 , comparable to ENMP at r ≥ 8 r\geq8 r ≥ 8 . This difference demonstrates that the marginal accuracy of GBP depends on the selected region-graph configuration (the largest outer region of GBP-B contains eleven variable nodes, while that of GBP-A contains eight), whereas ENMP achieves comparable accuracy through the single parameter r r r without manual region design. For sGaBP-m, under the tested configurations, the best configuration on the IEEE 14-bus system achieves AKLD < 10 − 16 <10^{-16} < 1 0 − 16 and both RMSE μ \operatorname{RMSE}_{\mu} RMSE μ and RMSE σ 2 \operatorname{RMSE}_{\sigma^2} RMSE σ 2 below 10 − 14 10^{-14} 1 0 − 14 , comparable to ENMP for r ≥ 8 r\geq8 r ≥ 8 . On the IEEE 118-bus system, the best configuration yields AKLD < 10 − 6 <10^{-6} < 1 0 − 6 , RMSE μ < 10 − 6 \operatorname{RMSE}_{\mu}<10^{-6} RMSE μ < 1 0 − 6 , and RMSE σ 2 < 10 − 7 \operatorname{RMSE}_{\sigma^2}<10^{-7} RMSE σ 2 < 1 0 − 7 , all of which are lower than those of ENMP at r = 6 r=6 r = 6 but higher than those of ENMP for r ≥ 8 r \ge8 r ≥ 8 . On the IEEE 300-bus and IEEE 1354-bus systems, the best configurations yield AKLD values above 10 3 10^3 1 0 3 ; both the AKLD and RMSEμ _\mu μ remain higher than those of ENMP across all tested values of r r r , and the RMSEσ 2 _{\sigma^2} σ 2 of sGaBP-m likewise exceeds that of ENMP for r ≥ 8 r \ge8 r ≥ 8 on the IEEE 300-bus system and for r ≥ 4 r \ge4 r ≥ 4 on the IEEE 1354-bus system. Moreover, the performance of sGaBP-m depends on the heuristic regularization parameter λ \lambda λ and the prescribed α \alpha α ; for each test system, many configurations reach the prescribed caps of 10 10 10^{10} 1 0 10 for AKLD and 10 5 10^5 1 0 5 for RMSE, as detailed in Appendix § 10 . For BP, convergence is not reached within β = 300 \beta= 300 β = 300 iterations on the IEEE 118-bus, IEEE 300-bus, and IEEE 1354-bus systems; accordingly, its reported AKLD and RMSE values are capped at 10 10 10^{10} 1 0 10 and 10 5 10^5 1 0 5 , respectively. On the IEEE 14-bus system, BP converges and provides accurate mean estimates, but its RMSEσ 2 _{\sigma^2} σ 2 remains higher than that of ENMP.
Figure 6 shows the convergence behavior of the tested methods. For ENMP, the average number of iterations decreases as r r r increases, and ENMP reaches the convergence criterion within 50 iterations for r ≥ 4 r \ge4 r ≥ 4 on all four systems. For GBP, on the IEEE 14-bus system, GBP-A and GBP-B both satisfy the convergence criterion within 50 iterations, with GBP-A requiring more iterations than ENMP for r > 0 r > 0 r > 0 . For sGaBP-m, under its best-performing configuration, the convergence criterion is not satisfied within β = 300 \beta= 300 β = 300 iterations on the IEEE 118-, 300-, and 1354-bus systems. For BP, the convergence criterion is not satisfied within β = 300 \beta= 300 β = 300 iterations on the IEEE 118-, 300-, and 1354-bus systems.
Figure 7 reports the Pre and Comp of the tested methods. For ENMP, the Pre generally increases with r r r (roughly exponentially), since larger r r r enlarges the extended
neighborhoods; however, the prunings in the extended-neighborhood construction keep the Pre tractable over the tested range of r r r (e.g., about 45 s on IEEE-1354 at r = 14 r = 14 r = 14 ). The Comp does not necessarily increase monotonically with r r r , since although a larger r r r increases the complexity of each individual message update, it may simultaneously reduce the number of iterations required for convergence, as shown in Figure 6 . For GBP, the Comp is comparable to that of ENMP under the tested GBP-A and GBP-B configurations; however, this comparison does not account for the manual design effort required to construct the region graphs, whereas ENMP automatically constructs its extended neighborhoods via the single parameter r r r . For sGaBP-m, the Comp is typically lower than that of ENMP because its per-iteration message updates are simpler; its Pre is also generally lower, although the optimized construction has markedly narrowed this gap, and at small r r r on the larger systems the two become comparable.
The maximum values of ∣ x N i ∣ |x_{N_i}| ∣ x N i ∣ and ∣ x N j ∖ i ∣ |x_{N_j \setminus i}| ∣ x N j ∖ i ∣ for each IEEE system and each tested value of r r r are reported in Fig. E.1 in Appendix § 11 . For all systems, both sizes grow with r r r and then level off as r r r increases, reflecting how many nodes each extended neighborhood absorbs. Because the IEEE power-grid graphs are densely loopy and contain long loops, the extended neighborhoods expand rapidly with r r r , and the larger systems (IEEE 300- and 1354-bus) reach substantially larger neighborhood sizes than the smaller ones (IEEE 14- and 118-bus). Since the pre-construction cost grows roughly exponentially in r r r , attaining exact inference on the IEEE 1354-bus system would require an r r r beyond the tested range, at which this cost becomes prohibitive; this is why exact marginal inference is not attained on this system within r ≤ 14 r \le14 r ≤ 14 .
In summary, these experiments demonstrate that
ENMP provides a tunable accuracy–complexity trade-off through r r r , achieving exact marginal inference on the IEEE 14-bus, IEEE 118-bus, and IEEE 300-bus systems, while continuously improving marginal accuracy on the IEEE 1354-bus system over the tested range.
ENMP for the Ising inference problem
Factor graph model
To assess the applicability of ENMP to discrete factor graphs, we consider an Ising model [21 ] with n x n_x n x binary variables x i ∈ { − 1 , + 1 } x_i \in\{-1,+1\} x i ∈ { − 1 , + 1 } and a set E I E_I E I of pairwise interactions. The corresponding factor graph G = ( X , F , E ) \mathcal{G}=(\mathcal{X},\mathcal{F},\mathcal{E}) G = ( X , F , E ) has factor set F \mathcal{F} F consisting of pairwise factors f i j ( x i , x j ) = exp ( J i j x i x j ) f_{ij}(x_i,x_j)=\exp(J_{ij}x_ix_j) f ij ( x i , x j ) = exp ( J ij x i x j ) for each interacting pair ( i , j ) ∈ E I (i,j)\in E_I ( i , j ) ∈ E I and factors f i ( x i ) = exp ( h i x i ) f_i(x_i)=\exp(h_ix_i) f i ( x i ) = exp ( h i x i ) , yielding the joint PMF,
P ( x ) = 1 Z exp ( ∑ ( i , j ) ∈ E I J i j x i x j + ∑ i = 1 n x h i x i ) . (25) P(\mathbf{x})=\frac{1}{Z}\exp\left(\sum_{(i,j)\in E_I}J_{ij}x_ix_j+\sum_{i=1}^{n_x}h_ix_i\right). \tag*{(25)} P ( x ) = Z 1 exp ( i , j ) ∈ E I ∑ J ij x i x j + i = 1 ∑ n x h i x i . (25)
where J i j J_{ij} J ij is the coupling strength, h i h_i h i is the external field, and Z Z Z is the partition function. The objective is to infer the marginal PMF P ( x i ) P(x_i) P ( x i ) for each variable node x i x_i x i , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x .
In our experiments, the Ising factor graph is instantiated on the bus topologies of the Gaussian model in § 4.1.1 : the physical bus-adjacency topology is retained, the continuous variables are replaced by binary variables x i ∈ { − 1 , + 1 } x_i\in\{-1,+1\} x i ∈ { − 1 , + 1 } , the coupling strength is set to J i j = 1.0 J_{ij}=1.0 J ij = 1.0 for every interacting pair, and the external field is drawn as h i ∼ U ( − 0.5 , 0.5 ) h_i\sim\mathcal{U}(-0.5,0.5) h i ∼ U ( − 0.5 , 0.5 ) .
Experimental setup and baselines
In each MC trial, { h i } i = 1 n x \{h_i\}_{i=1}^{n_x} { h i } i = 1 n x are independently redrawn from U ( − 0.5 , 0.5 ) \mathcal{U}(-0.5,0.5) U ( − 0.5 , 0.5 ) , producing a distinct Ising factor-graph instance.
For discrete variables, exact marginalization requires summing over all states in the relevant neighborhood or region, with cost exponential in the neighborhood or region size—a limitation shared by ENMP and region-based methods such as GBP. Since the IEEE bus topologies are very densely loopy with long loops, the ENMP extended neighborhoods grow rapidly with r r r ; we therefore select the 14- and 118-bus systems, which retain nontrivial loop structures while keeping the extended neighborhoods tractable over the tested range of r r r . For larger or denser graphs, evaluating the message summations in (12) becomes computationally prohibitive due to the exponential cost; approximating them via Monte Carlo sampling [21 ] , as noted in § 3.5 , is left to future work.
ENMP, run for r ∈ { 0 , 2 , 4 , … , 10 } r\in\{0,2,4,\ldots,10\} r ∈ { 0 , 2 , 4 , … , 10 } , and BP are compared on both systems. For GBP, the same GBP-A and GBP-B region-graph configurations as in the Gaussian experiment are applied to the IEEE 14-bus Ising factor graph; GBP is excluded from the 118-bus system, as constructing comparable configurations becomes impractical at this scale. Messages are initialized uniformly over { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } , and the maximum number of iterations and convergence threshold are again β = 300 \beta=300 β = 300 and δ = 10 − 4 \delta=10^{-4} δ = 1 0 − 4 . Exact marginals computed by the junction tree algorithm [38 ] serve as the reference for accuracy evaluation in each MC trial. Algorithm implementations are detailed in Appendix C, and all algorithms in this experiment are implemented in MATLAB.
Evaluation metrics
Accuracy is evaluated by the average total variation (ATV),
ATV = 1 N M C ∑ m = 1 N M C 1 2 n x ∑ i = 1 n x ∑ x i ∣ P ( m ) ( x i ) − q ( m ) ( x i ) ∣ . \operatorname{ATV}=\frac{1}{N_{\mathrm{MC}}}\sum_{m=1}^{N_{\mathrm{MC}}}\frac{1}{2n_x}\sum_{i=1}^{n_x}\sum_{x_i}\left|P^{(m)}(x_i)-q^{(m)}(x_i)\right|. ATV = N MC 1 m = 1 ∑ N MC 2 n x 1 i = 1 ∑ n x x i ∑ P ( m ) ( x i ) − q ( m ) ( x i ) .
where P ( m ) ( x i ) P^{(m)}(x_i) P ( m ) ( x i ) and q ( m ) ( x i ) q^{(m)}(x_i) q ( m ) ( x i ) denote the exact marginal from the junction tree algorithm and the approximate marginal from the evaluated algorithm in the m m m -th trial, respectively. Computational cost is assessed using the average number of iterations and the average message-update time (Comp), as defined in § 4.2.1 .
Results and analysis
The results for the Ising factor graphs constructed on the topologies of the IEEE 14-bus and IEEE 118-bus systems are presented in Figure 8 .
Figure 8. The ATV, the average number of iterations required for convergence, and the Comp of BP, ENMP, and GBP on the Ising factor graphs constructed on the topologies of the IEEE 14-bus and IEEE 118-bus systems. GBP-A and GBP-B are included only on the IEEE 14-bus system.
The ATV results are presented at the top of Figure 8 . For ENMP, the ATV decreases substantially as r r r increases on both test systems. On the IEEE 14-bus system, the ATV decreases from approximately 10 − 1 10^{-1} 1 0 − 1 at r = 0 r = 0 r = 0 and reaches approximately 10 − 16 10^{-16} 1 0 − 16 at r ≥ 8 r \ge8 r ≥ 8 , achieving exact marginal inference. On the IEEE 118-bus system, ENMP exhibits a similar trend, with the ATV reaching approximately 10 − 16 10^{-16} 1 0 − 16 at r ≥ 8 r \ge8 r ≥ 8 . For GBP, on the IEEE 14-bus system, GBP-A yields ATV approximately 10 − 4 10^{-4} 1 0 − 4 , comparable to ENMP at r ∈ { 2 , 4 , 6 } r \in\{2, 4, 6\} r ∈ { 2 , 4 , 6 } , while GBP-B achieves exact marginal inference with ATV approximately 10 − 16 10^{-16} 1 0 − 16 , comparable to ENMP at r ≥ 8 r \ge8 r ≥ 8 . This difference demonstrates that the marginal accuracy of GBP depends on the selected region-graph configuration. For BP, the ATV remains above that of ENMP at all tested values of r r r on both test systems.
The average number of iterations is shown in the middle panels of Figure 8 . For ENMP, the number of iterations decreases as r r r increases, from approximately 10 to 3 on the IEEE 14-bus system and from approximately 25 to 4 on the IEEE 118-bus system. Across all tested values of r r r , ENMP requires fewer iterations than BP. On the IEEE 14-bus system, GBP-A and GBP-B also require fewer iterations than BP under the tested region-graph configurations.
The Comp is shown in the lower panels of Figure 8 . The Pre is not further discussed here, since its dependence on r r r has already been examined in the Gaussian experiments. For ENMP, on the IEEE 14-bus system, the Comp shows a generally decreasing trend as r r r increases. On the IEEE 118-bus system, it first increases to a peak at r = 2 r = 2 r = 2 and then decreases as r r r increases, since the reduction in the number of iterations required for convergence dominates the increase in per-message cost at larger r r r . For GBP, on the IEEE 14-bus system, the Comp varies with the choice of region-graph configuration: GBP-A yields a higher Comp than ENMP, whereas GBP-B yields a lower Comp. For BP, the Comp is the lowest among all methods on both systems.
Overall, these experiments validate the applicability of ENMP to discrete factor graphs and demonstrate that adjusting r r r provides a tunable accuracy–complexity trade-off and enables exact marginal inference without manual region-graph construction.
Conclusion
In this work, we proposed the ENMP method for marginal inference in loopy factor graphs. ENMP automatically constructs extended neighborhoods from the bipartite factor-graph topology to capture loop-induced correlations, without requiring the manual design or application-specific heuristics typically used for region-graph construction in region-based methods such as GBP. A single parameter r r r trades off accuracy against complexity: in the exact regime, the message recursion converges to its unique fixed point in finitely many iterations and yields the exact marginals, which for Gaussian factor graphs gives exact variances and resolves the long-standing inaccuracy of variance estimates in loopy Gaussian BP; in the approximate regime, the experiments show that the approximate marginals generally become more accurate as r r r increases. Experiments on power-grid benchmarks confirm these properties for Gaussian factor graphs, with ENMP attaining exact marginal inference on several systems and matching or outperforming the tested baselines, including a manually designed GBP region graph on the IEEE 14-bus system. Experiments on discrete Ising factor graphs confirm that ENMP extends to discrete variables and achieves exact marginals as r r r increases.
Proof of Lemma 1
Before proving Lemma 1, we state an auxiliary lemma used in the subsequent proofs. Recall that the superscript r r r is omitted throughout this appendix. For a subgraph H H H , a walk w w w , a path p p p , and a loop C C C , V ( H ) V(H) V ( H ) , V ( w ) V(w) V ( w ) , and V ( C ) V(C) V ( C ) denote their node sets, respectively.
Lemma A.1. Consider the factor graph G = ( X , F , E ) \mathcal{G} = (\mathcal{X}, \mathcal{F}, \mathcal{E}) G = ( X , F , E ) . For any variable node x i ∈ X x_i \in\mathcal{X} x i ∈ X , let N i N_i N i be its extended r r r -neighborhood and V ( N i ) V(N_i) V ( N i ) its node set. If a loop C C C in G \mathcal{G} G satisfies ∣ C ∣ ≤ r + 2 |C| \le r+2 ∣ C ∣ ≤ r + 2 with r ≥ 2 r \ge2 r ≥ 2 and V ( C ) ∩ V ( N i ) ∩ F ≠ ∅ V(C) \cap V(N_i) \cap\mathcal{F} \ne\emptyset V ( C ) ∩ V ( N i ) ∩ F = ∅ , then V ( C ) ⊆ V ( N i ) V(C) \subseteq V(N_i) V ( C ) ⊆ V ( N i ) .
Proof. Choose f b ∈ V ( C ) ∩ V ( N i ) ∩ F f_b \in V(C) \cap V(N_i) \cap F f b ∈ V ( C ) ∩ V ( N i ) ∩ F . Since f b ∈ V ( N i ) ∩ F f_b \in V(N_i) \cap F f b ∈ V ( N i ) ∩ F , Definition 2 gives V ( M f b ) ⊆ V ( N i ) V(M_{f_b}) \subseteq V(N_i) V ( M f b ) ⊆ V ( N i ) . Thus, it suffices to show that V ( C ) ⊆ V ( M f b ) V(C) \subseteq V(M_{f_b}) V ( C ) ⊆ V ( M f b ) .
Since G \mathbb{G} G is bipartite, the two neighbors of f b f_b f b on C C C are two distinct variable nodes, denoted by x k x_k x k and x q x_q x q (Fig. A.1). Removing f b f_b f b and its two incident edges from C C C leaves a path p p p from x k x_k x k to x q x_q x q with ℓ ( p ) = ∣ C ∣ − 2 ≤ r \ell(p)=|C|-2\le r ℓ ( p ) = ∣ C ∣ − 2 ≤ r . Since x k , x q ∈ N f b x_k,x_q\in N_{f_b} x k , x q ∈ N f b , x k ≠ x q x_k\ne x_q x k = x q , and p p p does not pass through f b f_b f b , Definition 1 gives p ∈ P f b p\in\mathcal{P}_{f_b} p ∈ P f b and hence V ( p ) ⊆ V ( M f b ) V(p)\subseteq V(M_{f_b}) V ( p ) ⊆ V ( M f b ) .
Finally, since f b ∈ V ( M f b ) f_b\in V(M_{f_b}) f b ∈ V ( M f b ) , we have V ( C ) = V ( p ) ∪ { f b } ⊆ V ( M f b ) ⊆ V ( N i ) V(C)=V(p)\cup\{f_b\}\subseteq V(M_{f_b})\subseteq V(N_i) V ( C ) = V ( p ) ∪ { f b } ⊆ V ( M f b ) ⊆ V ( N i ) . This proves the lemma. □
Figure A.1. Extended neighborhood N i N_i N i and loop C C C , with f b ∈ V ( C ) ∩ V ( N i ) ∩ F f_b\in V(C)\cap V(N_i)\cap F f b ∈ V ( C ) ∩ V ( N i ) ∩ F and its neighbors x k , x q x_k,x_q x k , x q on C C C .
We next prove Lemma 1 by establishing (P1), (P2), (P3) and (P4) one by one. Since G \mathbb{G} G is a bipartite factor graph, every loop has even length which is at least four. Hence, whenever G \mathbb{G} G contains a loop, the length of the longest loop in G \mathbb{G} G satisfies L max ≥ 4 L_{\max}\ge4 L m a x ≥ 4 . Under the hypothesis r ≥ L max − 2 r\ge L_{\max}-2 r ≥ L m a x − 2 of Lemma 1, it follows that r ≥ 2 r\ge2 r ≥ 2 , so Lemma A.1 can be applied.
Proof of (P1)
We prove that V ( N j ∖ i ) ∩ V ( N i ) = { x j } V(N_{j\setminus i})\cap V(N_i)=\{x_j\} V ( N j ∖ i ) ∩ V ( N i ) = { x j } . By Definition 3, Δ j ∖ i = { x j } ∪ ( V ( N j ) ∖ V ( N i ) ) \Delta_{j\setminus i}=\{x_j\}\cup(V(N_j)\setminus V(N_i)) Δ j ∖ i = { x j } ∪ ( V ( N j ) ∖ V ( N i )) , and hence Δ j ∖ i ∩ V ( N i ) = { x j } \Delta_{j\setminus i}\cap V(N_i)=\{x_j\} Δ j ∖ i ∩ V ( N i ) = { x j } . Moreover,
V ( N j ∖ i ) = Δ j ∖ i ∪ ⋃ f a ∈ Δ j ∖ i ∩ F N f a . V(N_{j\setminus i})=\Delta_{j\setminus i}\cup\bigcup_{f_a\in\Delta_{j\setminus i}\cap F}N_{f_a}. V ( N j ∖ i ) = Δ j ∖ i ∪ f a ∈ Δ j ∖ i ∩ F ⋃ N f a .
It therefore remains to show that N f a ∩ V ( N i ) ⊆ { x j } N_{f_a}\cap V(N_i)\subseteq\{x_j\} N f a ∩ V ( N i ) ⊆ { x j } for every f a ∈ Δ j ∖ i ∩ F f_a\in\Delta_{j\setminus i}\cap F f a ∈ Δ j ∖ i ∩ F .
Suppose, to the contrary, that there exists a factor node f a ∈ Δ j ∖ i ∩ F f_a\in\Delta_{j\setminus i}\cap F f a ∈ Δ j ∖ i ∩ F having a neighbor x k ∈ V ( N i ) x_k\in V(N_i) x k ∈ V ( N i ) with x k ≠ x j x_k\ne x_j x k = x j . Since f a ∈ Δ j ∖ i ∩ F f_a\in\Delta_{j\setminus i}\cap F f a ∈ Δ j ∖ i ∩ F , we have f a ∈ V ( N j ) ∖ V ( N i ) f_a\in V(N_j)\setminus V(N_i) f a ∈ V ( N j ) ∖ V ( N i ) . Since N i N_i N i is connected and x k , x j ∈ V ( N i ) x_k,x_j\in V(N_i) x k , x j ∈ V ( N i ) , there is a path in N i N_i N i from x k x_k x k to x j x_j x j . Let f b ∈ V ( N i ) f_b\in V(N_i) f b ∈ V ( N i ) be the factor node adjacent to x k x_k x k on this path (Fig. A.2).
Figure A.2. The hypothetical edge x k − f a x_k-f_a x k − f a , with f b f_b f b on the path in N i N_i N i from x k x_k x k to x j x_j x j .
Remove x k x_k x k and its incident edges from G \mathbb{G} G . In the remaining graph, let G a \mathbb{G}_a G a be the subgraph consisting of all nodes connected to f a f_a f a by a path, together with all edges between these nodes. Define G b \mathbb{G}_b G b analogously with respect to f b f_b f b . Then either G a = G b \mathbb{G}_a=\mathbb{G}_b G a = G b or V ( G a ) ∩ V ( G b ) = ∅ V(\mathbb{G}_a)\cap V(\mathbb{G}_b)=\varnothing V ( G a ) ∩ V ( G b ) = ∅ .
Case 1: G a = G b \mathbb{G}_a=\mathbb{G}_b G a = G b . There is a path from f a f_a f a to f b f_b f b in G ∖ { x k } \mathbb{G}\setminus\{x_k\} G ∖ { x k } . Together with the edges ( f a , x k ) (f_a,x_k) ( f a , x k ) and ( x k , f b ) (x_k,f_b) ( x k , f b ) , it forms a loop C C C satisfying ∣ C ∣ ≤ L max ≤ r + 2 |C|\le L_{\max}\le r+2 ∣ C ∣ ≤ L m a x ≤ r + 2 . Since f b ∈ V ( N i ) f_b\in V(N_i) f b ∈ V ( N i ) , Lemma A.1 gives V ( C ) ⊆ V ( N i ) V(C)\subseteq V(N_i) V ( C ) ⊆ V ( N i ) and thus f a ∈ V ( N i ) f_a\in V(N_i) f a ∈ V ( N i ) , a contradiction.
Case 2: G a ≠ G b \mathbb{G}_a\ne\mathbb{G}_b G a = G b . After x k x_k x k and its incident edge ( x k , f b ) (x_k,f_b) ( x k , f b ) being removed from the path in N i N_i N i from x k x_k x k to $x_j introduced above, the remaining nodes and edges form a path from f b f_b f b to x j x_j x j . Hence, x j ∈ V ( G b ) x_j\in V(\mathbb{G}_b) x j ∈ V ( G b ) . Every neighbor of x j x_j x j remains connected to x j x_j x j after f k f_k f k is removed and therefore belongs to V ( G b ) V(\mathbb{G}_b) V ( G b ) . Hence, N x j ⊆ V ( G b ) N_{x_j}\subseteq V(\mathbb{G}_b) N x j ⊆ V ( G b ) . Since x k x_k x k separates V ( G b ) V(\mathbb{G}_b) V ( G b ) from all nodes outside V ( G b ) ∪ { x k } V(\mathbb{G}_b)\cup\{x_k\} V ( G b ) ∪ { x k } , every path used to construct M j M_j M j is contained in V ( G b ) ∪ { x k } V(\mathbb{G}_b)\cup\{x_k\} V ( G b ) ∪ { x k } . Therefore, V ( M j ) ⊆ V ( G b ) ∪ { x k } V(M_j)\subseteq V(\mathbb{G}_b)\cup\{x_k\} V ( M j ) ⊆ V ( G b ) ∪ { x k } .
The same argument gives V ( M f c ) ⊆ V ( G b ) ∪ { x k } V(M_{f_c})\subseteq V(\mathbb{G}_b)\cup\{x_k\} V ( M f c ) ⊆ V ( G b ) ∪ { x k } for every factor node f c ∈ V ( G b ) f_c\in V(\mathbb{G}_b) f c ∈ V ( G b ) . Starting from V ( M j ) V(M_j) V ( M j ) , each node-set expansion in Definition 2 therefore includes only nodes in V ( G b ) ∪ { x k } V(\mathbb{G}_b)\cup\{x_k\} V ( G b ) ∪ { x k } . By induction, V ( N j ) ⊆ V ( G b ) ∪ { x k } V(N_j)\subseteq V(\mathbb{G}_b)\cup\{x_k\} V ( N j ) ⊆ V ( G b ) ∪ { x k } .
Since G a \mathbb{G}_a G a and G b \mathbb{G}_b G b have disjoint node sets, f a ∈ V ( G a ) f_a\in V(\mathbb{G}_a) f a ∈ V ( G a ) implies f a ∉ V ( G b ) ∪ { x k } f_a\notin V(\mathbb{G}_b)\cup\{x_k\} f a ∈ / V ( G b ) ∪ { x k } . Together with V ( N j ) ⊆ V ( G b ) ∪ { x k } V(N_j)\subseteq V(\mathbb{G}_b)\cup\{x_k\} V ( N j ) ⊆ V ( G b ) ∪ { x k } , this gives f a ∉ V ( N j ) f_a\notin V(N_j) f a ∈ / V ( N j ) , contradicting f a ∈ V ( N j ) f_a\in V(N_j) f a ∈ V ( N j ) .
Both cases give contradictions. Thus, N f a ∩ V ( N i ) ⊆ { x j } N_{f_a}\cap V(N_i)\subseteq\{x_j\} N f a ∩ V ( N i ) ⊆ { x j } for every f a ∈ Δ j ∖ i ∩ F f_a\in\Delta_{j\setminus i}\cap F f a ∈ Δ j ∖ i ∩ F , and therefore V ( N j ∖ i ) ∩ V ( N i ) = { x j } V(N_{j\setminus i})\cap V(N_i)=\{x_j\} V ( N j ∖ i ) ∩ V ( N i ) = { x j } . □
Proof of (P2)
Part 1: D j ∖ i D_{j\setminus i} D j ∖ i induces a connected subgraph of G \mathcal{G} G .
It suffices to show that every residual neighborhood appearing in D j ∖ i D_{j\setminus i} D j ∖ i is connected and that successive residual neighborhoods have a nonempty intersection. We first prove that N j ∖ i N_{j\setminus i} N j ∖ i is connected.
By Definitions 2 and 3, V ( N j ∖ i ) ⊆ V ( N j ) V(N_{j\setminus i}) \subseteq V(N_j) V ( N j ∖ i ) ⊆ V ( N j ) . Indeed, Δ j ∖ i ⊆ V ( N j ) \Delta_{j\setminus i} \subseteq V(N_j) Δ j ∖ i ⊆ V ( N j ) , and the neighbors of every factor node in Δ j ∖ i \Delta_{j\setminus i} Δ j ∖ i also belong to V ( N j ) V(N_j) V ( N j ) .
Let u ∈ V ( N j ∖ i ) ∖ { x j } u \in V(N_{j\setminus i}) \setminus\{x_j\} u ∈ V ( N j ∖ i ) ∖ { x j } . Since N j N_j N j is connected, there is a path
p = ( v 0 , v 1 , … , v t ) , v 0 = u , v t = x j , p=(v_0,v_1,\ldots,v_t), \qquad v_0=u,\quad v_t=x_j, p = ( v 0 , v 1 , … , v t ) , v 0 = u , v t = x j ,
in N j N_j N j . By (P1), u ∉ V ( N i ) u \notin V(N_i) u ∈ / V ( N i ) . Let v s v_s v s be the first node on p p p that belongs to V ( N i ) V(N_i) V ( N i ) .
If v s v_s v s were a factor node, Definition 2 would give v s − 1 ∈ N v s ⊆ V ( N i ) v_{s-1} \in\mathcal{N}_{v_s} \subseteq V(N_i) v s − 1 ∈ N v s ⊆ V ( N i ) , contradicting the choice of v s v_s v s . Hence v s v_s v s is a variable node. Since G \mathcal{G} G is bipartite, v s − 1 v_{s-1} v s − 1 is a factor node. Moreover,
v s − 1 ∈ V ( N j ) ∖ V ( N i ) ⊆ Δ j ∖ i . v_{s-1} \in V(N_j) \setminus V(N_i) \subseteq\Delta_{j\setminus i}. v s − 1 ∈ V ( N j ) ∖ V ( N i ) ⊆ Δ j ∖ i .
Definition 3 then gives v s ∈ V ( N j ∖ i ) v_s \in V(N_{j\setminus i}) v s ∈ V ( N j ∖ i ) . By (P1), v s = x j v_s=x_j v s = x j , and hence s = t s=t s = t . The resulting path is illustrated in Fig. A.3.
Figure A.3. Illustration of the path p p p from v 0 = u v_0=u v 0 = u to v s = x j v_s=x_j v s = x j . The factor node v s − 1 v_{s-1} v s − 1 is the last node on p p p outside N i N_i N i .
It follows that v 0 , … , v t − 1 v_0,\ldots,v_{t-1} v 0 , … , v t − 1 belong to V ( N j ) ∖ V ( N i ) V(N_j) \setminus V(N_i) V ( N j ) ∖ V ( N i ) , while v t = x j v_t=x_j v t = x j . Therefore,
V ( p ) ⊆ Δ j ∖ i ⊆ V ( N j ∖ i ) . V(p) \subseteq\Delta_{j\setminus i} \subseteq V(N_{j\setminus i}). V ( p ) ⊆ Δ j ∖ i ⊆ V ( N j ∖ i ) .
Thus, every node in N j ∖ i N_{j\setminus i} N j ∖ i is connected to x j x_j x j within N j ∖ i N_{j\setminus i} N j ∖ i , so N j ∖ i N_{j\setminus i} N j ∖ i is connected.
The same argument applies to every residual neighborhood appearing in D j ∖ i D_{j\setminus i} D j ∖ i . Moreover, if x k ∈ X N j ∖ i ∖ j x_k \in\mathcal{X}_{N_{j\setminus i}\setminus j} x k ∈ X N j ∖ i ∖ j , then
x k ∈ V ( N j ∖ i ) ∩ V ( N k ∖ j ) . x_k \in V(N_{j\setminus i}) \cap V(N_{k\setminus j}). x k ∈ V ( N j ∖ i ) ∩ V ( N k ∖ j ) .
Thus, successive residual neighborhoods are connected and have a nonempty intersection. Since the union of two connected subgraphs with a nonempty intersection is connected, repeated application of this fact shows that D j ∖ i D_{j\setminus i} D j ∖ i induces a connected subgraph of G \mathcal{G} G .
Part 2: D j ∖ i ∩ V ( N i ) = { x j } D_{j\setminus i} \cap V(N_i)=\{x_j\} D j ∖ i ∩ V ( N i ) = { x j } .
Let x i ∈ X x_i \in\mathcal{X} x i ∈ X and x j ∈ X N i ∖ i x_j \in\mathcal{X}_{N_{i\setminus i}} x j ∈ X N i ∖ i . By (P1), V ( N j ∖ i ) ∩ V ( N i ) = { x j } V(N_{j\setminus i})\cap V(N_i)=\{x_j\} V ( N j ∖ i ) ∩ V ( N i ) = { x j } .
Suppose, to the contrary, that a residual neighborhood in D j ∖ i D_{j\setminus i} D j ∖ i intersects V ( N i ) ∖ { x j } V(N_i)\setminus\{x_j\} V ( N i ) ∖ { x j } . By (6), choose m ≥ 2 m\ge2 m ≥ 2 and variable nodes x s 0 , x s 1 , … , x s m x_{s_0},x_{s_1},\ldots,x_{s_m} x s 0 , x s 1 , … , x s m , with x s 0 = x i x_{s_0}=x_i x s 0 = x i and x s 1 = x j x_{s_1}=x_j x s 1 = x j , such that
x s ℓ + 1 ∈ X N s ℓ ∖ s ℓ − 1 ∖ s ℓ , ℓ = 1 , 2 , … , m − 1 , x_{s_{\ell+1}} \in\mathcal{X}_{N_{s_\ell\setminus s_{\ell-1}}\setminus s_\ell}, \qquad\ell=1,2,\ldots,m-1, x s ℓ + 1 ∈ X N s ℓ ∖ s ℓ − 1 ∖ s ℓ , ℓ = 1 , 2 , … , m − 1 ,
and N s m ∖ s m − 1 N_{s_m\setminus s_{m-1}} N s m ∖ s m − 1 is the first corresponding residual neighborhood that intersects V ( N i ) ∖ { x j } V(N_i)\setminus\{x_j\} V ( N i ) ∖ { x j } . Thus,
V ( N s m ∖ s m − 1 ) ∩ ( V ( N i ) ∖ { x j } ) ≠ ∅ , V(N_{s_m\setminus s_{m-1}})\cap\bigl(V(N_i)\setminus\{x_j\}\bigr)\ne\varnothing, V ( N s m ∖ s m − 1 ) ∩ ( V ( N i ) ∖ { x j } ) = ∅ ,
V ( N s ℓ ∖ s ℓ − 1 ) ∩ ( V ( N i ) ∖ { x j } ) = ∅ , ℓ < m . V(N_{s_\ell\setminus s_{\ell-1}})\cap\bigl(V(N_i)\setminus\{x_j\}\bigr)=\varnothing,\qquad\ell<m. V ( N s ℓ ∖ s ℓ − 1 ) ∩ ( V ( N i ) ∖ { x j } ) = ∅ , ℓ < m .
We now use these residual neighborhoods to construct a loop C C C satisfying ∣ C ∣ ≤ L max ≤ r + 2 |C|\le\mathcal{L}_{\max}\le r+2 ∣ C ∣ ≤ L m a x ≤ r + 2 that contains a factor node in N i N_i N i and a node outside N i N_i N i . The factor node in N i N_i N i allows Lemma A.1 to be applied, which gives V ( C ) ⊆ V ( N i ) V(C)\subseteq V(N_i) V ( C ) ⊆ V ( N i ) . This contradicts the existence of a node of C C C outside V ( N i ) V(N_i) V ( N i ) .
We first construct a path p p p from x j x_j x j to a node w ∈ V ( N i ) ∖ { x j } w\in V(N_i)\setminus\{x_j\} w ∈ V ( N i ) ∖ { x j } such that V ( p ) ∩ V ( N i ) = { x j , w } V(p)\cap V(N_i)=\{x_j,w\} V ( p ) ∩ V ( N i ) = { x j , w } . By Definition 3, successive residual neighborhoods meet at x s 2 , x s 3 , … , x s m x_{s_2},x_{s_3},\ldots,x_{s_m} x s 2 , x s 3 , … , x s m . Since every residual neighborhood is connected by Part 1, concatenating paths within these residual neighborhoods gives a walk from x j x_j x j to x s m x_{s_m} x s m through x s 2 , x s 3 , … , x s m x_{s_2},x_{s_3},\ldots,x_{s_m} x s 2 , x s 3 , … , x s m . Since N s m ∖ s m − 1 N_{s_m\setminus s_{m-1}} N s m ∖ s m − 1 is connected and intersects V ( N i ) ∖ { x j } V(N_i)\setminus\{x_j\} V ( N i ) ∖ { x j } , there is a path in N s m ∖ s m − 1 N_{s_m\setminus s_{m-1}} N s m ∖ s m − 1 from x s m x_{s_m} x s m to a node of V ( N i ) ∖ { x j } V(N_i)\setminus\{x_j\} V ( N i ) ∖ { x j } . By the choice of m m m , x s m ∉ V ( N i ) ∖ { x j } x_{s_m}\notin V(N_i)\setminus\{x_j\} x s m ∈ / V ( N i ) ∖ { x j } . Let w w w be the first node on this path, starting from x s m x_{s_m} x s m , that belongs to V ( N i ) ∖ { x j } V(N_i)\setminus\{x_j\} V ( N i ) ∖ { x j } , and let v v v be the node immediately preceding w w w on this path. By the choice of w w w , v ∉ V ( N i ) v\notin V(N_i) v ∈ / V ( N i ) . If w w w were a factor node, then w ∈ V ( N i ) ∩ F w\in V(N_i)\cap\mathcal{F} w ∈ V ( N i ) ∩ F . By Definition 2, every neighbor of w w w would belong to V ( N i ) V(N_i) V ( N i ) , a contradiction. Hence, w w w is a variable node. Combining these two parts gives a walk p ~ \widetilde{p} p from x j x_j x j to w w w . By the choice of m m m and w w w ,
V ( p ~ ) ∩ V ( N i ) = { x j , w } . V(\widetilde{p})\cap V(N_i)=\{x_j,w\}. V ( p ) ∩ V ( N i ) = { x j , w } .
Let p p p be a walk of minimum length from x j x_j x j to w w w whose nodes all belong to V ( p ~ ) V(\widetilde{p}) V ( p ) . By its minimality, p p p has no repeated nodes and hence is a path. Therefore,
V ( p ) ∩ V ( N i ) = { x j , w } . V(p)\cap V(N_i)=\{x_j,w\}. V ( p ) ∩ V ( N i ) = { x j , w } .
We next construct a path q q q from x j x_j x j to w w w within N i N_i N i .
Figure A.4. The path p p p from x j x_j x j to the hypothetical common node w w w through successively generated residual neighborhoods.
Such a path exists because N i N_i N i is connected and contains both x j x_j x j and w w w . Since V ( p ) ∩ V ( N i ) = { x j , w } V(p) \cap V(N_i) = \{x_j, w\} V ( p ) ∩ V ( N i ) = { x j , w } and V ( q ) ⊆ V ( N i ) V(q) \subseteq V(N_i) V ( q ) ⊆ V ( N i ) , the paths p p p and q q q intersect only at x j x_j x j and w w w . Hence, their union forms a loop C C C satisfying ∣ C ∣ ≤ L max ≤ r + 2 |C| \leq L_{\max} \leq r + 2 ∣ C ∣ ≤ L m a x ≤ r + 2 .
Since w ≠ x j w \ne x_j w = x j , the path q q q contains at least one edge. Because G G G is bipartite and x j x_j x j is a variable node, q q q contains a factor node f b ∈ V ( N i ) ∩ F f_b \in V(N_i) \cap F f b ∈ V ( N i ) ∩ F . Since V ( q ) ⊆ V ( C ) V(q) \subseteq V(C) V ( q ) ⊆ V ( C ) , we have f b ∈ V ( C ) ∩ V ( N i ) ∩ F f_b \in V(C) \cap V(N_i) \cap F f b ∈ V ( C ) ∩ V ( N i ) ∩ F . Therefore, Lemma A.1 gives V ( C ) ⊆ V ( N i ) V(C) \subseteq V(N_i) V ( C ) ⊆ V ( N i ) .
However, x j x_j x j and w w w are distinct variable nodes. Since G G G is bipartite, the path p p p contains at least one factor node and therefore at least one node other than x j x_j x j and w w w . The relation V ( p ) ∩ V ( N i ) = { x j , w } V(p) \cap V(N_i) = \{x_j, w\} V ( p ) ∩ V ( N i ) = { x j , w } shows that every such node lies outside V ( N i ) V(N_i) V ( N i ) . Since V ( p ) ⊆ V ( C ) V(p) \subseteq V(C) V ( p ) ⊆ V ( C ) , this contradicts V ( C ) ⊆ V ( N i ) V(C) \subseteq V(N_i) V ( C ) ⊆ V ( N i ) .
Hence, the assumed residual neighborhood N s m ∖ s m − 1 N_{s_m \setminus s_{m-1}} N s m ∖ s m − 1 does not exist. Together with (P1) and (6), this gives D j ∖ i ∩ V ( N i ) = { x j } D_{j\setminus i} \cap V(N_i) = \{x_j\} D j ∖ i ∩ V ( N i ) = { x j } .
Part 3: D j 1 ∖ i ∩ D j 2 ∖ i = ∅ D_{j_1\setminus i} \cap D_{j_2\setminus i} = \emptyset D j 1 ∖ i ∩ D j 2 ∖ i = ∅ .
Let x j 1 , x j 2 ∈ X N i ∖ i x_{j_1}, x_{j_2} \in\mathcal{X}_{N_i\setminus i} x j 1 , x j 2 ∈ X N i ∖ i with x j 1 ≠ x j 2 x_{j_1} \ne x_{j_2} x j 1 = x j 2 . By Part 2, D j 1 ∖ i ∩ V ( N i ) = { x j 1 } D_{j_1\setminus i} \cap V(N_i) = \{x_{j_1}\} D j 1 ∖ i ∩ V ( N i ) = { x j 1 } , and D j 2 ∖ i ∩ V ( N i ) = { x j 2 } D_{j_2\setminus i} \cap V(N_i) = \{x_{j_2}\} D j 2 ∖ i ∩ V ( N i ) = { x j 2 } .
Suppose, to the contrary, that there is a node v z ∈ D j 1 ∖ i ∩ D j 2 ∖ i v_z \in D_{j_1\setminus i} \cap D_{j_2\setminus i} v z ∈ D j 1 ∖ i ∩ D j 2 ∖ i . If v z ∈ V ( N i ) v_z \in V(N_i) v z ∈ V ( N i ) , Part 2 gives both v z = x j 1 v_z = x_{j_1} v z = x j 1 and v z = x j 2 v_z = x_{j_2} v z = x j 2 , contradicting x j 1 ≠ x j 2 x_{j_1} \ne x_{j_2} x j 1 = x j 2 . Hence v z ∉ V ( N i ) v_z \notin V(N_i) v z ∈ / V ( N i ) (Fig. A.5).
Figure A.5. The hypothetical common node v z v_z v z of D j 1 ∖ i D_{j_1\setminus i} D j 1 ∖ i and D j 2 ∖ i D_{j_2\setminus i} D j 2 ∖ i .
By Part 1, each of D j 1 ∖ i D_{j_1\setminus i} D j 1 ∖ i and D j 2 ∖ i D_{j_2\setminus i} D j 2 ∖ i induces a connected subgraph of G G G . Under the assumption that they share v z v_z v z , there is a path from x j 1 x_{j_1} x j 1 to v z v_z v z within D j 1 ∖ i D_{j_1\setminus i} D j 1 ∖ i and a path from v z v_z v z to x j 2 x_{j_2} x j 2 within D j 2 ∖ i D_{j_2\setminus i} D j 2 ∖ i . Hence, their union contains a path τ \tau τ from x j 1 x_{j_1} x j 1 to x j 2 x_{j_2} x j 2 .
Since N i N_i N i is connected and contains x j 1 x_{j_1} x j 1 and x j 2 x_{j_2} x j 2 , there is also a path ρ \rho ρ in N i N_i N i between them. The paths τ \tau τ and ρ \rho ρ meet only at x j 1 x_{j_1} x j 1 and x j 2 x_{j_2} x j 2 , so their union forms a loop C C C satisfying ∣ C ∣ ≤ L max ≤ r + 2 |C| \leq L_{\max} \leq r + 2 ∣ C ∣ ≤ L m a x ≤ r + 2 .
The path ρ \rho ρ connects two distinct variable nodes and therefore contains a factor node f b ∈ V ( N i ) ∩ F f_b \in V(N_i) \cap F f b ∈ V ( N i ) ∩ F . By Lemma A.1, V ( C ) ⊆ V ( N i ) V(C) \subseteq V(N_i) V ( C ) ⊆ V ( N i ) . Since V ( τ ) ⊆ V ( C ) V(\tau) \subseteq V(C) V ( τ ) ⊆ V ( C ) , this contradicts V ( τ ) ∩ V ( N i ) = { x j 1 , x j 2 } V(\tau) \cap V(N_i) = \{x_{j_1}, x_{j_2}\} V ( τ ) ∩ V ( N i ) = { x j 1 , x j 2 } .
Therefore, D j 1 ∖ i ∩ D j 2 ∖ i = ∅ D_{j_1\setminus i} \cap D_{j_2\setminus i} = \emptyset D j 1 ∖ i ∩ D j 2 ∖ i = ∅ . □
Proof of (P3)
Let x j 1 , x j 2 , … , x j n x_{j_1}, x_{j_2}, \ldots, x_{j_n} x j 1 , x j 2 , … , x j n satisfy the conditions in (P3), with j 0 = i j_0 = i j 0 = i . We prove that x i , x j 1 , … , x j n x_i, x_{j_1}, \ldots, x_{j_n} x i , x j 1 , … , x j n are pairwise distinct. Suppose, to the contrary, that x j s = x j t x_{j_s} = x_{j_t} x j s = x j t for some $0 \leq t < s \leq n$.
We first show that s ≥ t + 2 s \geq t + 2 s ≥ t + 2 . Since x j 1 ∈ X N i ∖ i x_{j_1} \in\mathcal{X}_{N_i\setminus i} x j 1 ∈ X N i ∖ i , we have x j 1 ≠ x i x_{j_1} \ne x_i x j 1 = x i . Similarly, x j ℓ + 1 ∈ X N j ℓ ∖ j ℓ − 1 x_{j_{\ell+1}} \in\mathcal{X}_{N_{j_\ell\setminus j_{\ell-1}}} x j ℓ + 1 ∈ X N j ℓ ∖ j ℓ − 1 implies x j ℓ + 1 ≠ x j ℓ x_{j_{\ell+1}} \ne x_{j_\ell} x j ℓ + 1 = x j ℓ for ℓ = 1 , 2 , … , n − 1 \ell= 1, 2, \ldots, n - 1 ℓ = 1 , 2 , … , n − 1 . Thus, successive variables are distinct. If s = t + 1 s = t + 1 s = t + 1 , then x j s ≠ x j t x_{j_s} \ne x_{j_t} x j s = x j t , contradicting the assumption. Therefore, s ≥ t + 2 s \geq t + 2 s ≥ t + 2 .
We next show that x j s = x j t ∈ D j t + 1 ∖ j t ∩ V ( N j t ) x_{j_s} = x_{j_t} \in D_{j_{t+1}\setminus j_t} \cap V(N_{j_t}) x j s = x j t ∈ D j t + 1 ∖ j t ∩ V ( N j t ) . For ℓ = t + 1 , … , s \ell= t + 1, \ldots, s ℓ = t + 1 , … , s , N j ℓ ∖ j ℓ − 1 N_{j_\ell\setminus j_{\ell-1}} N j ℓ ∖ j ℓ − 1 is generated recursively from N j ℓ + 1 ∖ j ℓ N_{j_{\ell+1}\setminus j_\ell} N j ℓ + 1 ∖ j ℓ . Hence, V ( N j ℓ ∖ j ℓ − 1 ) ⊆ D j ℓ + 1 ∖ j ℓ V(N_{j_\ell\setminus j_{\ell-1}}) \subseteq D_{j_{\ell+1}\setminus j_\ell} V ( N j ℓ ∖ j ℓ − 1 ) ⊆ D j ℓ + 1 ∖ j ℓ by (6). Taking ℓ = s \ell= s ℓ = s and using x j s ∈ V ( N j s ∖ j s − 1 ) x_{j_s} \in V(N_{j_s\setminus j_{s-1}}) x j s ∈ V ( N j s ∖ j s − 1 ) gives $x_{j_s} \in D j t + 1 ∖ j t D_{j_{t+1}\setminus j_t} D j t + 1 ∖ j t . Moreover, x j s = x j t x_{j_s}=x_{j_t} x j s = x j t and x j t ∈ V ( N j t ) x_{j_t}\in V(N_{j_t}) x j t ∈ V ( N j t ) give x j s ∈ V ( N j t ) x_{j_s}\in V(N_{j_t}) x j s ∈ V ( N j t ) . Therefore, x j s ∈ D j t + 1 ∖ j t ∩ V ( N j t ) x_{j_s}\in D_{j_{t+1}\setminus j_t}\cap V(N_{j_t}) x j s ∈ D j t + 1 ∖ j t ∩ V ( N j t ) .
We now derive a contradiction from (P2). Applying (P2) with i = j t i=j_t i = j t and j = j t + 1 j=j_{t+1} j = j t + 1 yields D j t + 1 ∖ j t ∩ V ( N j t ) = { x j t + 1 } D_{j_{t+1}\setminus j_t}\cap V(N_{j_t})=\{x_{j_{t+1}}\} D j t + 1 ∖ j t ∩ V ( N j t ) = { x j t + 1 } . Since x j s ∈ D j t + 1 ∖ j t ∩ V ( N j t ) x_{j_s}\in D_{j_{t+1}\setminus j_t}\cap V(N_{j_t}) x j s ∈ D j t + 1 ∖ j t ∩ V ( N j t ) , it follows that x j s = x j t + 1 x_{j_s}=x_{j_{t+1}} x j s = x j t + 1 . Together with x j s = x j t x_{j_s}=x_{j_t} x j s = x j t , this implies x j t = x j t + 1 x_{j_t}=x_{j_{t+1}} x j t = x j t + 1 , contradicting x j t + 1 ≠ x j t x_{j_{t+1}}\ne x_{j_t} x j t + 1 = x j t .
Hence, no indices 0 ≤ t < s ≤ n 0\le t<s\le n 0 ≤ t < s ≤ n satisfy x j s = x j t x_{j_s}=x_{j_t} x j s = x j t . Thus, x i , x j 1 , … , x j n x_i,x_{j_1},\ldots,x_{j_n} x i , x j 1 , … , x j n are pairwise distinct. Consequently, every sequence of successively generated residual neighborhoods contains no repeated variable, and the recursive expansion in (3) is acyclic.
If T i ( ℓ ) ≠ ∅ \mathcal{T}_i^{(\ell)}\ne\varnothing T i ( ℓ ) = ∅ , then (3) gives ℓ − 1 \ell-1 ℓ − 1 successive generations from N i N_i N i to a neighborhood in T i ( ℓ ) \mathcal{T}_i^{(\ell)} T i ( ℓ ) . These generations determine the variables x i , x j 1 , … , x j ℓ − 1 x_i,x_{j_1},\ldots,x_{j_{\ell-1}} x i , x j 1 , … , x j ℓ − 1 , where N i ∈ T i ( 1 ) N_i\in\mathcal{T}_i^{(1)} N i ∈ T i ( 1 ) and N j k ∖ j k − 1 ∈ T i ( k + 1 ) N_{j_k\setminus j_{k-1}}\in\mathcal{T}_i^{(k+1)} N j k ∖ j k − 1 ∈ T i ( k + 1 ) for k = 1 , 2 , … , ℓ − 1 k=1,2,\ldots,\ell-1 k = 1 , 2 , … , ℓ − 1 , with j 0 = i j_0=i j 0 = i . By (P3), these ℓ \ell ℓ variables are pairwise distinct, so ℓ ≤ ∣ X ∣ \ell\le|\mathcal{X}| ℓ ≤ ∣ X ∣ . Therefore, if T i ( K ) \mathcal{T}_i^{(K)} T i ( K ) is the last nonempty layer, then K ≤ ∣ X ∣ K\le|\mathcal{X}| K ≤ ∣ X ∣ and T i ( K + 1 ) = ∅ \mathcal{T}_i^{(K+1)}=\varnothing T i ( K + 1 ) = ∅ .
Proof of (P4)
Let x i ∈ X x_i\in\mathcal{X} x i ∈ X , and consider the recursive expansion starting from N i N_i N i defined in (3). By (P3), this expansion terminates after K K K layers.
By (5), proving (4) reduces to showing that every factor node in F \mathcal{F} F belongs to exactly one factor-node set f N f_N f N , where N ∈ ⋃ ℓ = 1 K T i ( ℓ ) N\in\bigcup_{\ell=1}^{K}\mathcal{T}_i^{(\ell)} N ∈ ⋃ ℓ = 1 K T i ( ℓ ) . Equivalently, we prove
F = ⋃ ℓ = 1 K ⋃ N ∈ T i ( ℓ ) f N \mathcal{F}=\bigcup_{\ell=1}^{K}\ \bigcup_{N\in\mathcal{T}_i^{(\ell)}}f_N F = ℓ = 1 ⋃ K N ∈ T i ( ℓ ) ⋃ f N
and f N ∩ f N ′ = ∅ f_N\cap f_{N'}=\varnothing f N ∩ f N ′ = ∅ for all distinct N , N ′ ∈ ⋃ ℓ = 1 K T i ( ℓ ) N,N'\in\bigcup_{\ell=1}^{K}\mathcal{T}_i^{(\ell)} N , N ′ ∈ ⋃ ℓ = 1 K T i ( ℓ ) .
Part 1: Every f l ∈ F f_l\in\mathcal{F} f l ∈ F belongs to at least one f N f_N f N .
For the given variable node x i x_i x i , let
U i = ⋃ ℓ = 1 K ⋃ N ∈ T i ( ℓ ) V ( N ) (26) U_i=\bigcup_{\ell=1}^{K}\ \bigcup_{N\in\mathcal{T}_i^{(\ell)}}V(N) \tag*{(26)} U i = ℓ = 1 ⋃ K N ∈ T i ( ℓ ) ⋃ V ( N ) (26)
denote the union of the node sets of all neighborhoods in the recursive expansion starting from N i N_i N i . Since f N = V ( N ) ∩ F f_N=V(N)\cap\mathcal{F} f N = V ( N ) ∩ F , it is sufficient to prove that U i = X ∪ F U_i=\mathcal{X}\cup\mathcal{F} U i = X ∪ F , that is, U i U_i U i contains every node of G G G .
First, we establish
x a ∈ U i ∩ X ⟹ V ( N a ) ⊆ U i . (27) x_a\in U_i\cap\mathcal{X}\quad\Longrightarrow\quad V(N_a)\subseteq U_i. \tag*{(27)} x a ∈ U i ∩ X ⟹ V ( N a ) ⊆ U i . (27)
The result is immediate for x a = x i x_a=x_i x a = x i , since N i ∈ T i ( 1 ) N_i\in\mathcal{T}_i^{(1)} N i ∈ T i ( 1 ) . Now consider x a ∈ U i ∩ X x_a\in U_i\cap\mathcal{X} x a ∈ U i ∩ X with x a ≠ x i x_a\ne x_i x a = x i . By (A.1) and (3), there exist m ≥ 1 m\ge1 m ≥ 1 and variables x a 0 , x a 1 , … , x a m x_{a_0},x_{a_1},\ldots,x_{a_m} x a 0 , x a 1 , … , x a m , with a 0 = i a_0=i a 0 = i and a m = a a_m=a a m = a , such that
N a s ∖ a s − 1 ∈ T i ( s + 1 ) , s = 1 , 2 , … , m , N_{a_s\setminus a_{s-1}}\in\mathcal{T}_i^{(s+1)},\qquad s=1,2,\ldots,m, N a s ∖ a s − 1 ∈ T i ( s + 1 ) , s = 1 , 2 , … , m ,
and these residual neighborhoods are generated successively. For each s s s , (A.1) and Definition 3 give
V ( N a s ∖ a s − 1 ) ⊆ U i , V ( N a s ) ⊆ V ( N a s − 1 ) ∪ V ( N a s ∖ a s − 1 ) . V(N_{a_s\setminus a_{s-1}})\subseteq U_i,\qquad V(N_{a_s})\subseteq V(N_{a_{s-1}})\cup V(N_{a_s\setminus a_{s-1}}). V ( N a s ∖ a s − 1 ) ⊆ U i , V ( N a s ) ⊆ V ( N a s − 1 ) ∪ V ( N a s ∖ a s − 1 ) .
Starting from V ( N a 0 ) = V ( N i ) ⊆ U i V(N_{a_0})=V(N_i)\subseteq U_i V ( N a 0 ) = V ( N i ) ⊆ U i , these relations successively give V ( N a s ) ⊆ U i V(N_{a_s})\subseteq U_i V ( N a s ) ⊆ U i for s = 1 , 2 , … , m s=1,2,\ldots,m s = 1 , 2 , … , m . In particular, V ( N a ) ⊆ U i V(N_a)\subseteq U_i V ( N a ) ⊆ U i , proving (A.2).
Next, we show that every neighbor of a node in U i U_i U i also belongs to U i U_i U i .
If u = x a ∈ X u=x_a\in\mathcal{X} u = x a ∈ X , then (A.2) gives N u ⊆ V ( N a ) ⊆ U i N_u\subseteq V(N_a)\subseteq U_i N u ⊆ V ( N a ) ⊆ U i .
If u = f b ∈ F u=f_b\in\mathcal{F} u = f b ∈ F , then (A.1) gives f b ∈ V ( N i ) f_b\in V(N_i) f b ∈ V ( N i ) or f b ∈ V ( N a ∖ c ) f_b\in V(N_{a\setminus c}) f b ∈ V ( N a ∖ c ) for some residual neighborhood N a ∖ c N_{a\setminus c} N a ∖ c . Since V ( N a ∖ c ) ⊆ V ( N a ) V(N_{a\setminus c})\subseteq V(N_a) V ( N a ∖ c ) ⊆ V ( N a ) , we have f b ∈ V ( N a ) f_b\in V(N_a) f b ∈ V ( N a ) for some x a ∈ U i ∩ X x_a\in U_i\cap\mathcal{X} x a ∈ U i ∩ X . Definition 2 therefore gives N u ⊆ V ( N a ) ⊆ U i N_u\subseteq V(N_a)\subseteq U_i N u ⊆ V ( N a ) ⊆ U i .
Therefore,
u ∈ U i ⟹ N u ⊆ U i . (28) u\in U_i\quad\Longrightarrow\quad N_u\subseteq U_i. \tag*{(28)} u ∈ U i ⟹ N u ⊆ U i . (28)
Finally, let v ∈ X ∪ F v\in\mathcal{X}\cup\mathcal{F} v ∈ X ∪ F . Since G G G is connected, there is a path p = ( v 0 , v 1 , … , v t ) p=(v_0,v_1,\ldots,v_t) p = ( v 0 , v 1 , … , v t ) with v 0 = x i v_0=x_i v 0 = x i and v t = v v_t=v v t = v . We have v 0 = x i ∈ U i v_0=x_i\in U_i v 0 = x i ∈ U i . Moreover, v s + 1 ∈ N v s v_{s+1}\in N_{v_s} v s + 1 ∈ N v s , so (A.3) successively gives v s ∈ U i v_s\in U_i v s ∈ U i for s = 0 , 1 , … , t s=0,1,\ldots,t s = 0 , 1 , … , t . In particular, v = v t ∈ U i v=v_t\in U_i v = v t ∈ U i . Since v v v was arbitrary, X ∪ F ⊆ U i \mathcal{X}\cup\mathcal{F}\subseteq U_i X ∪ F ⊆ U i . The reverse inclusion follows from (A.1); hence, U i = X ∪ F U_i=\mathcal{X}\cup\mathcal{F} U i = X ∪ F .
Therefore, every f l ∈ F f_l\in\mathcal{F} f l ∈ F belongs to V ( N ) V(N) V ( N ) for some N ∈ ⋃ ℓ = 1 K T i ( ℓ ) N\in\bigcup_{\ell=1}^{K}\mathcal{T}_i^{(\ell)} N ∈ ⋃ ℓ = 1 K T i ( ℓ ) . Since f l f_l f l is a factor node, f l ∈ f N f_l\in f_N f l ∈ f N . This proves Part 1.
Part 2: Each factor node belongs to at most one f N f_N f N .
Let
N , N ′ ∈ ⋃ ℓ = 1 K T i ( ℓ ) , N ≠ N ′ . N,N'\in\bigcup_{\ell=1}^{K}\mathcal{T}_i^{(\ell)},\qquad N\ne N'. N , N ′ ∈ ℓ = 1 ⋃ K T i ( ℓ ) , N = N ′ .
We prove that f N ∩ f N ′ = ∅ f_N\cap f_{N'}=\varnothing f N ∩ f N ′ = ∅ . By the recursive construction and (P3), there is a finite sequence of successively generated neighborhoods from N i N_i N i to N N N , and another from N i N_i N i to N ′ N' N ′ . Let N ∗ N^* N ∗ be the last neighborhood common to the two sequences. Then either N ∗ = N i N^*=N_i N ∗ = N i or N ∗ = N c ∖ d N^*=N_{c\setminus d} N ∗ = N c ∖ d for some x c , x d ∈ X x_c,x_d\in\mathcal{X} x c , x d ∈ X . When N ∗ = N i N^*=N_i N ∗ = N i , set x c = x i x_c=x_i x c = x i . We distinguish whether one sequence ends at N ∗ N^* N ∗ or both continue beyond N ∗ N^* N ∗ . Case 1: N ∗ N^{*} N ∗ equals N N N or N ′ N' N ′ . Without loss of generality, let N ∗ = N N^{*}=N N ∗ = N . Let N s \ c N_{s\backslash c} N s \ c be the first residual neighborhood generated after N ∗ N^{*} N ∗ in the sequence ending at N ′ N' N ′ , as illustrated in Fig. A.6. Then, (6) gives V ( N ′ ) ⊆ D s \ c V(N') \subseteq D_{s\backslash c} V ( N ′ ) ⊆ D s \ c . Hence, f N ′ ⊆ D s \ c f_{N'} \subseteq D_{s\backslash c} f N ′ ⊆ D s \ c . By (P2), D s \ c ∩ V ( N c ) = { x s } D_{s\backslash c} \cap V(N_{c})=\{x_{s}\} D s \ c ∩ V ( N c ) = { x s } , we have f N ′ ∩ V ( N c ) = ∅ f_{N'} \cap V(N_{c})=\varnothing f N ′ ∩ V ( N c ) = ∅ . Moreover, N = N ∗ N=N^{*} N = N ∗ is either N c N_{c} N c or N c \ d N_{c\backslash d} N c \ d . Hence, V ( N ) ⊆ V ( N c ) V(N) \subseteq V(N_{c}) V ( N ) ⊆ V ( N c ) , and therefore f N ⊆ V ( N c ) f_{N} \subseteq V(N_{c}) f N ⊆ V ( N c ) . It follows that f N ∩ f N ′ = ∅ f_{N} \cap f_{N'}=\varnothing f N ∩ f N ′ = ∅ .
Figure A.6. Case 1, where N ∗ = N N^{*}=N N ∗ = N and the generation sequence to N ′ N' N ′ continues through x s x_s x s .
Case 2: N ∗ N^{*} N ∗ equals neither N N N nor N ′ N' N ′ . The two sequences continue from N ∗ N^{*} N ∗ through variables x p x_{p} x p and x q x_{q} x q , respectively, as illustrated in Fig. A.7. Since N ∗ N^{*} N ∗ is their last common neighborhood, x p ≠ x q x_{p}\ne x_{q} x p = x q . Moreover,
f N ⊆ D p \ c , f N ′ ⊆ D q \ c . f_{N} \subseteq D_{p\backslash c}, \qquad f_{N'} \subseteq D_{q\backslash c}. f N ⊆ D p \ c , f N ′ ⊆ D q \ c .
By (P2), D p \ c ∩ D q \ c = ∅ D_{p\backslash c}\cap D_{q\backslash c}=\varnothing D p \ c ∩ D q \ c = ∅ . Therefore, f N ∩ f N ′ = ∅ f_{N}\cap f_{N'}=\varnothing f N ∩ f N ′ = ∅ .
Since N N N and N ′ N' N ′ were arbitrary, both cases show that f N ∩ f N ′ = ∅ f_{N}\cap f_{N'}=\varnothing f N ∩ f N ′ = ∅ for any two distinct neighborhoods in the recursive expansion. Hence, no factor node belongs to more than one f N f_{N} f N . This proves Part 2.
Parts 1 and 2 show that every factor node f ℓ ∈ F f_{\ell}\in\mathcal{F} f ℓ ∈ F belongs to exactly one f N f_{N} f N . Using (5), we therefore obtain
∏ ℓ = 1 K ∏ N ∈ T ℓ ( ℓ ) Φ N ( x N ) = ∏ ℓ = 1 K ∏ N ∈ T ℓ ( ℓ ) ∏ f ℓ ∈ f N f ℓ ( x ℓ ) = ∏ f ℓ ∈ F f ℓ ( x ℓ ) = ψ ( x ) . \prod_{\ell=1}^{K}\prod_{N\in T_{\ell}^{(\ell)}}\Phi_{N}(x_{N})
=
\prod_{\ell=1}^{K}\prod_{N\in T_{\ell}^{(\ell)}}\prod_{f_{\ell}\in f_{N}}f_{\ell}(x_{\ell})
=
\prod_{f_{\ell}\in\mathcal{F}}f_{\ell}(x_{\ell})
=\psi(x). ℓ = 1 ∏ K N ∈ T ℓ ( ℓ ) ∏ Φ N ( x N ) = ℓ = 1 ∏ K N ∈ T ℓ ( ℓ ) ∏ f ℓ ∈ f N ∏ f ℓ ( x ℓ ) = f ℓ ∈ F ∏ f ℓ ( x ℓ ) = ψ ( x ) .
Thus, the hierarchical product in (4) equals ψ ( x ) \psi(x) ψ ( x ) , proving (P4). This also completes the proof of Lemma 1. □
Figure A.7. Case 2, where the two generation sequences continue from N ∗ N^{*} N ∗ through the distinct variables x p x_{p} x p and x q x_{q} x q .
Implementation Details of Algorithms for DC State Estimation
ENMP for DC State Estimation
To apply ENMP (Algorithm 2) to the DC state estimation problem, we specialize the general Gaussian update rules in § 3.4 . For any variable node x i x_i x i , the local factor set satisfies f N i ⊆ { f j } j = 1 n x ∪ { g j } j = 1 n z f_{N_i}\subseteq\{f_j\}_{j=1}^{n_x}\cup\{g_j\}_{j=1}^{n_z} f N i ⊆ { f j } j = 1 n x ∪ { g j } j = 1 n z .
For the message q i ← j ( x j ) q_{i\leftarrow j}(x_j) q i ← j ( x j ) , the aggregated canonical parameters in (18) become
Λ N j \ i = Λ N j \ i l o c + ∑ x k ∈ x N j \ i [ Λ j ← k ] e x t , η N j \ i = η N j \ i l o c + ∑ x k ∈ x N j \ i [ η j ← k ] e x t . (29) \begin{aligned}
\Lambda_{N_j\backslash i} &= \Lambda^{\mathrm{loc}}_{N_j\backslash i}+\sum_{x_k\in x_{N_j\backslash i}}[\Lambda_{j\leftarrow k}]_{\mathrm{ext}},\\
\eta_{N_j\backslash i} &= \eta^{\mathrm{loc}}_{N_j\backslash i}+\sum_{x_k\in x_{N_j\backslash i}}[\eta_{j\leftarrow k}]_{\mathrm{ext}}. \tag*{(29)}
\end{aligned} Λ N j \ i η N j \ i = Λ N j \ i loc + x k ∈ x N j \ i ∑ [ Λ j ← k ] ext , = η N j \ i loc + x k ∈ x N j \ i ∑ [ η j ← k ] ext . (29)
where
Λ N j \ i l o c = ∑ g m ∈ f N j \ i [ a m T Λ z m z m a m ] e x t + ∑ f k ∈ f N j \ i [ Λ x k ] e x t , \Lambda^{\mathrm{loc}}_{N_j\backslash i}
=
\sum_{g_m\in f_{N_j\backslash i}}\left[\mathbf{a}_{m}^{\mathsf{T}}\Lambda_{z_m z_m}\mathbf{a}_{m}\right]_{\mathrm{ext}}
+
\sum_{f_k\in f_{N_j\backslash i}}[\Lambda_{x_k}]_{\mathrm{ext}}, Λ N j \ i loc = g m ∈ f N j \ i ∑ [ a m T Λ z m z m a m ] ext + f k ∈ f N j \ i ∑ [ Λ x k ] ext ,
η N j \ i l o c = ∑ g m ∈ f N j \ i [ a m T Λ z m z m z m ] e x t + ∑ f k ∈ f N j \ i [ Λ x k μ k ] e x t . \eta^{\mathrm{loc}}_{N_j\backslash i}
=
\sum_{g_m\in f_{N_j\backslash i}}\left[\mathbf{a}_{m}^{\mathsf{T}}\Lambda_{z_m z_m}z_m\right]_{\mathrm{ext}}
+
\sum_{f_k\in f_{N_j\backslash i}}[\Lambda_{x_k}\mu_k]_{\mathrm{ext}}. η N j \ i loc = g m ∈ f N j \ i ∑ [ a m T Λ z m z m z m ] ext + f k ∈ f N j \ i ∑ [ Λ x k μ k ] ext .
The message parameters Λ i ← j \Lambda_{i\leftarrow j} Λ i ← j and η i ← j \eta_{i\leftarrow j} η i ← j are then obtained from (19).
Similarly, the aggregated canonical parameters for the belief q i ( x i ) q_i(x_i) q i ( x i ) are
Λ N i = Λ N i l o c + ∑ x j ∈ X N i ∖ i [ Λ i ← j ] e x t , \boldsymbol{\Lambda}_{\mathcal{N}_i}=\boldsymbol{\Lambda}^{\mathrm{loc}}_{\mathcal{N}_i}+\sum_{x_j\in\mathcal{X}_{\mathcal{N}_i}\setminus i}\left[\boldsymbol{\Lambda}_{i\leftarrow j}\right]_{\mathrm{ext}}, Λ N i = Λ N i loc + x j ∈ X N i ∖ i ∑ [ Λ i ← j ] ext ,
η N i = η N i l o c + ∑ x j ∈ X N i ∖ i [ η i ← j ] e x t , (30) \boldsymbol{\eta}_{\mathcal{N}_i}=\boldsymbol{\eta}^{\mathrm{loc}}_{\mathcal{N}_i}+\sum_{x_j\in\mathcal{X}_{\mathcal{N}_i}\setminus i}\left[\boldsymbol{\eta}_{i\leftarrow j}\right]_{\mathrm{ext}}, \tag*{(30)} η N i = η N i loc + x j ∈ X N i ∖ i ∑ [ η i ← j ] ext , (30)
where
Λ N i l o c = ∑ g m ∈ F N i [ a m T Λ z m a m ] e x t + ∑ f k ∈ F N i [ Λ x k ] e x t , \boldsymbol{\Lambda}^{\mathrm{loc}}_{\mathcal{N}_i}
=
\sum_{g_m\in\mathcal{F}_{\mathcal{N}_i}}
\left[\mathbf{a}_m^{\mathsf{T}}\boldsymbol{\Lambda}_{z_m}\mathbf{a}_m\right]_{\mathrm{ext}}
+
\sum_{f_k\in\mathcal{F}_{\mathcal{N}_i}}
\left[\boldsymbol{\Lambda}_{x_k}\right]_{\mathrm{ext}}, Λ N i loc = g m ∈ F N i ∑ [ a m T Λ z m a m ] ext + f k ∈ F N i ∑ [ Λ x k ] ext ,
η N i l o c = ∑ g m ∈ F N i [ a m T Λ z m z m ] e x t + ∑ f k ∈ F N i [ Λ x k μ k ] e x t . \boldsymbol{\eta}^{\mathrm{loc}}_{\mathcal{N}_i}
=
\sum_{g_m\in\mathcal{F}_{\mathcal{N}_i}}
\left[\mathbf{a}_m^{\mathsf{T}}\boldsymbol{\Lambda}_{z_m}z_m\right]_{\mathrm{ext}}
+
\sum_{f_k\in\mathcal{F}_{\mathcal{N}_i}}
\left[\boldsymbol{\Lambda}_{x_k}\mu_k\right]_{\mathrm{ext}}. η N i loc = g m ∈ F N i ∑ [ a m T Λ z m z m ] ext + f k ∈ F N i ∑ [ Λ x k μ k ] ext .
The belief canonical parameters are computed using (21), and the estimated mean μ ^ i , E N M P \hat{\mu}_{i,\mathrm{ENMP}} μ ^ i , ENMP and variance Σ ^ i , E N M P \hat{\Sigma}_{i,\mathrm{ENMP}} Σ ^ i , ENMP are obtained from (22).
In Algorithm 2, the message update in Step 9 uses (B.1) and (19), while the belief computation in Step 15 uses (B.2), (21), and (22).
GBP for DC state estimation
To apply GBP [24 ] to the DC state estimation problem, we construct a region graph over G = ( X , F , E ) \mathcal{G}=(\mathcal{X},\mathcal{F},\mathcal{E}) G = ( X , F , E ) and specialize the message update rules to Gaussian distributions.
Region graph construction
A region graph G R = ( R , E R ) \mathcal{G}_{R}=(\mathcal{R},\mathcal{E}_{R}) G R = ( R , E R ) organizes G \mathcal{G} G into regions, where each region r ∈ R r\in\mathcal{R} r ∈ R contains a subset of variable nodes and all factor nodes whose scope is fully contained within that variable set. Following [24 ] , let P r \mathcal{P}_r P r , C r \mathcal{C}_r C r , and D r \mathcal{D}_r D r denote the sets of parents, children, and descendants of region r r r , respectively, and let D r + = { r } ∪ D r \mathcal{D}^{+}_r=\{r\}\cup\mathcal{D}_r D r + = { r } ∪ D r denote region r r r together with all its descendants.
Two region-graph configurations are evaluated on the IEEE 14-bus system. GBP-A uses three large regions: R 1 A = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 } \mathcal{R}^{A}_{1}=\{x_1,x_2,x_3,x_4,x_5,x_6\} R 1 A = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 } , R 2 A = { x 4 , x 7 , x 8 , x 9 } \mathcal{R}^{A}_{2}=\{x_4,x_7,x_8,x_9\} R 2 A = { x 4 , x 7 , x 8 , x 9 } , and R 3 A = { x 5 , x 6 , x 9 , x 10 , x 11 , x 12 , x 13 , x 14 } \mathcal{R}^{A}_{3}=\{x_5,x_6,x_9,x_{10},x_{11},x_{12},x_{13},x_{14}\} R 3 A = { x 5 , x 6 , x 9 , x 10 , x 11 , x 12 , x 13 , x 14 } , together with three intersection regions S 12 A = { x 4 } \mathcal{S}^{A}_{12}=\{x_4\} S 12 A = { x 4 } , S 13 A = { x 5 , x 6 } \mathcal{S}^{A}_{13}=\{x_5,x_6\} S 13 A = { x 5 , x 6 } , and S 23 A = { x 9 } \mathcal{S}^{A}_{23}=\{x_9\} S 23 A = { x 9 } . GBP-B uses two large regions: R 1 B = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 } \mathcal{R}^{B}_{1}=\{x_1,x_2,x_3,x_4,x_5,x_6\} R 1 B = { x 1 , x 2 , x 3 , x 4 , x 5 , x 6 } and R 2 B = { x 4 , x 5 , x 6 , x 7 , x 8 , x 9 , x 10 , x 11 , x 12 , x 13 , x 14 } \mathcal{R}^{B}_{2}=\{x_4,x_5,x_6,x_7,x_8,x_9,x_{10},x_{11},x_{12},x_{13},x_{14}\} R 2 B = { x 4 , x 5 , x 6 , x 7 , x 8 , x 9 , x 10 , x 11 , x 12 , x 13 , x 14 } , together with one intersection region S 12 B = { x 4 , x 5 , x 6 } \mathcal{S}^{B}_{12}=\{x_4,x_5,x_6\} S 12 B = { x 4 , x 5 , x 6 } . Each region also contains all factor nodes whose neighboring variable nodes are contained in the region. In both configurations, each intersection region s i j s_{ij} s ij has the two large regions sharing it as its parents in G R \mathcal{G}_{R} G R .
Gaussian message update
Since all factors in the DC state estimation factor graph are Gaussian, the message m r s ( x s ) m_{rs}(x_s) m r s ( x s ) from region r r r to its child s s s is Gaussian, parameterized by precision matrix Λ r s \boldsymbol{\Lambda}_{rs} Λ r s and potential vector η r s \boldsymbol{\eta}_{rs} η r s .
The local precision matrix and potential vector accumulated over the factors in r r r but not in s s s (denoted F r ∖ s \mathcal{F}_{r\setminus s} F r ∖ s ) are:
Λ r ∖ s l o c = ∑ g m ∈ F r ∖ s [ a m T Λ z m a m ] e x t + ∑ f k ∈ F r ∖ s [ Λ x k ] e x t , (31) \boldsymbol{\Lambda}^{\mathrm{loc}}_{r\setminus s}
=
\sum_{g_m\in\mathcal{F}_{r\setminus s}}
\left[\mathbf{a}_m^{\mathsf{T}}\boldsymbol{\Lambda}_{z_m}\mathbf{a}_m\right]_{\mathrm{ext}}
+
\sum_{f_k\in\mathcal{F}_{r\setminus s}}
\left[\boldsymbol{\Lambda}_{x_k}\right]_{\mathrm{ext}}, \tag*{(31)} Λ r ∖ s loc = g m ∈ F r ∖ s ∑ [ a m T Λ z m a m ] ext + f k ∈ F r ∖ s ∑ [ Λ x k ] ext , (31)
η r ∖ s l o c = ∑ g m ∈ F r ∖ s [ a m T Λ z m z m ] e x t + ∑ f k ∈ F r ∖ s [ Λ x k μ k ] e x t , (32) \boldsymbol{\eta}^{\mathrm{loc}}_{r\setminus s}
=
\sum_{g_m\in\mathcal{F}_{r\setminus s}}
\left[\mathbf{a}_m^{\mathsf{T}}\boldsymbol{\Lambda}_{z_m}z_m\right]_{\mathrm{ext}}
+
\sum_{f_k\in\mathcal{F}_{r\setminus s}}
\left[\boldsymbol{\Lambda}_{x_k}\mu_k\right]_{\mathrm{ext}}, \tag*{(32)} η r ∖ s loc = g m ∈ F r ∖ s ∑ [ a m T Λ z m z m ] ext + f k ∈ F r ∖ s ∑ [ Λ x k μ k ] ext , (32)
where [ ⋅ ] e x t [\cdot]_{\mathrm{ext}} [ ⋅ ] ext denotes zero-padded expansion to the dimension of x r x_r x r . Incorporating incoming messages from regions outside D r + \mathcal{D}^{+}_{r} D r + to nodes in D r + ∖ D s + \mathcal{D}^{+}_{r}\setminus\mathcal{D}^{+}_{s} D r + ∖ D s + , the aggregated precision and potential over x r x_r x r are:
Λ r a g g = Λ r ∖ s l o c + ∑ u ∈ R ∖ D r + v ∈ D r + ∖ D s + , u ∈ P v [ Λ u v ] e x t , (33) \boldsymbol{\Lambda}^{\mathrm{agg}}_r
=
\boldsymbol{\Lambda}^{\mathrm{loc}}_{r\setminus s}
+
\sum_{\substack{u\in\mathcal{R}\setminus\mathcal{D}^{+}_{r}\\
v\in\mathcal{D}^{+}_{r}\setminus\mathcal{D}^{+}_{s},\ u\in\mathcal{P}_v}}
\left[\boldsymbol{\Lambda}_{uv}\right]_{\mathrm{ext}}, \tag*{(33)} Λ r agg = Λ r ∖ s loc + u ∈ R ∖ D r + v ∈ D r + ∖ D s + , u ∈ P v ∑ [ Λ uv ] ext , (33)
η r a g g = η r ∖ s l o c + ∑ u ∈ R ∖ D r + v ∈ D r + ∖ D s + , u ∈ P v [ η u v ] e x t . (34) \boldsymbol{\eta}^{\mathrm{agg}}_r
=
\boldsymbol{\eta}^{\mathrm{loc}}_{r\setminus s}
+
\sum_{\substack{u\in\mathcal{R}\setminus\mathcal{D}^{+}_{r}\\
v\in\mathcal{D}^{+}_{r}\setminus\mathcal{D}^{+}_{s},\ u\in\mathcal{P}_v}}
\left[\boldsymbol{\eta}_{uv}\right]_{\mathrm{ext}}. \tag*{(34)} η r agg = η r ∖ s loc + u ∈ R ∖ D r + v ∈ D r + ∖ D s + , u ∈ P v ∑ [ η uv ] ext . (34)
The message parameters are obtained by marginalizing over x r x_r x r via the Schur complement. Let Σ r a g g = ( Λ r a g g ) − 1 \boldsymbol{\Sigma}^{\mathrm{agg}}_r=(\boldsymbol{\Lambda}^{\mathrm{agg}}_r)^{-1} Σ r agg = ( Λ r agg ) − 1 . Then,
Λ r s = [ Σ r a g g ] s s − 1 , η r s = Λ r s [ Σ r a g g η r a g g ] s , (35) \boldsymbol{\Lambda}_{rs}
=
\left[\boldsymbol{\Sigma}^{\mathrm{agg}}_r\right]_{ss}^{-1},
\qquad
\boldsymbol{\eta}_{rs}
=
\boldsymbol{\Lambda}_{rs}
\left[\boldsymbol{\Sigma}^{\mathrm{agg}}_r\boldsymbol{\eta}^{\mathrm{agg}}_r\right]_s, \tag*{(35)} Λ r s = [ Σ r agg ] ss − 1 , η r s = Λ r s [ Σ r agg η r agg ] s , (35)
where [ ⋅ ] s s [\cdot]_{ss} [ ⋅ ] ss and [ ⋅ ] s [\cdot]_s [ ⋅ ] s denote the block sub-matrix and sub-vector corresponding to x s x_s x s , respectively.
Belief and marginal
Upon convergence, the belief of region r r r is a Gaussian with parameters,
Λ r b e l = Λ r l o c + ∑ v ∈ D r + u ∈ P v ∖ D r + [ Λ u v ] e x t , (36) \boldsymbol{\Lambda}^{\mathrm{bel}}_r
=
\boldsymbol{\Lambda}^{\mathrm{loc}}_r
+
\sum_{\substack{v\in\mathcal{D}^{+}_{r}\\u\in\mathcal{P}_v\setminus\mathcal{D}^{+}_{r}}}
\left[\boldsymbol{\Lambda}_{uv}\right]_{\mathrm{ext}}, \tag*{(36)} Λ r bel = Λ r loc + v ∈ D r + u ∈ P v ∖ D r + ∑ [ Λ uv ] ext , (36)
η r b e l = η r l o c + ∑ v ∈ D r + u ∈ P v ∖ D r + [ η u v ] e x t . (37) \boldsymbol{\eta}^{\mathrm{bel}}_r
=
\boldsymbol{\eta}^{\mathrm{loc}}_r
+
\sum_{\substack{v\in\mathcal{D}^{+}_{r}\\u\in\mathcal{P}_v\setminus\mathcal{D}^{+}_{r}}}
\left[\boldsymbol{\eta}_{uv}\right]_{\mathrm{ext}}. \tag*{(37)} η r bel = η r loc + v ∈ D r + u ∈ P v ∖ D r + ∑ [ η uv ] ext . (37)
where Λ r l o c \boldsymbol{\Lambda}^{\mathrm{loc}}_r Λ r loc and η r l o c \boldsymbol{\eta}^{\mathrm{loc}}_r η r loc follow (B.3) with the summation extended to all factors in r r r (i.e., f r f_r f r instead of F r ∖ s \mathcal{F}_{r\setminus s} F r ∖ s ). The marginal mean μ ^ i , G B P \hat{\mu}_{i,\mathrm{GBP}} μ ^ i , GBP and variance Σ ^ i , G B P \hat{\Sigma}_{i,\mathrm{GBP}} Σ ^ i , GBP of variable x i x_i x i in the smallest region r ∋ x i r \ni x_i r ∋ x i are given by
Σ r b e l = ( Λ r b e l ) − 1 , μ ^ i , G B P = [ Σ r b e l η r b e l ] i , Σ ^ i , G B P = [ Σ r b e l ] i i (38) \boldsymbol{\Sigma}^{\mathrm{bel}}_r = \left(\boldsymbol{\Lambda}^{\mathrm{bel}}_r\right)^{-1},\quad\hat{\mu}_{i,\mathrm{GBP}} = \left[\boldsymbol{\Sigma}^{\mathrm{bel}}_r\boldsymbol{\eta}^{\mathrm{bel}}_r\right]_i,\quad\hat{\Sigma}_{i,\mathrm{GBP}} = \left[\boldsymbol{\Sigma}^{\mathrm{bel}}_r\right]_{ii} \tag*{(38)} Σ r bel = ( Λ r bel ) − 1 , μ ^ i , GBP = [ Σ r bel η r bel ] i , Σ ^ i , GBP = [ Σ r bel ] ii (38)
The complete GBP algorithm for DC state estimation is given in Algorithm B.1.
Algorithm B.1 GBP for DC state estimation.
Require: Factor graph G \mathcal{G} G , region graph G R \mathcal{G}_R G R , priors { μ x i , Λ x i } i = 1 n x \{\mu_{x_i},\Lambda_{x_i}\}_{i=1}^{n_x} { μ x i , Λ x i } i = 1 n x , measurements { z j , Λ z j } j = 1 n z \{z_j,\Lambda_{z_j}\}_{j=1}^{n_z} { z j , Λ z j } j = 1 n z , maximum iterations β \beta β , convergence threshold δ \delta δ ;
Ensure: Beliefs b ( x i ) b(x_i) b ( x i ) , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x ;
Let t = 1 t=1 t = 1 , e = ∞ e=\infty e = ∞ ; initialize Λ r s ( 0 ) = 10 − 4 I \boldsymbol{\Lambda}_{rs}^{(0)}=10^{-4}\mathbf{I} Λ r s ( 0 ) = 1 0 − 4 I , η r s ( 0 ) = 0 \boldsymbol{\eta}_{rs}^{(0)}=\mathbf{0} η r s ( 0 ) = 0 for all ( r , s ) (r,s) ( r , s ) with s ∈ C r s\in\mathcal{C}_r s ∈ C r ;
while e > δ e>\delta e > δ and t ≤ β t\le\beta t ≤ β do
for each ( r , s ) (r,s) ( r , s ) with s ∈ C r s\in\mathcal{C}_r s ∈ C r do
Compute ( Λ r s ( t ) , η r s ( t ) ) (\boldsymbol{\Lambda}_{rs}^{(t)},\boldsymbol{\eta}_{rs}^{(t)}) ( Λ r s ( t ) , η r s ( t ) ) via (B.3)–(B.5);
end for
e ← max r , s ∥ m r s ( t ) − m r s ( t − 1 ) ∥ ∞ e\leftarrow\max_{r,s}\left\|\boldsymbol{m}_{rs}^{(t)}-\boldsymbol{m}_{rs}^{(t-1)}\right\|_\infty e ← max r , s m r s ( t ) − m r s ( t − 1 ) ∞ ;
t ← t + 1 t\leftarrow t+1 t ← t + 1 ;
end while
for each r ∈ R r\in\mathcal{R} r ∈ R do
Compute ( Λ r b e l , η r b e l ) (\boldsymbol{\Lambda}^{\mathrm{bel}}_r,\boldsymbol{\eta}^{\mathrm{bel}}_r) ( Λ r bel , η r bel ) via (B.6);
end for
for i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x do
Select the smallest region r ∈ R r\in\mathcal{R} r ∈ R with x i ∈ r x_i\in r x i ∈ r ; compute ( μ ^ i , G B P , Σ ^ i , G B P ) (\hat{\mu}_{i,\mathrm{GBP}},\hat{\Sigma}_{i,\mathrm{GBP}}) ( μ ^ i , GBP , Σ ^ i , GBP ) via (B.7);
b ( x i ) ← N ( x i ; μ ^ i , G B P , Σ ^ i , G B P ) b(x_i)\leftarrow\mathcal{N}(x_i;\hat{\mu}_{i,\mathrm{GBP}},\hat{\Sigma}_{i,\mathrm{GBP}}) b ( x i ) ← N ( x i ; μ ^ i , GBP , Σ ^ i , GBP ) ;
end for
return b ( x i ) b(x_i) b ( x i ) , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x .
sGaBP-m for DC state estimation
The sGaBP-m algorithm serves as a robust baseline by introducing the regularization parameter λ \lambda λ to enforce convergence [29 ] . However, sGaBP-m operates on a pairwise Markov graph rather than a factor graph. Thus, to apply sGaBP-m, we first convert the factor graph model in (24) into its canonical Gaussian form defined by a global precision matrix S ∈ R n x × n x \mathbf{S}\in\mathbb{R}^{n_x\times n_x} S ∈ R n x × n x and a potential vector b ∈ R n x \mathbf{b}\in\mathbb{R}^{n_x} b ∈ R n x , which are derived as,
S = Λ p r i o r + A T Λ z A , \mathbf{S}=\boldsymbol{\Lambda}_{\mathrm{prior}}+\mathbf{A}^{\mathsf{T}}\boldsymbol{\Lambda}_z\mathbf{A}, S = Λ prior + A T Λ z A ,
b = Λ p r i o r μ p r i o r + A T Λ z z , (39) \mathbf{b}=\boldsymbol{\Lambda}_{\mathrm{prior}}\boldsymbol{\mu}_{\mathrm{prior}}+\mathbf{A}^{\mathsf{T}}\boldsymbol{\Lambda}_z\mathbf{z}, \tag*{(39)} b = Λ prior μ prior + A T Λ z z , (39)
where Λ p r i o r = diag ( Λ x 1 , … , Λ x n x ) \boldsymbol{\Lambda}_{\mathrm{prior}}=\operatorname{diag}(\Lambda_{x_1},\ldots,\Lambda_{x_{n_x}}) Λ prior = diag ( Λ x 1 , … , Λ x n x ) , μ p r i o r = [ μ 1 , … , μ n x ] T \boldsymbol{\mu}_{\mathrm{prior}}=[\mu_1,\ldots,\mu_{n_x}]^{\mathsf{T}} μ prior = [ μ 1 , … , μ n x ] T , and Λ z = diag ( Λ z 1 , … , Λ z n z ) \boldsymbol{\Lambda}_z=\operatorname{diag}(\Lambda_{z_1},\ldots,\Lambda_{z_{n_z}}) Λ z = diag ( Λ z 1 , … , Λ z n z ) . Once S \mathbf{S} S and b \mathbf{b} b are obtained, a weighted undirected graph is constructed over the variable nodes, with the edge weight between nodes i i i and j j j being defined as
w i j = ∣ S i j ∣ S i i S j j , i ≠ j , (40) w_{ij}=\frac{\lvert S_{ij}\rvert}{\sqrt{S_{ii}S_{jj}}},\quad i\ne j, \tag*{(40)} w ij = S ii S j j ∣ S ij ∣ , i = j , (40)
where S i j S_{ij} S ij denotes the ( i , j ) (i,j) ( i , j ) -th element of S \mathbf{S} S . An edge is included only when S i j ≠ 0 S_{ij}\ne0 S ij = 0 , i.e., when variables x i x_i x i and x j x_j x j are coupled in the pairwise Markov graph. The variable set X \mathcal{X} X is then partitioned into p = ⌈ α n x ⌉ p=\lceil\alpha n_x\rceil p = ⌈ α n x ⌉ disjoint clusters using the METIS balanced graph partitioning algorithm [37 ] , which produces balanced partitions with minimal edge cut with respect to the weights in (B.9).
Let C c ⊂ X \mathcal{C}_c\subset\mathcal{X} C c ⊂ X denote the subset of variable nodes belonging to the c c c -th cluster, so that the clusters partition the variable set, ⋃ c = 1 p C c = X \bigcup_{c=1}^{p}\mathcal{C}_c=\mathcal{X} ⋃ c = 1 p C c = X . To facilitate the algorithmic description, we adopt a block notation indexed by clusters. Let S c c ′ = S [ C c , C c ′ ] \mathbf{S}_{cc'}=\mathbf{S}[\mathcal{C}_c,\mathcal{C}_{c'}] S c c ′ = S [ C c , C c ′ ] denote the block of S \mathbf{S} S with rows indexed by C c \mathcal{C}_c C c and columns by C c ′ \mathcal{C}_{c'} C c ′ (the diagonal block S c c \mathbf{S}_{cc} S cc being the within-cluster precision on C c \mathcal{C}_c C c ), in contrast to the scalar entry S i j S_{ij} S ij in (B.9). Similarly, let b c \mathbf{b}_c b c and μ c \boldsymbol{\mu}_c μ c denote the sub-vectors of b \mathbf{b} b and of the cluster mean on C c \mathcal{C}_c C c , respectively. Let d c = ∣ C c ∣ d_c=\lvert\mathcal{C}_c\rvert d c = ∣ C c ∣ be the dimension of C c \mathcal{C}_c C c , and A c \mathcal{A}_c A c the set of indices of clusters neighboring C c \mathcal{C}_c C c . Based on these definitions, the sGaBP-m algorithm is summarized as Algorithm B.2.
Algorithm B.2 The sGaBP-m algorithm for inferring x k x_k x k .
Require: Precision matrix S \mathbf{S} S , potential vector b \mathbf{b} b , clusters { C c } c = 1 p \{\mathcal{C}_c\}_{c=1}^{p} { C c } c = 1 p , parameters λ , β , δ \lambda,\beta,\delta λ , β , δ ;
Ensure: Marginal beliefs b ( x k ) b(x_k) b ( x k ) for all variable nodes k = 1 , 2 , … , n x k=1,2,\ldots,n_x k = 1 , 2 , … , n x ;
Let t = 0 t=0 t = 0 and error e = ∞ e=\infty e = ∞ ;
Initialize μ c ( − 1 ) = 0 \boldsymbol{\mu}_c^{(-1)}=\mathbf{0} μ c ( − 1 ) = 0 , Q c ′ c ( 0 ) = 0 \mathbf{Q}_{c'c}^{(0)}=\mathbf{0} Q c ′ c ( 0 ) = 0 , and v c ′ c ( 0 ) = 0 \mathbf{v}_{c'c}^{(0)}=\mathbf{0} v c ′ c ( 0 ) = 0 for all clusters c = 1 , 2 , … , p c=1,2,\ldots,p c = 1 , 2 , … , p and all c ′ ∈ A c c'\in\mathcal{A}_c c ′ ∈ A c ;
while e > δ e>\delta e > δ and t < β t<\beta t < β do
for c = 1 c=1 c = 1 to p p p do
P c ( t ) = λ I d c + S c c + ∑ c ′ ∈ A c Q c ′ c ( t ) \mathbf{P}_c^{(t)}=\lambda\mathbf{I}_{d_c}+\mathbf{S}_{cc}+\sum_{c'\in\mathcal{A}_c}\mathbf{Q}_{c'c}^{(t)} P c ( t ) = λ I d c + S cc + ∑ c ′ ∈ A c Q c ′ c ( t ) ;
h c ( t ) = b c + ∑ c ′ ∈ A c v c ′ c ( t ) \mathbf{h}_c^{(t)}=\mathbf{b}_c+\sum_{c'\in\mathcal{A}_c}\mathbf{v}_{c'c}^{(t)} h c ( t ) = b c + ∑ c ′ ∈ A c v c ′ c ( t ) ;
μ c ( t ) = [ P c ( t ) ] − 1 [ λ μ c ( t − 1 ) + h c ( t ) ] \boldsymbol{\mu}_c^{(t)}=[\mathbf{P}_c^{(t)}]^{-1}[\lambda\boldsymbol{\mu}_c^{(t-1)}+\mathbf{h}_c^{(t)}] μ c ( t ) = [ P c ( t ) ] − 1 [ λ μ c ( t − 1 ) + h c ( t ) ] ;
end for
e ← max c ∥ S c c μ c ( t ) + ∑ c ′ ∈ A c S c c ′ μ c ′ ( t ) − b c ∥ ∞ e\leftarrow\max_c\left\|\mathbf{S}_{cc}\boldsymbol{\mu}_c^{(t)}+\sum_{c'\in\mathcal{A}_c}\mathbf{S}_{cc'}\boldsymbol{\mu}_{c'}^{(t)}-\mathbf{b}_c\right\|_\infty e ← max c S cc μ c ( t ) + ∑ c ′ ∈ A c S c c ′ μ c ′ ( t ) − b c ∞ ;
If e ≤ δ e\le\delta e ≤ δ break ;
for c = 1 c=1 c = 1 to p p p and each neighbor c ′ ∈ A c c'\in\mathcal{A}_c c ′ ∈ A c do
Q c c ′ ( t + 1 ) = − S c ′ c [ P c ( t ) − Q c ′ c ( t ) ] − 1 S c c ′ \mathbf{Q}_{cc'}^{(t+1)}=-\mathbf{S}_{c'c}[\mathbf{P}_c^{(t)}-\mathbf{Q}_{c'c}^{(t)}]^{-1}\mathbf{S}_{cc'} Q c c ′ ( t + 1 ) = − S c ′ c [ P c ( t ) − Q c ′ c ( t ) ] − 1 S c c ′ ;
v c c ′ ( t + 1 ) = − S c ′ c [ P c ( t ) − Q c ′ c ( t ) ] − 1 [ λ μ c ( t − 1 ) + h c ( t ) − v c ′ c ( t ) ] \mathbf{v}_{cc'}^{(t+1)}=-\mathbf{S}_{c'c}[\mathbf{P}_c^{(t)}-\mathbf{Q}_{c'c}^{(t)}]^{-1}[\lambda\boldsymbol{\mu}_c^{(t-1)}+\mathbf{h}_c^{(t)}-\mathbf{v}_{c'c}^{(t)}] v c c ′ ( t + 1 ) = − S c ′ c [ P c ( t ) − Q c ′ c ( t ) ] − 1 [ λ μ c ( t − 1 ) + h c ( t ) − v c ′ c ( t ) ] ;
end for
t ← t + 1 t\leftarrow t+1 t ← t + 1 ;
end while
Compute P ^ c ( t ) = S c c + ∑ c ′ ∈ A c Q c ′ c ( t ) \hat{\mathbf{P}}_c^{(t)}=\mathbf{S}_{cc}+\sum_{c'\in\mathcal{A}_c}\mathbf{Q}_{c'c}^{(t)} P ^ c ( t ) = S cc + ∑ c ′ ∈ A c Q c ′ c ( t ) for all c c c ;
Return b ( x k ) = N ( x k ∣ [ μ c ( t ) ] k , [ ( P ^ c ( t ) ) − 1 ] k k ) b(x_k)=\mathcal{N}\left(x_k\mid[\boldsymbol{\mu}_c^{(t)}]_k,[(\hat{\mathbf{P}}_c^{(t)})^{-1}]_{kk}\right) b ( x k ) = N ( x k ∣ [ μ c ( t ) ] k , [( P ^ c ( t ) ) − 1 ] k k ) , where x k ∈ C c x_k\in\mathcal{C}_c x k ∈ C c .
BP for DC state estimation
For comparative analysis, we implement the BP algorithm for the DC state estimation problem. We adopt the BP message update rules in (7), (12), and (14) of [34 ] . The message from a factor node f i f_i f i to a variable node x i x_i x i can be expressed as m f i → x i = p ( x i ) = N ( x i ∣ μ x i , Λ x i − 1 ) m_{f_i \to x_i}=p(x_i)=\mathcal{N}(x_i\mid\mu_{x_i},\Lambda_{x_i}^{-1}) m f i → x i = p ( x i ) = N ( x i ∣ μ x i , Λ x i − 1 ) . The message from a factor node g j g_j g j to a variable node x i x_i x i can be expressed as m g j → x i ∝ N ( x i ∣ μ g j x i , Λ g j x i − 1 ) m_{g_j \to x_i}\propto\mathcal{N}(x_i\mid\mu_{g_j}^{x_i},\Lambda_{g_j}^{x_i^{-1}}) m g j → x i ∝ N ( x i ∣ μ g j x i , Λ g j x i − 1 ) , where the mean μ g j x i \mu_{g_j}^{x_i} μ g j x i and precision matrix Λ g j x i \Lambda_{g_j}^{x_i} Λ g j x i can be obtained as,
μ g j x i = 1 a i , j ( z j − ∑ x u ∈ N g j ∖ x i a u , j μ x u g j ) \mu_{g_j}^{x_i}=\frac{1}{a_{i,j}}\left(z_j-\sum_{x_u\in\mathcal{N}_{g_j}\setminus x_i}a_{u,j}\mu_{x_u}^{g_j}\right) μ g j x i = a i , j 1 z j − x u ∈ N g j ∖ x i ∑ a u , j μ x u g j
Λ g j x i = 1 a i , j 2 ( Λ z j − 1 + ∑ x u ∈ N g j ∖ x i a u , j 2 Λ x u g j − 1 ) (41) \Lambda_{g_j}^{x_i}=\frac{1}{a_{i,j}^{2}}\left(\Lambda_{z_j}^{-1}+\sum_{x_u\in\mathcal{N}_{g_j}\setminus x_i}a_{u,j}^{2}\Lambda_{x_u}^{g_j^{-1}}\right) \tag*{(41)} Λ g j x i = a i , j 2 1 Λ z j − 1 + x u ∈ N g j ∖ x i ∑ a u , j 2 Λ x u g j − 1 (41)
where N g j \mathcal{N}_{g_j} N g j denotes the set of variable nodes directly connected to the factor node g j g_j g j . The message from a variable node x i x_i x i to a factor node g j g_j g j is m x i → g j ∝ N ( x i ∣ μ x i g j , Λ x i g j − 1 ) m_{x_i\to g_j}\propto\mathcal{N}(x_i\mid\mu_{x_i}^{g_j},\Lambda_{x_i}^{g_j^{-1}}) m x i → g j ∝ N ( x i ∣ μ x i g j , Λ x i g j − 1 ) , where,
μ x i g j = Λ x i g j − 1 ( ∑ g u ∈ N x i ∖ g j Λ g u x i μ g u x i + Λ x i μ x i ) \mu_{x_i}^{g_j}=\Lambda_{x_i}^{g_j^{-1}}\left(\sum_{g_u\in\mathcal{N}_{x_i}\setminus g_j}\Lambda_{g_u}^{x_i}\mu_{g_u}^{x_i}+\Lambda_{x_i}\mu_{x_i}\right) μ x i g j = Λ x i g j − 1 g u ∈ N x i ∖ g j ∑ Λ g u x i μ g u x i + Λ x i μ x i
Λ x i g j = ∑ g u ∈ N x i ∖ g j Λ g u x i + Λ x i (42) \Lambda_{x_i}^{g_j}=\sum_{g_u\in\mathcal{N}_{x_i}\setminus g_j}\Lambda_{g_u}^{x_i}+\Lambda_{x_i} \tag*{(42)} Λ x i g j = g u ∈ N x i ∖ g j ∑ Λ g u x i + Λ x i (42)
where N x i \mathcal{N}_{x_i} N x i denotes the set of factor nodes connected to variable node x i x_i x i .
Upon convergence, the belief b ( x i ) b(x_i) b ( x i ) is given by,
b ( x i ) = m f i → x i ∏ g u ∈ N x i m g u → x i = N ( x i ∣ μ x i , Λ x i − 1 ) ∏ g u ∈ N x i N ( x i ∣ μ g u x i , ( Λ g u x i ) − 1 ) ∝ N ( x i ∣ μ ^ i , B P , Λ ^ i , B P − 1 ) . (43) \begin{aligned}
b(x_i)&=m_{f_i\to x_i}\prod_{g_u\in\mathcal{N}_{x_i}}m_{g_u\to x_i}\\
&=\mathcal{N}(x_i\mid\mu_{x_i},\Lambda_{x_i}^{-1})\prod_{g_u\in\mathcal{N}_{x_i}}\mathcal{N}(x_i\mid\mu_{g_u}^{x_i},(\Lambda_{g_u}^{x_i})^{-1})\\
&\propto\mathcal{N}(x_i\mid\hat{\mu}_{i,\mathrm{BP}},\hat{\Lambda}_{i,\mathrm{BP}}^{-1}). \tag*{(43)}
\end{aligned} b ( x i ) = m f i → x i g u ∈ N x i ∏ m g u → x i = N ( x i ∣ μ x i , Λ x i − 1 ) g u ∈ N x i ∏ N ( x i ∣ μ g u x i , ( Λ g u x i ) − 1 ) ∝ N ( x i ∣ μ ^ i , BP , Λ ^ i , BP − 1 ) . (43)
Let m g j → x i t m_{g_j\to x_i}^{t} m g j → x i t and m x i → g j t m_{x_i\to g_j}^{t} m x i → g j t denote the messages passed from factor node g j g_j g j to variable node x i x_i x i and from variable node x i x_i x i to factor node g j g_j g j at the t t t -th iteration, respectively. The BP algorithm is summarized as Algorithm B.3.
Implementation Details of Algorithms for the Ising Model
The following three subsections adapt Algorithms 2, B.1, and B.3 to the Ising factor graph. Three aspects change uniformly across all the three algorithms.
First, the inputs are changed as follows. The Gaussian priors { μ x i , Λ x i − 1 } i = 1 n x \{\mu_{x_i},\Lambda_{x_i}^{-1}\}_{i=1}^{n_x} { μ x i , Λ x i − 1 } i = 1 n x and measurements { z j , Λ z j − 1 } j = 1 n z \{z_j,\Lambda_{z_j}^{-1}\}_{j=1}^{n_z} { z j , Λ z j − 1 } j = 1 n z are replaced by { h i } i = 1 n x \{h_i\}_{i=1}^{n_x} { h i } i = 1 n x and { J i j } f i j ∈ F \{J_{ij}\}_{f_{ij}\in\mathcal{F}} { J ij } f ij ∈ F , with x i ∈ { − 1 , + 1 } x_i\in\{-1,+1\} x i ∈ { − 1 , + 1 } . The factor set consists of factors f i ( x i ) = exp ( h i x i ) f_i(x_i)=\exp(h_i x_i) f i ( x i ) = exp ( h i x i ) and pairwise factors f i j ( x i , x j ) = exp ( J i j x i x j ) f_{ij}(x_i,x_j)=\exp(J_{ij}x_i x_j) f ij ( x i , x j ) = exp ( J ij x i x j ) .
Second, all messages are discrete distributions over { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } rather than Gaussian distributions parameterized by precision and potential; accordingly, the Gaussian message formulas and the Schur-complement marginalization are replaced by finite summations over { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } .
Algorithm B.3 The BP algorithm for inferring x i x_i x i .
Require: The factor graph G G G , priors { μ x i , Λ x i − 1 } i = 1 n x \{\mu_{x_i},\Lambda_{x_i}^{-1}\}_{i=1}^{n_x} { μ x i , Λ x i − 1 } i = 1 n x , measurements { z j , Λ z j − 1 } j = 1 n z \{z_j,\Lambda_{z_j}^{-1}\}_{j=1}^{n_z} { z j , Λ z j − 1 } j = 1 n z , parameters β , δ \beta,\delta β , δ ;
Ensure: Beliefs b ( x i ) b(x_i) b ( x i ) , i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x ;
Let t = 1 t=1 t = 1 and error e = ∞ e=\infty e = ∞ ;
For all connected nodes x i x_i x i (i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x ) and g j g_j g j (j = 1 , 2 , … , n z j=1,2,\ldots,n_z j = 1 , 2 , … , n z ), initialize messages m x i → g j 0 m_{x_i\to g_j}^{0} m x i → g j 0 and m g j → x i 0 m_{g_j\to x_i}^{0} m g j → x i 0 as Gaussian distributions;
while e > δ e>\delta e > δ and t ≤ β t\le\beta t ≤ β do
for all factor node g j g_j g j (j = 1 , 2 , … , n z j=1,2,\ldots,n_z j = 1 , 2 , … , n z ) and each neighbor x i ∈ N g j x_i\in\mathcal{N}_{g_j} x i ∈ N g j do
Compute m g j → x i t m_{g_j\to x_i}^{t} m g j → x i t via (B.10) using incoming messages { m x k → g j t − 1 } x k ∈ N g j ∖ { x i } \{m_{x_k\to g_j}^{t-1}\}_{x_k\in\mathcal{N}_{g_j}\setminus\{x_i\}} { m x k → g j t − 1 } x k ∈ N g j ∖ { x i } from iteration t − 1 t-1 t − 1 ;
end for
for all variable node x i x_i x i (i = 1 , 2 , … , n x i=1,2,\ldots,n_x i = 1 , 2 , … , n x ) and each neighbor g j ∈ N x i g_j\in\mathcal{N}_{x_i} g j ∈ N x i do
Compute m x i → g j t m_{x_i\to g_j}^{t} m x i → g j t via (B.11) using incoming messages { m g k → x i t − 1 } g k ∈ N x i ∖ { g j } \{m_{g_k\to x_i}^{t-1}\}_{g_k\in\mathcal{N}_{x_i}\setminus\{g_j\}} { m g k → x i t − 1 } g k ∈ N x i ∖ { g j } from iteration t − 1 t-1 t − 1 ;
end for
e ← max i , j ∥ m g j → x i ( t ) − m g j → x i ( t − 1 ) ∥ ∞ e\gets\max_{i,j}\left\|m_{g_j\to x_i}^{(t)}-m_{g_j\to x_i}^{(t-1)}\right\|_{\infty} e ← max i , j m g j → x i ( t ) − m g j → x i ( t − 1 ) ∞ ;
t ← t + 1 t\gets t+1 t ← t + 1 ;
end while
Calculate beliefs via (B.12) for all i ∈ { 1 , 2 , … , n x } i\in\{1,2,\ldots,n_x\} i ∈ { 1 , 2 , … , n x } ;
Return b ( x i ) b(x_i) b ( x i ) .
The specific message formulas for each algorithm are given in Sections C.1–C.3 of Appendix C.
ENMP for Ising model
The local potential function over the residual r r r -neighborhood N j ∖ i \mathcal{N}_{j\setminus i} N j ∖ i is
Φ N j ∖ i ( x N j ∖ i ) = ∏ f k l ∈ F N j ∖ i exp ( J k l x k x l ) ∏ f k ∈ F N j ∖ i exp ( h k x k ) . (44) \Phi_{\mathcal{N}_{j\setminus i}}(x_{\mathcal{N}_{j\setminus i}})=\prod_{f_{kl}\in\mathcal{F}_{\mathcal{N}_{j\setminus i}}}\exp(J_{kl}x_kx_l)\prod_{f_k\in\mathcal{F}_{\mathcal{N}_{j\setminus i}}}\exp(h_kx_k). \tag*{(44)} Φ N j ∖ i ( x N j ∖ i ) = f k l ∈ F N j ∖ i ∏ exp ( J k l x k x l ) f k ∈ F N j ∖ i ∏ exp ( h k x k ) . (44)
The message in (12) reduces to
q i ← j ( x j ) = ∑ x N j ∖ i ∖ j Φ N j ∖ i ( x N j ∖ i ) ∏ x k ∈ N j ∖ i ∖ j q j ← k ( x k ) . (45) q_{i\leftarrow j}(x_j)=\sum_{x_{\mathcal{N}_{j\setminus i}\setminus j}}\Phi_{\mathcal{N}_{j\setminus i}}(x_{\mathcal{N}_{j\setminus i}})\prod_{x_k\in\mathcal{N}_{j\setminus i}\setminus j}q_{j\leftarrow k}(x_k). \tag*{(45)} q i ← j ( x j ) = x N j ∖ i ∖ j ∑ Φ N j ∖ i ( x N j ∖ i ) x k ∈ N j ∖ i ∖ j ∏ q j ← k ( x k ) . (45)
and the belief in (11) reduces to
q i ( x i ) = 1 Z i ∑ x N i ∖ i Φ N i ( x N i ) ∏ x j ∈ N i ∖ i q i ← j ( x j ) . (46) q_i(x_i)=\frac{1}{Z_i}\sum_{x_{\mathcal{N}_i\setminus i}}\Phi_{\mathcal{N}_i}(x_{\mathcal{N}_i})\prod_{x_j\in\mathcal{N}_i\setminus i}q_{i\leftarrow j}(x_j). \tag*{(46)} q i ( x i ) = Z i 1 x N i ∖ i ∑ Φ N i ( x N i ) x j ∈ N i ∖ i ∏ q i ← j ( x j ) . (46)
where Φ N i \Phi_{\mathcal{N}_i} Φ N i follows (C.1) with the summation extended to F N i \mathcal{F}_{\mathcal{N}_i} F N i .
In Algorithm 2, Step 9 uses (C.2) and Step 15 uses (C.3); all other steps are unchanged.
GBP for Ising model
Since the Ising factor graph is constructed on the IEEE 14-bus topology, the region graph configurations GBP-A and GBP-B defined in Appendix B.2 are directly reused. Only the message representation changes, with Gaussian parameters being replaced by discrete distributions over { − 1 , + 1 } \{-1,+1\} { − 1 , + 1 } and Schur-complement marginalization being replaced by finite summation. The local potential over factors in region r r r but not in child s s s is
Φ r ∖ s ( x r ) = ∏ f k l ∈ F r ∖ s exp ( J k l x k x l ) ⋅ ∏ f k ∈ F r ∖ s exp ( h k x k ) . (47) \Phi_{r\setminus s}(x_r) = \prod_{f_{kl}\in\mathcal{F}_{r\setminus s}} \exp(J_{kl}x_kx_l)\cdot\prod_{f_k\in\mathcal{F}_{r\setminus s}} \exp(h_kx_k). \tag*{(47)} Φ r ∖ s ( x r ) = f k l ∈ F r ∖ s ∏ exp ( J k l x k x l ) ⋅ f k ∈ F r ∖ s ∏ exp ( h k x k ) . (47)
For the Ising model, the corresponding GBP message is computed by discrete marginalization as
m r s ( x s ) ∝ ∑ x r ∖ s Φ r ∖ s ( x r ) ∏ v ∈ D r + ∖ D s + u ∈ R ∖ D r + , u ∈ P v m u v ( x v ) , (48) m_{rs}(x_s) \propto\sum_{x_{r\setminus s}} \Phi_{r\setminus s}(x_r) \prod_{\substack{v\in D_r^+\setminus D_s^+\\u\in\mathcal{R}\setminus D_r^+,\ u\in P_v}} m_{uv}(x_v), \tag*{(48)} m r s ( x s ) ∝ x r ∖ s ∑ Φ r ∖ s ( x r ) v ∈ D r + ∖ D s + u ∈ R ∖ D r + , u ∈ P v ∏ m uv ( x v ) , (48)
where the sum runs over all 2 ∣ x r ∖ s ∣ 2^{|x_{r\setminus s}|} 2 ∣ x r ∖ s ∣ configurations of x r ∖ s x_{r\setminus s} x r ∖ s . Upon convergence, the belief of region r r r is
b r ( x r ) ∝ Φ r ( x r ) ∏ v ∈ D r + u ∈ P v ∖ D r + m u v ( x v ) , (49) b_r(x_r) \propto\Phi_r(x_r)\prod_{\substack{v\in D_r^+\\u\in P_v\setminus D_r^+}}m_{uv}(x_v), \tag*{(49)} b r ( x r ) ∝ Φ r ( x r ) v ∈ D r + u ∈ P v ∖ D r + ∏ m uv ( x v ) , (49)
where Φ r ( x r ) = ∏ f k l ∈ F r exp ( J k l x k x l ) ⋅ ∏ f k ∈ F r exp ( h k x k ) \Phi_r(x_r)=\prod_{f_{kl}\in\mathcal{F}_r}\exp(J_{kl}x_kx_l)\cdot\prod_{f_k\in\mathcal{F}_r}\exp(h_kx_k) Φ r ( x r ) = ∏ f k l ∈ F r exp ( J k l x k x l ) ⋅ ∏ f k ∈ F r exp ( h k x k ) . The marginal of variable x i x_i x i is obtained from the smallest region r ∋ x i r\ni x_i r ∋ x i by
b ( x i ) ∝ ∑ x r ∖ i b r ( x r ) . (50) b(x_i)\propto\sum_{x_{r\setminus i}}b_r(x_r). \tag*{(50)} b ( x i ) ∝ x r ∖ i ∑ b r ( x r ) . (50)
In Algorithm B.1, Step 4 uses (C.5), Step 10 uses (C.6), and Step 13 uses (C.7); all other steps are unchanged.
BP for Ising model
The message from factor node f i f_i f i to variable node x i x_i x i is
m f i → x i ( x i ) = exp ( h i x i ) . (51) m_{f_i\to x_i}(x_i)=\exp(h_ix_i). \tag*{(51)} m f i → x i ( x i ) = exp ( h i x i ) . (51)
The message from pairwise factor node f i j f_{ij} f ij to variable node x i x_i x i is
m f i j → x i ( x i ) ∝ ∑ x j ∈ { − 1 , + 1 } exp ( J i j x i x j ) m x j → f i j ( x j ) . (52) m_{f_{ij}\to x_i}(x_i)\propto\sum_{x_j\in\{-1,+1\}}\exp(J_{ij}x_ix_j)m_{x_j\to f_{ij}}(x_j). \tag*{(52)} m f ij → x i ( x i ) ∝ x j ∈ { − 1 , + 1 } ∑ exp ( J ij x i x j ) m x j → f ij ( x j ) . (52)
The message from variable node x i x_i x i to pairwise factor node f i j f_{ij} f ij is
m x i → f i j ( x i ) ∝ exp ( h i x i ) ∏ f i k ∈ N x i ∖ { f i j } m f i k → x i ( x i ) , (53) m_{x_i\to f_{ij}}(x_i)\propto\exp(h_ix_i)\prod_{f_{ik}\in\mathcal{N}_{x_i}\setminus\{f_{ij}\}}m_{f_{ik}\to x_i}(x_i), \tag*{(53)} m x i → f ij ( x i ) ∝ exp ( h i x i ) f ik ∈ N x i ∖ { f ij } ∏ m f ik → x i ( x i ) , (53)
where N x i \mathcal{N}_{x_i} N x i denotes the set of pairwise factor nodes connected to x i x_i x i . Upon convergence, the belief is
b ( x i ) ∝ exp ( h i x i ) ∏ f i j ∈ N x i m f i j → x i ( x i ) . (54) b(x_i)\propto\exp(h_ix_i)\prod_{f_{ij}\in\mathcal{N}_{x_i}}m_{f_{ij}\to x_i}(x_i). \tag*{(54)} b ( x i ) ∝ exp ( h i x i ) f ij ∈ N x i ∏ m f ij → x i ( x i ) . (54)
In Algorithm B.3, Step 5 uses (C.9), Step 8 uses (C.10), and Step 13 uses (C.11); all other steps are unchanged.
Full sGaBP-m Results over the Tested ( λ , α ) (\lambda,\alpha) ( λ , α ) Configurations
This section reports the complete sGaBP-m results over all tested configurations of λ \lambda λ and α \alpha α . In the main text, for each IEEE test system, only the best-performing configuration is shown as the horizontal baseline, selected by minimizing the AKLD over the tested configurations. The full results are provided here to illustrate the sensitivity of sGaBP-m to these two parameters.
The tested values of α \alpha α are shown on the horizontal axes of Figs. D.1 and D.2, with different curves corresponding to different values of λ \lambda λ . Under the tested configurations, the AKLD, RMSEμ _\mu μ , and RMSEσ 2 _{\sigma^2} σ 2 of sGaBP-m vary substantially across the ( λ , α ) (\lambda,\alpha) ( λ , α ) configurations. Across all four test systems, lower AKLD values are generally obtained only at the smallest tested α \alpha α , while larger values of α \alpha α combined with many choices of λ \lambda λ lead to AKLD values that reach the prescribed cap of 10 10 10^{10} 1 0 10 . Moreover, when a configuration reaches the prescribed cap, it does so across all N M C = 50 N_{\mathrm{MC}}=50 N MC = 50 trials, indicating systematic rather than occasional failure. For a given α \alpha α , a larger λ \lambda λ can alleviate non-convergence; however, when sGaBP-m already converges, a larger λ \lambda λ increases the AKLD. The non-convergence observed under many configurations is consistent with the weak diagonal dominance of the precision matrix in the tested IEEE systems, which requires a sufficiently large λ \lambda λ for sGaBP-m to converge. The elevated AKLD values are primarily attributable to inaccurate mean estimates, as RMSEμ _\mu μ is generally larger than RMSEσ 2 _{\sigma^2} σ 2 under the tested configurations; moreover, a configuration with low RMSEμ _\mu μ does not necessarily yield low RMSEσ 2 _{\sigma^2} σ 2 , and many configurations reach the prescribed RMSE cap of 10 5 10^5 1 0 5 , particularly on the larger test systems.
Overall, under the tested configurations, the accuracy of sGaBP-m depends strongly on the selected ( λ , α ) (\lambda,\alpha) ( λ , α ) configuration. On the IEEE 14-bus system, sGaBP-m can achieve accurate estimates under carefully chosen configurations, but its performance becomes increasingly sensitive to ( λ , α ) (\lambda,\alpha) ( λ , α ) on larger systems, with many configurations reaching the prescribed AKLD or RMSE caps. The sGaBP-m baseline reported in the main text therefore represents the best-performing configuration over the tested configurations rather than a consistently achievable level of accuracy.
Figure D.1. Full AKLD results of sGaBP-m over the tested ( λ , α ) (\lambda,\alpha) ( λ , α ) configurations on the IEEE 14-, 118-, 300-, and 1354-bus systems. The horizontal axis denotes α \alpha α , and different curves correspond to different values of λ \lambda λ . The dashed horizontal line indicates the prescribed AKLD cap of 10 10 10^{10} 1 0 10 .
Figure D.2. Full R M S E μ \mathrm{RMSE}_{\mu} RMSE μ and R M S E σ 2 \mathrm{RMSE}_{\sigma^2} RMSE σ 2 results of sGaBP-m over the tested ( λ , α ) (\lambda,\alpha) ( λ , α ) configurations on the IEEE 14-, 118-, 300-, and 1354-bus systems. The labels “M” and “V” denote R M S E μ \mathrm{RMSE}_{\mu} RMSE μ and R M S E σ 2 \mathrm{RMSE}_{\sigma^2} RMSE σ 2 , respectively. The dashed horizontal line indicates the prescribed RMSE cap of 10 5 10^5 1 0 5 .
Maximum Sizes of Extended and Residual Neighborhoods
Fig. E.1 shows the maximum sizes of the extended neighborhood ∣ x N i ∣ \lvert x_{\mathcal{N}_i}\rvert ∣ x N i ∣ and the residual neighborhood ∣ x N j \ i ∣ \lvert x_{\mathcal{N}_j\backslash i}\rvert ∣ x N j \ i ∣ as a function of r r r for each tested IEEE system. For all systems, both sizes increase with r r r and eventually saturate, since each neighborhood is bounded by the finite factor graph and stops growing once it has absorbed all reachable loop-induced nodes. The extended neighborhood
Figure E.1. The maximum sizes of ∣ x N i ∣ \lvert x_{\mathcal{N}_i}\rvert ∣ x N i ∣ (extended neighborhood) and ∣ x N j \ i ∣ \lvert x_{\mathcal{N}_j\backslash i}\rvert ∣ x N j \ i ∣ (residual neighborhood) as a function of r r r for the IEEE 14-bus, IEEE 118-bus, IEEE 300-bus, and IEEE 1354-bus systems.
sizes are consistently larger than the residual neighborhood sizes across all systems and values of r r r . The larger IEEE systems (IEEE 300-bus and IEEE 1354-bus) exhibit substantially larger neighborhood sizes than the smaller systems (IEEE 14-bus and IEEE 118-bus).