# Hybrid MU-MIMO Precoding Based on K-Means User Clustering
## 4 User Grouping  
One of the objectives of MU-MIMO technology is to send independent data streams to different users. This implies that only a subset of the transmitted data symbols is useful for each co-scheduled user. In the MU-MIMO context, the user grouping is the task of forming a subset of users, according to a spatial compatibility metric. It can be shown that there is a correspondence between the precoding performance and the user grouping technique [9]. The scheduling of spatially-compatible users is crucial to suppress inter-user interference, whereas refining the power allocation and precoding weights requires less computational effort. Most of the scheduling algorithms in the literature focus on constructing sets of users with orthogonal or semi-orthogonal MIMO channels [20]; however, the optimal solution for the user  
Figure 5: Channel separation as a function of the angle between user \(k\) and \(i\), for \(\delta\) following a Gaussian distribution. grouping involves an extensive search of all possible combinations. The complexity of the approach grows exponentially with the number of users and is not feasible for a moderate number of users. Scheduling algorithms based on spatial clustering can improve the overall MU-MIMO performance by adjusting the parameter \(\epsilon\) defined in Section 3.1, according to the number of users and the Signal-to-Noise Ratio (SNR). However, the optimum value is a deployment parameter and depends on the number of transmit antennas, the number of users, the precoder type, and is usually calculated through simulations. Based on the above observations, in this section we propose a user grouping algorithm, whose aim is to cluster users that have similar directions in Euclidean space. Therefore, their channels exhibit a spatial correlation higher than \(\epsilon\) and, consequently, cannot be co-scheduled in MU-MIMO through linear precoding schemes, as they may significantly interfere with each other. To optimize the performance of the spatial clustering, K-means clustering algorithm [21] with a distance metric based on angles between users, is proposed. The algorithm groups the users into \(N\) clusters, such that each user belongs to the cluster whose center is the closest (forms the smallest angle from the serving sector perspective), as described in Algorithm 1. ```
1:for\(N=1\)to\(K\)do
2:repeat
3: Create \(N\) random cluster centers, \(c_{n}(i)\)
4: Compute \(K\times N\) angles for each user to each cluster center
5: Assign each user \(k\) to the closest cluster \(n\)
6:\(n=\arg\min_{n\in N}\left(\angle\left(k,c_{n}(i)\right)\right)\)
7: Recompute the centers of the clusters
8:\(c_{n}(i+1)=Mean_{k\in n}\left(\angle\left(k,c_{n}(i)\right)\right)\)
9: Stop when the centers do not vary by more than \(err\) percent
10:until\(\max_{n\in N}\left(c_{n}(i)-c_{n}(i-1)\right)\leq err\)
11: Find the maximum angle between any two users of the same cluster
12:\(angle_{max}=\max_{n\in N}\left(\max_{k_{i}\in n,k_{j}\in n}\left(\angle\left( k_{i},k_{j}\right)\right)\right)\)
13: Stop when the users are close enough
14:if\(angle_{max}\leq\Delta\theta\)then
15:return\(N\), cluster assignments
16:endif
17:endfor
```  
**Algorithm 1** K-means clustering. Although this approach guarantees that users of the same cluster cannot be co-scheduled through linear precoders, it does not provide any information on the channel separation between users of different clusters. To decide whether users from different clusters can be co-scheduled, one can use the angles between the centers of clusters, instead of the angles for the entire set of users. The set of co-scheduled clusters should not include any cluster that has an angle smaller than \(\Delta\theta\), and its size should be less than or equal to the number of transmit antennas. The method of finding the optimum sets of co-scheduled clusters is another optimization problem and is not the purpose of this article.