# Detection of Transmission State of Multiple Wireless Sources: A Statistical Mechanics Approach
## 3 The Belief Propagation Algorithm  
In this section, we provide a detailed description of the belief propagation method that minimizes the cost function in (9). Belief propagation is a widely used inference algorithm that has been proven to be exact on tree structures, but it is also a powerful heuristic on loopy graphical models. The algorithm is based on iteratively exchanging messages between nodes about the estimated probability of the values of a given variable (\(s_{\mu}\)). For any two connected nodes on the graph, say \(i\) and \(\mu\), there are two messages exchanged, \(m_{\mu\to i}(s_{\mu})\) and \(\widehat{m}_{i\to\mu}(s_{\mu})\), which depend on information on the two distinct sides of the link and the value of the dynamical variable at \(\mu\), \(s_{\mu}\). From the structure of the graph, we can see that the update rules of the incoming messages to the SU \(y_{i}\) and source \(s_{\mu}\), respectively, can be written as  
\[m_{\mu\to i}(s_{\mu})\propto\prod_{j\in\mathcal{N}(i)\backslash i}\widehat{m}_ {j\to\mu}\big{(}s_{\mu}\big{)} \tag{12}\]and  
\[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]  
where we have defined \(f_{i}(s_{\mathcal{N}(i)})=\exp[-\beta\varepsilon_{i}]\). We note that the messages can be expressed by their log-likelihood ratios (which are also called \"local cavity fields\", a term obtained from the analogy to statistical physics) as,  
\[\widehat{h}_{i\to\mu}\equiv\frac{1}{2\beta}\ \ln\left(\frac{\widehat{m}_{i\to\mu}(s_{\mu}=+1)}{ \widehat{m}_{i\to\mu}(s_{\mu}=-1)}\right) \tag{14}\]  
so that  
\[\widehat{m}_{i\to\mu}(s_{\mu})=\frac{1}{2}\Big{(}1+s_{\mu}\tanh\Bigl{(}\beta \widehat{h}_{i\to\mu}\Bigr{)}\Big{)} \tag{15}\]  
and, respectively,  
\[m_{\mu\to i}(s_{\mu})=\frac{1}{2}\big{(}1+s_{\mu}\tanh\bigl{(}\beta h_{\mu\to i }\bigr{)}\big{)} \tag{16}\]  
The above Equation (16) can be reformulated to include the fields \(\widehat{h}\) and \(h\) as follows  
\[h_{\mu\to i}=\sum_{j\in\mathcal{N}(\mu)\setminus i}\widehat{h}_{j\to\mu} \tag{17}\]  
Additionally, the corresponding equation for \(\widehat{m}_{i\to\mu}\) is  
\[\widehat{m}_{i\to\mu}(s_{\mu})=\frac{1}{\mathcal{Z}^{i\to\mu}}\sum_{s_{v\in \mathcal{N}(i)\setminus i}}f_{i}(s_{\mathcal{N}(i)})\prod_{v\in\mathcal{N}(i )\setminus\mu}m_{v\to i}(s_{v}) \tag{18}\]  
where  
\[f_{i}(s_{\mathcal{N}(i)})=\exp\left[-\beta\left(\eta_{i}+\sum_{v\in\mathcal{ N}(i)}\mathrm{G}_{iv}\Bigl{(}s_{v}^{0}-s_{v}\Bigr{)}\right)^{2}\right] \tag{19}\]  
After some calculations, it can be easily shown that  
\[\widehat{m}_{i\to\mu}(s_{\mu})=\frac{1}{2}\big{(}1+s_{\mu}\epsilon_{\beta} \big{)} \tag{20}\]  
where  
\[\epsilon_{\beta}=\frac{\vartheta_{\beta}}{\varphi_{\beta}} \tag{21}\]  
with  
\[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]0  
and  
\[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]1These equations, being local, can also be evaluated straightforwardly as part of the message-passing algorithm's updates. Nevertheless, we would like to obtain the \(\beta\to\infty\) limit, where the corresponding equation for \(\widehat{h}_{i\to\mu}\) (calculated in our previous work in [23]) is  
\[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]2  
where  
\[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]3 \[\widehat{m}_{i\to\mu}(s_{\mu})\propto\sum_{s_{\mu}}f_{i}(s_{\mathcal{N}(i)})\prod_ {v\in\mathcal{N}(i)\setminus\mu}m_{v\to i}(s_{v}) \tag{13}\]4 (26) \[\xi^{-} =\min_{ \begin{subarray}{c}s_{v}\in\mathcal{N}(i)\setminus\mu\\ s_{\mu}=-\sigma_{\mu}\end{subarray}