A Novel User Grouping Algorithm for Downlink NOMA

Non-orthogonal multiple access (NOMA) is one of the promising radio access techniques for resource allocation improvement in the (5th) generation of cellular networks. Compared to orthogonal multiple access techniques, NOMA offers extra benefits, including greater spectrum efficiency which is provided through multiplexing users in the transmission power domain while using the same spectrum resources non-orthogonally. Even though NOMA uses Successive Interference Cancellation to repeal the interference among users, user grouping has shown to have a substantial impact on its performance. This performance improvement can appear in different parameters such as system capacity, data rate, or power consumption. In this paper, we propose a novel user grouping scheme for sum-rate maximization which increases the sum rate by approximately 12–25% in comparison with random user grouping and two other authenticated recent works. In addition to being matrix-based and having a polynomial time complexity, the proposed method is also able to cope with users experiencing different channel gains and powers in different sub-bands. Moreover, the proposed scheme is scalable and can be used for any number of users and sub-bands.

pairing schemes have been proposed. These resource allocation schemes can switch to orthogonal signaling if the proposed iterative algorithm decides so.
Putting user pairing aside, other related researches study different user grouping strategies and try to make its performance even better by following different goals including minimizing the power consumption [27][28][29], decreasing the outage probability [30], and bit error rate [1]. There are a few user grouping works that try to maximize the sum rate or system capacity. Research [1] proposes a multiple-input multiple-output (MIMO) NOMA with user patterning. The proposed scheme is a non-convex optimization problem that is relaxed by a moderate convex approximation algorithm and then has been improved by a matching theory technique. The results show that the proposed MIMO-NOMA system's performance is better than cooperative NOMA and OMA. In [31] a machine learning algorithm has been used in mm-Wave NOMA. The result tends to have a better sum rate than the exhaustive search and the matching algorithms. In [8], a low-complex sub-optimal user grouping algorithm has been proposed which uses the differences between channel gains among users to improve sum-throughput. Research [32] believes that users with the strongest and weakest channel gains should not be grouped and proposes an optimal algorithm that is not practical due to computational complexity for a big number of users. But the sub-optimal algorithm increases the sum rate in comparison with the random user grouping algorithm.
Giving consideration to the importance of user grouping for NOMA spectral efficiency in addition to the small number of existing research works on rate maximization and spectral efficiency enhancement, the need for researches with new ideas is clear. In this paper, we propose a novel matrix-based user grouping algorithm with polynomial time complexity. In addition to being optimal and practical, the proposed algorithm takes different user gains and user powers in different sub-bands into account. Moreover, the proposed algorithm is scalable to any number of users and sub-bands. In order to do that, in Sect. 2 the System Model and Problem Formulation are presented. Section 3 introduces the new Optimal User Grouping Algorithm. In Sect. 4 Numerical Results, Performance Comparison, and Computational Complexity are provided, and finally, Sect. 5 presents the Conclusion.

System Model
Having Shannon Theory in mind, consider a downlink, one-cell network in which there is a base station with just one antenna supporting n users. The base station sends the data to all the users simultaneously and has limited power. In this network, signals experience Additive White Gaussian Noise (AWGN) with zero mean and variance 2 n . If h i denotes the (ith) user's channel gain, it is assumed that it is sorted in ascending order as h 1 ≥ h 2 ≥ ⋯ ≥ h n , so that the first user always uses the strongest channel. In a NOMA channel, sending data to all users in that channel at the same time by using the whole bandwidth is manageable through performing Superposition Coding (SC) at the sender side and Successive Interference Cancellation (SIC) at the receiver side. In fact, the base station sends a linear superposed code of n usersâ€™ data by allocating a fraction of the total power to each user e.g. allocates P i to U i . At the receiver side, user U i decodes the data from all the weaker users i.e. U m such that m < i . Then these signals are subtracted from the received signal and while considering stronger signals ( U m such that m > i) as interference, U i is decoded. The signal received by U i is given by: √ P i S i is the superposed signal transmitted from the base-station, with S i being the signal for user U i , h i is the channel gain, and w i shows the AWGN for the user i.

Problem Formulation
If Superposition Coding at the sender side and Successive Interference Cancellation at the receiver side are conducted correctly, the data rate is equal to: is the normalized channel gain, and B is the channel bandwidth. Thus, to improve the sum data rate we need to follow: while considering the total transmission power constraint as below: This means that we have a mixed-integer nonlinear programming problem.

