## 3 Message Passing for JP-CoMP Clustering
### Message Passing Derivation  
Separation consideration will be implemented in order to derive the message. The message derivation process will be divided into the diagonal variable and the non-diagonal variable. The messages associated with each variable are presented in Figure 3.  
Figure 2: Factor graph of the proposed algorithm. The non-diagonal element \(C_{ij}\) will be constrained by two function nodes, \(F_{i}\) and \(H_{j}\). The relationship between the variable node and the function node for the non-diagonal variable is represented by the messages \(\lambda_{ij}\), \(\mu_{ij}\), \(\beta_{ij}\), and \(\eta_{ij}\). Accordingly, based on the message passing principle [28], each message of the non-diagonal variable can be represented as  
\[\lambda_{ij}\left(m\right)=S_{ij}+\eta_{ij}\left(m\right), \tag{15}\]  
\[\mu_{ij}\left(m\right)=\max_{C_{1j},\ldots,C_{Nj}}\left[H_{j}\left(C_{1j}, \ldots,C_{Nj}\right)+\sum_{i^{\prime}\
eq i}\max_{C_{ij^{\prime}}}\lambda_{i^{ \prime}j}\left(C_{i^{\prime}j}\right)\right], \tag{16}\]  
\[\beta_{ij}\left(m\right)=S_{ij}+\mu_{ij}\left(m\right), \tag{17}\]  
\[\eta_{ij}\left(m\right)=\max_{C_{i1},\ldots,C_{iN}}\left[F_{i}\left(C_{i1}, \ldots,C_{iN}\right)+\sum_{i^{\prime}\
eq i}\max_{C_{ij^{\prime}}}\beta_{ij^{ \prime}}\left(C_{ij^{\prime}}\right)\right]. \tag{18}\]  
The message values \(\lambda_{ij}\) \(\left(m\right)\), \(\mu_{ij}\left(m\right)\), \(\beta_{ij}\) \(\left(m\right)\), and \(\eta_{ij}\left(m\right)\) are determined for setting the hidden variable \(C_{ij}\) to \(m\ \in\{0,1\}\). The final messages are defined according to the message difference between \(m=1\) and \(m=0\). The final message from the variable node to the function node is the sum of all incoming messages from \(C_{ij}\), except for the message from the own function. The messages \(\widetilde{\lambda}_{ij}\) and \(\widetilde{\beta}_{ij}\) can be expressed as  
\[\widetilde{\lambda}_{ij}\ =\lambda_{ij}\left(1\right)-\lambda_{ij}\left(0\right)=s_{ij}+ \eta_{ij}\left(1\right)-\eta_{ij}\left(0\right)=s_{ij}+\widetilde{\eta}_{ij}, \tag{19}\]  
\[\widetilde{\beta}_{ij}=\beta_{ij}\left(1\right)-\beta_{ij}\left(0\right)=s_{ ij}+\mu_{ij}\left(1\right)-\mu_{ij}\left(0\right)=s_{ij}+\widetilde{\eta}_{ij}. \tag{20}\]  
Figure 3: Message passing of each variable. The figure on the left shows the non-diagonal variable and that on the right shows the diagonal variable. The message from \(H_{j}\) to \(C_{ij}\) is defined as the difference between message \(\mu_{ij}\left(1\right)\), which indicates when the \(i\)th BS selects the \(j\)th BS, and message \(\mu_{ij}\left(0\right)\), which indicates when none of the neighboring BS around the \(j\)th BS select the \(j\)th BS as an exemplar. Therefore, message \(\widetilde{\mu}_{ij}\) can be defined as  
\[\widetilde{\mu}_{ij}=\mu_{ij}\left(1\right)-\mu_{ij}\left(0\right) =\left[\max_{C_{ij}}\left(\lambda_{jj}\left(C_{jj}\right)+\sum_{ i^{\prime}\
otin\left\{i,j\right\}}\max_{C_{ij}}\lambda_{i^{\prime}j}\left(C_{ ij}\right)\right)\right]-\] Figure 2:0 Figure 2:1  
The message from \(F_{i}\) to \(C_{ij}\) is defined as the difference between message \(\eta_{ij}\left(1\right)\) and message \(\eta_{ij}\left(0\right)\). Message \(\eta_{ij}\left(1\right)\) indicates when the \(i\)th BS selects the \(j\)th BS, after which the \(i\)th BS cannot select another BS besides the \(j\)th BS (\(C_{ij^{\prime}}=0\)). Message \(\eta_{ij}\left(0\right)\) indicates when none of the neighboring BSs around the \(j\)th BS selects the \(j\)th BS as exemplar. Hence, there are two possible cases: the \(i\)th BS selects another BS besides the \(j\)th BS (\(C_{ij^{\prime\prime}}=0\)) or the \(i\)th BS becomes an exemplar itself (\(C_{ij^{\prime}}=0\)). Therefore, message \(\widetilde{\eta}_{ij}\) can be defined as  
Figure 2:2 Figure 2:3 Figure 2:4  
The diagonal element \(C_{ii}\) will be constrained by the three function nodes of \(F_{i}\), \(H_{j}\), and \(G_{k}\).