## 3 Message Passing for JP-CoMP Clustering
### Message Passing Derivation
 \tag{33}\]  
The messages from \(G_{k}\) to \(C_{ii}\) are considered according to the values \(i\) and \(k\). If \(i=k\), the message is defined as the difference between two cases. The first case is when the \(k\)th BS has been chosen as a super-exemplar, with other BSs beside the \(i\)th BS then not constrained. The second case is when the \(k\)th BS is not a super-exemplar. This message can be expressed as  
\[ \begin{split}\widetilde{\xi}_{ik}\left(k\right)=\xi_{ik}\left(m \right)-\xi_{ik}\left(0\right)&=\sum_{i^{\prime}\
eq i}\max_{C_{i^ {\prime}i}}v_{i^{\prime}k}\left(C_{i^{\prime}i^{\prime}}\right)\ -\sum_{i^{\prime}\
eq i}\max_{C_{i^{\prime}i}\
eq k}v_{i^{\prime}k}\left(C_{i ^{\prime}i^{\prime}}\right)\\ &=\sum_{i^{\prime}\
eq i}\max\left(0,\widetilde{v}_{i^{\prime}k} \left(k\right)\right).\end{split}  \tag{34}\]  
If \(i\
eq k\), then the message is defined as the difference between two cases. The first case is when the \(i\)th BS has chosen the \(k\)th BS as a super-exemplar; the \(k\)th BS is a super-exemplar for itself and other BSs beside the \(i\)th BS are then not constrained. The second case is when the \(k\)th BS is not constrained as a super-exemplar. This message can be expressed as  
\[ \begin{split}\widetilde{\xi}_{ik}\left(k\right)&= \xi_{ik}\left(m\right)-\xi_{ik}\left(0\right)\\ &=v_{kk}\left(k\right)+\sum_{i^{\prime}\
otin\left\{i,k\right\}} \max_{C_{i^{\prime}i^{\prime}}}v_{i^{\prime}k}\left(C_{i^{\prime}i^{\prime}} \right)\\ &\quad-\max\left[\max_{C_{ik}\
eq k}v_{kk}\left(C_{kk}\right)+ \sum_{i^{\prime}\
otin j,k}\max_{C_{i^{\prime}i^{\prime}}\
eq k}v_{i^{\prime}k }\left(C_{i^{\prime}i^{\prime}}\right),v_{kk}\left(k\right)+\sum_{i^{\prime} \
otin j,k}\max_{C_{i^{\prime}i^{\prime}}}v_{i^{\prime}k}\left(C_{i^{\prime}i ^{\prime}}\right)\right]\\ &=\min\left[0,\widetilde{v}_{kk}+\sum_{i^{\prime}\
otin\left\{i, k\right\}}\max(0,\widetilde{v}_{i^{\prime},k}(k))\right].\end{split}  \tag{35}\]  
Multi-layer clustering message passing yields the final messages indicated here by (19)- (22) and (29)-(35). Each of the final messages will contribute to the assignment. To provide the assignment of all messages, this step should sum all of the incoming messages to each of the corresponding datapoints, i.e., \(C_{ij}\) and \(C_{ii}\). The assignment for these final messages can be expressed as  
\[ \begin{split} C_{ij}&=\arg\max_{C_{ij}\in\left\{ 0,1\right\}}\left[s_{ij}\left(C_{ij}\right)+\mu_{ij}\left(C_{ij}\right)+\eta_{ ij}\left(C_{ij}\right)\right]\\ &=\arg\max_{C_{ij}\in\left\{0,1\right\}}\left[\widetilde{\lambda} _{ij}+\widetilde{u}_{ij},0\right].\end{split}  \tag{36}\]  
\[ \begin{split} C_{ii}&=\arg\max_{C_{ii}\in\left\{ 0,\ldots,N\right\}}\left[s_{ii}\left(C_{ii}\right)+\mu_{ii}\left(C_{ii}\right) +\eta_{ii}\left(C_{ii}\right)+\sum_{k=1}^{N}\xi_{ik}\left(C_{ii}\right)\right] \\ &=\arg\max_{C_{ii}\in\left\{0,\ldots,N\right\}}\left[0,\max_{m=1,\ldots,N}\left[\widetilde{u}_{ii}+\widetilde{\lambda}_{i}^{m}\right]\right]. \end{split}  \tag{37}\]  
The assignment messages will determine the appropriate cell partner for JP-CoMP. Based on the assignment result, the proposed algorithm is concluded, as shown in Algorithm 1. ```
Set \(t\gets 1\) and \(\widetilde{\lambda}_{ij}^{\left(t\right)}=0\), \(\widetilde{\lambda}_{i}^{m\left(t\right)}=0\). Repeat  Base Stations  Update \(\widetilde{u}_{ij}^{\left(t\right)}\) and send to neighboring BSs. Update \(\widetilde{\lambda}_{ij}^{\left(t+1\right)}\) and send to neighboring BSs. Update \(\widetilde{u}_{ii}^{\left(t\right)}\) and send to neighboring BSs. Update \(\widetilde{\lambda}_{i}^{m\left(t+1\right)}\) and send to neighboring BSs. \(t=t+1\) Until all messages have been converged or max iteration reached. Compute \(C_{ij}^{\left(t\right)}\) and \(C_{ii}^{\left(t\right)}\) to determine the cooperating base station. If \(C_{ij}^{\left(t\right)}=1\) and \(C_{ii}^{\left(t\right)}=k\), the \(i\)th BS, the \(j\)th BS, and the \(k\)th BS are cooperating base stations.