New Optimal User Grouping Algorithm
Since the user grouping problem in this research work can be defined as assigning each user to only one sub-band to maximize the total sum rate taking into account the total power constraint, it can be considered as an assignment problem that is a non-linear unbalanced combinational optimization. In [33] Hungarian algorithm has been considered as an optimal solution for the assignment problem. Then, in [34] the Alternate algorithm has been driven from the Hungarian algorithm for solving resource allocation problems. Both Hungarian and Alternate algorithms try to minimize the cost of assignments, but the Alternate algorithm reaches the optimal solution in fewer steps and thus is less complex.
The proposed scheme in this article customizes the Alternate algorithm to find an optimal solution for our specific user grouping problem. In order to do that, some changes and decisions have to be made. First of all, the minimizing method should be changed to the maximizing solution. After that, some mechanisms are needed for situations that there is more than one choice. The first situation is when one user experiences the same channel gain in more than one sub-band and the difference between the first choice and the (1) second choice in sub-bands is equal, too. In this case, the sub-band in which the user has a smaller transmission power should be chosen. The second situation is when the number of remained users is smaller than the number of sub-bands. To choose the proper sub-band for each remained user, all the sub-bands that can accept that user should be listed according to its transmission power, and the sub-band which provides the greater channel gain should be chosen. In the process of assigning a user to a sub-band, if the chosen sub-band is not capable of accepting the user (concerning the sub-band power), the next user should be considered.There is no need to mention that the channel gain matrix does not have to be square.
With the above mentioned in mind, the steps of the proposed scheme are as below: • Create the matrix of users' channel gains, in which users are placed in rows and subbands are placed in columns (the ij th entry shows the i th user's channel gain in j th subband). • While the number of users is bigger than the number of sub-bands: ◻ for the number of sub-bands: * Find the maximum entry in each row. Create a table of rows and columns of maximum entries (users and the sub-band in which they have the maximum gain).
If for more than one user, one sub-band was chosen, find the second maximum entry in those rows. Calculate the difference between the first and the second maximum entry. Choose the biggest difference. Note: If gain differences were equal, choose the user with the smaller power. Note: If chosen user's power was bigger than chosen sub-band's power, consider the next option. * Subtract the chosen user's power from the chosen sub-band's power. * Delete chosen entry's row and column from the matrix.
◻ Recreate the matrix but without deleted rows.
• If the number of users is smaller than the number of sub-bands: ◻ For each user list the sub-bands with bigger powers. ◻ Choose the sub-band in which the user has the biggest gain.
• If there are users left ungrouped, user grouping is not possible.

Numerical Results
In this section, simulation results are presented. The result section consists of testing the scalability of the algorithm, its effects on NOMA performance in comparison with OMA, comparing the algorithm with two lately proposed algorithms, and random user grouping in terms of some system-level performance indicators such as sum-rate, spectral efficiency, and system capacity improvements. These results have been generated by MATLAB. In these simulations, Carrier Frequency is 20 MHz and the system Bandwidth is 180 kHz.
Regarding the antenna, its height is 30 m and its gain is 60 dB. The total transmit power of the base station is 800 mW and the noise figure is 7 dB. Considering the users, K users (K varies in each part of the result section) are distributed uniformly in a 1000 m radius cell. The maximum path loss difference among users does not exceed 10 dB. Since this algorithm can handle different user gains and user powers in different sub-bands, these parameters in addition to the proportion of each sub-band from total power and bandwidth will vary. Perfect knowledge of channel state information (i.e. channel gains and powers) by the base station is assumed.
In the first part, the scalability of the proposed algorithm has been shown. With regard to the method that the algorithm uses and its computational expenses, there are no limits in choosing the number of sub-bands and users. In the other words, if the total transmission power of all the sub-bands is greater than the needed transmission power of all the users, they will be successfully grouped in an optimal way. Otherwise, some users will remain ungrouped. With that in mind, the sum of user's powers is always smaller than the system's total transmission power in these simulations. In order to show how flexible the algorithm is, 200 users will be grouped in two different scenarios. The difference between them is the number of sub-bands. Figure 1 shows how the algorithm divides users into 13 sub-bands and Fig. 2  In the second part, NOMA has been compared to OMA. This comparison also includes the proposed user grouping algorithm and shows how an optimal user grouping affects NOMA performance. This has been shown in two scenarios which are crowded (200 users) and uncrowded (50 users) areas. In each scenario, users are divided into a different number of sub-bands. Simulation results in this part show that NOMA cannot outperform OMA if it is performed on all the users jointly due to interferences and confirm that an optimal user grouping can improve NOMA performance greatly. As Figs. 5 and 6 show, this improvement is more outstanding when there are fewer users in each group, but even in scenarios with more crowded sub-bands, since the best options have been chosen for each sub-band, the results are remarkable.
In the third part, the previous comparison has been repeated, but with the purpose of showing how deeply a noisy environment can affect a NOMA system with the proposed user grouping algorithm. In order to do that, the noise figure will vary from 3 to 9 and the changes in the sum rate will be monitored. As was expected, when it comes to noise and interference control, OMA is superior to NOMA.       Fig. 10 Algorithm performance compared with OMA in noisy sparse area (50 users) in 10 sub-bands NOMA system with user grouping; but since the user grouping improves total sum-rate massively, it can handle a noisy environment, too. Moreover, according to Fig. 8, when the system is capable of providing more sub-bands, the performance of the proposed algorithm improves greatly. On the other hand, Fig. 10 shows that in sparse areas with fewer subbands, OMA can perform closer to NOMA with the proposed algorithm.

