## 3 Message Passing for JP-CoMP Clustering
### Problem Formulation
The first holds that exactly one neighboring BS around the \(j\)th BS should select the \(j\)th BS as an exemplar when equality holds. The second requires that other neighboring BS do not select the \(j\)th BS as an exemplar when inequality holds. Constraint (10) explains that, if there exists the \(i\)th BS, as an exemplar, has selected the \(k\)th BS as its super-exemplar, i.e., \(C_{ii}=k\), then the \(k\)th BS should be a super-exemplar for itself. The notation \(\theta(i)\) is defined as the set of neighboring exemplars adjacent to the \(i\)th BS as an exemplar. To apply a message passing algorithm in this multi-layer cell clustering scheme, problem (7) has been reformulated as an unconstrained problem. This reformulation is expressed as  
\[\max\sum_{i}\sum_{j}\ S_{ij}\left(C_{ij}\right)+\sum_{i}F_{i}\left(X_{i}\right) +\sum_{j}H_{j}\left(X_{j}\right)+\sum_{k}G_{k}\left(X_{k}\right), \tag{11}\]  
where \(S_{ij}\left(C_{ij}\right)\) denotes the mixed-form objective function. Three different functions that consider the constraint in (8)-(10) are expressed, as  
\[F_{i}\left(X_{i}\right) = \begin{cases}-\infty,&\text{if }\sum_{j=1}^{N}\left[C_{ij}\
eq 0 \right]\
eq 1\\ 0,&\text{otherwise}\end{cases} , \tag{12}\] \[H_{j}\left(X_{j}\right) = \begin{cases}-\infty,&\text{if }\sum_{i=1}^{N}C_{ij}>\left[C_{jj} =j\right]\\ 0,&\text{otherwise}\end{cases} ,\] (13) \[G_{k}\left(X_{k}\right) = \begin{cases}-\infty,&\text{if }C_{kk}\
eq k\text{, but }\exists i:C_{ii}=k\\ 0,&\text{otherwise}\end{cases} , \tag{14}\]  
where \(X_{i}=\left\{C_{ij}:j\in\phi\left(i\right)\right\}\), \(X_{j}=\left\{C_{ij}:i\in\phi\left(j\right)\right\}\), and \(X_{k}=\left\{C_{kk}:k\in\theta\left(i\right)\right\}\) are defined as representation cases. \(F_{i}\left(X_{i}\right)\) is introduced as an association function of the constraint (8) to represent that each base station should be assigned to one base station. If each user is assigned to more than one base station, \(F_{i}\left(X_{i}\right)\) takes the value of minus infinity and the maximization of objective function cannot be achieved. Otherwise, the value of \(F_{i}\left(X_{i}\right)\) becomes zero and it will not contribute to the objective function. \(H_{j}\left(X_{j}\right)\) is defined to represent the constraint (9), which implies cluster consistency. In this case, each base station only selects at most one base station as its partner in the cluster. The violation the objective function will not be maximized. Otherwise, \(G_{k}\left(X_{k}\right)\) will take the value of zero and it will not contribute to the objective function. The unconstrained formulation problem (11) enables the drawing of a factor graph. A factor graph is a useful graphic representation that shows the relationship between each of the variables with constraints that serve as boundaries in the distributed optimization problem. Figure 2 shows the representation of the factor graph in the proposed algorithm. The factor graph shows that there are two variables: non-diagonal variables \(\left(C_{ij}\right)\) and diagonal variables \(\left(C_{ii}\right)\). The non-diagonal variable will be constrained by the two function of \(F_{i}\) and \(H_{j}\). Moreover, the diagonal variable will be constrained by three different functions of \(F_{i}\), \(G_{k}\), and \(H_{j}\). A detailed explanation will be provided in the next subsection.