Performance Comparisons
In the first three parts, the functionality of the algorithm in different scenarios was showed.
In the next three parts of this section, the proposed algorithm will be compared to random user grouping and two other recently proposed algorithms with the same purpose and constraints. The algorithm in [8] tries to put users with the most difference in channel gains in the same group. On the other side, the sub-optimal algorithm in [32] tries to compare each user of each group to all other users (the number of comparisons has limitations) and if there could be a better result, switches them. In the first part, the proposed algorithm has been compared to random user grouping, algorithm [8], and algorithm [32] in terms of users' data rate and sum data rate. Figure 11 shows 200 users' data rates that are clustered in 50 sub-bands. This figure shows that users experience better data rates with the proposed algorithm while the minimum required rate is held correctly. Since it is more convenient to show and compare algorithms' performances, the sum-rate comparison will be used for the rest of this part. Figure 12 compares four algorithms with 200 users and some different number of sub-bands. Figure 13 shows   the same in a system with 50 users. Results show that the proposed algorithm provides a better sum-rate, too.
In the second part, the previous algorithms have been compared with the same parameters, but with regard to spectral efficiency. It was shown in many research works that NOMA provides greater spectral efficiency than OMA. This superiority depends on the user grouping scheme which is used in the NOMA system. Figures 14 and 15 confirm that the proposed algorithm can improve the spectral efficiency better than the other three.
In the last part, system capacity improvements made by the proposed algorithm and algorithms [8] and [32] have been shown. Numerical results in Figs. 16 and 17 Confirm that user grouping increases system capacity and the proposed algorithm performance with regard to capacity enhancement is better than another two algorithms in both crowded and sparse areas.

Computational Complexity
The computational complexity of an algorithm is very important to its practicality. In this section, proves of the proposed algorithm having a polynomial time complexity has been provided. The proposed algorithm consists of three main loops. There are two inner loops. For n users, the first loop repeats n times. The second loop compares users, which in the worst-case needs to be repeated for n(n − 1) times. Thus, the complexity of these two loops is given by: 10   where m < n . This shows that the complexity order of the proposed algorithm is O(n 3 ).

Conclusion
A practical and optimal user grouping is necessary for using the maximum potential of NOMA. In this paper, we proposed a flexible user grouping algorithm for sum-rate maximization, which can be used for any given number of users and sub-bands. If the sum of users' powers is more than the total transmission power, some users remain ungrouped. In this algorithm, users' gains are different in each sub-band and this makes the algorithm more practical and realistic. The proposed algorithm increases sum rate up to 25 percent compared to some previous algorithms and improves spectral efficiency and system capacity hugely. Considering the computational complexity of the algorithm, it runs in a polynomial time.  Availability of data and material Data sharing not applicable to this article as no datasets were generated or analysed during the current study.

Conflict of interest
The authors have no relevant financial or non-financial interests to disclose.
Code availability Custom code in MATLAB has been used for simulation.