Simulated Annealing for Resource Allocation in Downlink NOMA Systems in 5G Networks

: In this work, we investigate resource allocation and user pairing to improve the system’s Throughput for the downlink non-orthogonal multiple access (NOMA)-based 5G networks. The proposed resource allocation involves user pairing, subchannel power allocation, and proportional power allocation among the multiplexed users. The resource allocation is a non-deterministic polynomial (NP-hard) problem that is difﬁcult to tackle throughput maximization. The user pairing and power allocation are coupled to address the substantial requirements of the NOMA system. The NOMA system requires an efﬁcient deployment of resource allocation techniques to enhance the system’s throughput performance. In this work, we propose simulated annealing (SA) to optimize the power allocation and perform user pairing to maximize the throughput for the NOMA system. Also, we provide mathematical proof on the near-optimal solution for subchannel power and mathematical analysis on the optimal value of the power ratio for the multiplexed users in the NOMA system. The SA provides a signiﬁcant throughput performance that increases by 7% compared to the existing numerical optimization methods. Results obtained show that SA performs with sufﬁcient reliability and low time complexity in terms of Throughput improvement.


Preliminaries
In wireless communication, each generation from 1st generation (1G), 2nd generation (2G), 3rd generation (3G), 4th generation (4G), and 5th generation (5G) is required to adopt different multiple access techniques to satisfy the system capacity and data traffic demand. The ever-increasing demand on data traffic for mobile users, while exacerbating the challenges of the spectrum and resource allocation problem in the 5G networks [1][2][3]. 5G networks require a technology that can meet this massive connectivity, high data rate, and high spectral efficiency demand. In previous network generations, the traditional orthogonal multiple access (OMA) can serve multiple users using the available orthogonal resources. These orthogonal resources are restricting the number of users employed in the system. Thus, OMA is an inadequate system to satisfy the requirements of the 5G network. Currently, non-orthogonal multiple access (NOMA) has been developed to overcome the inadequacy of OMA to meet 5G network requirements. NOMA is a promising technique, where multiple users can share the frequency, code, or time with different power levels in NOMA power domain multiplexing. Hence, NOMA technologies apply signal interference cancellation (SIC) at one of the receiving ends to mitigate the multiplexed users' interference. NOMA technologies have enormous potential advantages in providing low latency, supporting more devices, allowing massive connectivity, and providing better throughput fairness [4].
The NOMA's full potential requires an optimal resource allocation such as user pairing, channel power allocation, and sufficient power for each multiplexed user on the same 1. 2

. Related Work
The resource allocation schemes involve user pairing and power allocation as an interactive approach to improving NOMA performance. The literature is reviewed to examine the available user pairing and power allocation approaches as tabulated in Table 1. The summary of the investigated methods is discussed based on the objectives and the proposed methods for resource allocation in the NOMA system.

Reference
Objective Proposed Algorithm [5] To maximize the sum rate for SISO and MIMO NOMA system. Closed-form solution for power allocation with KKT condition. [6] Maximize the sum rate for the NOMA system with imperfect channel state information (CSI).
Optimal power using KKT condition. [7] Maximization of the ergodic capacity. Bisection search-based power allocation. [8] Maximize the weighted sum rate of a downlink NOMA system. Minimum mean square error (MMSE). [9] Maximize the total sum rate for orthogonal frequency-division multiple-access (OFDM) based NOMA.
User, channel matching, and iterative power allocation scheme based on the difference of convex (DC) programming.
[10] Improve Throughput and energy efficiency for the NOMA system.
Subchannel matching for user and subchannel assignment and DC. [11] Maximize the Throughput for the NOMA-enhanced relay network.
Simulated annealing (SA) for subcarrier and user assignment and DC for power allocation [12] Maximize the NOMA's system total sum rate. Two closed-form suboptimal solutions using the Lagrange multiplier. [13] Maximize the sum rate with minimum rate constraint for downlink NOMA with two users. The proportional fairness scheduling (PFS). [14] Maximize the weighted sum rate (WSR). Iterative fractional quadratic transformation algorithm. [15] Maximize the sum rate and investigate the BER performance in the NOMA system. Generalized power allocation (GPA). [16] Maximize the sum rate by evaluating the impact of user pairing. Channel gain difference with fixed power allocation. [17] Maximize the Throughput in the NOMA system. Lyapunov optimization framework. [18] Improve the Throughput for the NOMA system. Two-sided matching scheme combining the power allocation and maximum fairness (MMF). [19] Sum-rate maximization under constraints of total power and proportional rate. Hierarchical pairing power allocation (HPPA). [20] Maximize the sum rate for MC-NOMA. Projected gradient descent algorithm and greedy heuristic search. [21] Maximize the sum rate for NOMA. Ant colony optimization (ACO) and LTE bandwidth division.
The authors in [5] proposed a closed-form solution for power allocation scheme under conditions of the Karush-Kuhn-Tucker (KKT) condition for single-input singleoutput (SISO) and multiple-input multiple-output (MIMO) in downlink NOMA. Similarly, the closed-form solution is derived for optimal power using KKT condition for sumrate maximization in the NOMA system with imperfect channel state information (CSI) transmitter [6]. Sun. et al. [7] proposed an optimal power allocation solution using a bisection search algorithm with high computational complexity for ergodic capacity maximization under statistical channel state information (CSI) for the MIMO NOMA system. The authors in [8] have proposed a user selection approach based on an exhaustive search and power allocation method using the minimum mean square error (MMSE) to maximize the weighted sum rate of a downlink NOMA system. Further, the optimal solution is found by employing the KKT condition for the power allocation problem. Parida [9] proposed user and channel matching and iterative power allocation scheme to maximize the total sum-rate for orthogonal frequency-division multiple-access (OFDM) based NOMA. The optimization problem in [9] is divided into subproblems, where greedy users and channel matching are employed based on heuristic solutions. Then the difference of convex (DC) programming is used to obtain the suboptimal power for each subchannel and power ratio between the multiplexed users.
The authors in [10] proposed subchannel matching for user and subchannel assignment and DC to determine the subchannel and user's power to improve the NOMA network's Throughput and energy efficiency. The DC achieved a suboptimal solution for power allocation, also outperforming the OFDMA scheme. Wang et al. [11] proposed a joint allocation scheme based on simulated annealing (SA) for subcarrier assignment and DC for power allocation to maximize the throughput for the NOMA-enhanced relay network. The joint resource allocation is divided into two subproblems to reduce the coupled resources' complexity between the subcarrier and power allocation. The SA is used for the subcarrier assignment with fixed power, then replaces the fixed power with the power obtained DC-based Lagrangian dual method to optimize the power allocation.
The authors in [12] proposed an optimal transmission power for each user by deriving two closed-form suboptimal solutions using the Lagrange multiplier to maximize the NOMA's system total sum rate. In terms of complexity, the work initially derived the suboptimal power for two-user configuration and was then extended for multi-user by subbands transmission using bandwidth division.
Choi et al. [13] proposed a proportional fairness scheduling (PFS) approach to achieving optimal power allocation and maximize the sum-rate under the minimum rate constraint for downlink NOMA with two users. The PFS scheme maximized the minimum rate with a 0.1% variation of the transmission rate. The authors in [14] proposed a power allocation scheme based on the iterative fractional quadratic transformation to solve the non-convexity complexity and employed user scheduling to maximize the weighted sumrate (WSR) while considering imperfect SIC in multi-carrier NOMA (MC-NOMA) system.
Ahmed et al. [15] proposed generalized power allocation (GPA) to calculate the different power for many users with no requirement to adjust any of the NOMA parameters based on the wireless communication system. The proposed power allocation scheme showed a slight variation percentage than the arbitrary power allocation and performed with similar behavior as the conventional power allocation for the NOMA system.
The authors in [16] investigated user pairing schemes by testing the channel gain difference of the two users in the case of NOMA while allocating fixed power (F-NOMA) and another NOMA inspired by cognitive radio (CR-NOMA). The F-NOMA has shown a large Throughput that is better than the conventional OMA scheme where the user pairing is performed based on the two users experiencing good channel conditions. In CR-NOMA, the users with the best channel gain are paired with the second-best channel gain user, while the F-NOMA paired that user with the lowest channel gain. Thus, CR-NOMA showed different behavior than F-NOMA, but F-NOMA outperformed CR-NOMA because of the constraints on transmit power allocated to other users in the CR-NOMA. Bao. et al. [17] proposed a joint optimization scheme to maximize throughput in the NOMA system by the Lyapunov optimization framework that converted the original long-term optimization problem into a series of online rate controls in the network layer and power allocation problems in each time slot in the physical layer. The work also obtained the optimal global solution with a polynomial computational complexity using a power allocation algorithm based on dynamic programming and it explored the two optimal solutions. The authors in [18] proposed a near-optimal solution using a two-sided matching scheme by combining the power allocation and maximum fairness (MMF) to improve throughput for the NOMA system. The proposed joint optimal resource allocation scheme is used iteratively to refine the solution. Al-Abbasi et al. [19] proposed hybrid multiple access schemes that combined the properties of NOMA and OFDMA for sum-rate maximization under constraints of total power and the proportional rate of the NOMA system. The suboptimal solution is obtained for two users, and the work is extended to serve the multiuser using a hierarchical pairing power allocation (HPPA) process in the NOMA system.
The authors in [20] proposed a projected gradient descent algorithm as a centralized power allocation method for a fixed subcarrier assignment, along with a greedy heuristic search for the user and subchannel matching to maximize the sum rate for MC-NOMA. The achieved solution is near-optimal with lower computational complexity than other near-optimal solutions. In [21], we proposed a power allocation scheme with two user configurations using the ant colony optimization (ACO) method to optimize the subchannel power and the power ratio among the multiplexed users. The proposed method is developed for a system with two users, and bandwidth division is adopted to extend the work to serve a larger number of users in the network. Therefore, the NOMA potentially enables the users to access the entire bandwidth, where the bandwidth division cannot meet that concept.
Resource allocation is defined as a non-convex problem [9,14,17], where the direct numerical method is not efficient in solving it. A method is required to transform the non-convex problem into a convex problem in order to achieve an effective solution. However, no tractable solutions can be guaranteed for a non-convex optimization problem by converting it into a sub-problem. Furthermore, the optimal solution obtained by changing the non-convex into the convex may not be the optimal solution but can be the approximate solution. Most numerical optimization algorithms can only optimize the power allocation while requiring a user pairing scheme to achieve a comparable optimal resource allocation solution. Therefore, the optimal resource allocation can only be achieved in parallel with the optimal user pairing scheme.
Simulated annealing (SA) is one of the metaheuristic optimization algorithms that work dynamically and iteratively to obtain the optimal solution, which can be more realistic and reliable in solving a non-convex optimization problem. The SA algorithm mimics the physical annealing process where it puts the material under a high temperature, then reduces the temperature slowly until a crystalline state is formed with the minimum energy and larger crystal size. The SA starts from a melting phase based on the physical crystal form, then the temperature of the molten crystal is reduced very slowly until the structure of the crystal is formed and stabilized without any defects [22]. The SA algorithm can find the global solution fast and guarantees a convergence upon running enough iterations. This is a significant advantage of the SA, while the gradient descent algorithm obtains the local solution. Moreover, SA is applied to both combinatorial and continuous optimization problems.
The NOMA system's resource allocation challenge can be designed and modeled using SA since tuning the parameters is relatively controllable. In NOMA system-based power domain multiplexing, multiple users share the same radio resources, requiring an optimal resource allocation. Heretofore, no literature has reported applying SA to the issues related to resource allocation in the NOMA system. The SA algorithm is used to solve the user pairing and power allocation to maximize the total Throughput in the NOMA system. Moreover, SA is developed to determine the subchannel power and the power ratio for the multiplexed users, where the channel difference is the primary criteria to form the users and subchannels matching scheme. The user pairing scheme is designed using the two types of channel gain difference as a hot and cold configuration that ensures optimal user and subchannel matching.
In this work, we propose a novel resource allocation scheme to maximize the Throughput for the downlink 5G NOMA system using SA. We also provide mathematical proof that equal power allocation can be the near-optimal solution for the NOMA system's subchannel power allocation problem. Further, we mathematically prove that the proportional power ratio can be fixed to a value between 0 to 1 that can maximize the Throughput based on the NOMA concept. The remainder of the paper is organized as follows. Section 2 presents the downlink NOMA system model and the mathematical formulation of the resource allocation optimization problem. In Section 3, we provide full detail of the proposed method used for resource allocation. The system model parameters and the analysis of the results are presented in Section 4. Finally, the work conclusion is drawn in Section 5.

NOMA System Model
In this work, we design the downlink NOMA system as a SISO scenario equipped with BS at the cell's center with a uniform distribution of U total number of users. The BS serves Appl. Sci. 2021, 11, 4592 5 of 16 multiple users at the same time, code, or frequency with different power levels according to the NOMA-based 5G system. The NOMA power domain multiplexing scheme is the standard NOMA system that offers the fundamental concept of multiplexing two users on the same channel by allocating different power levels. Figure 1 illustrates the concept of the downlink NOMA system with 10 users.
resource allocation optimization problem. In Section 3, we provide full detail of the proposed method used for resource allocation. The system model parameters and the analysis of the results are presented in Section 4. Finally, the work conclusion is drawn in Section 5.

NOMA System Model
In this work, we design the downlink NOMA system as a SISO scenario equipped with BS at the cell's center with a uniform distribution of total number of users. The BS serves multiple users at the same time, code, or frequency with different power levels according to the NOMA-based 5G system. The NOMA power domain multiplexing scheme is the standard NOMA system that offers the fundamental concept of multiplexing two users on the same channel by allocating different power levels. Figure 1 illustrates the concept of the downlink NOMA system with 10 users. The system run with a total bandwidth that is equally allocated among the subchannels where the subchannel bandwidth = ⁄ . The BS serves a total number of users that receive their signals through a total number of subchannels . In the system, we use as index of ℎ users where ∈ {1,2, . . . . . , } and as index of ℎ subchannel where ∈ {1,2, . . . .., }. In this system, we assume that only two users are multiplexed on the same subchannel. The system employs superposition coding for the multiplexed users, where the design considers ∈ { 1 , 2 , . . . . , } is the number of users multiplexed on the same ℎ subchannel and , denotes the ℎ user on the subchannel . The BS transmits a signal carrying a superposition coded symbol on the intended subchannel as shown below: The system run with a total bandwidth B total that is equally allocated among the subchannels where the subchannel bandwidth B sc = BW total /N sc . The BS serves a total U number of users that receive their signals through a total number of subchannels N sc .
In the system, we use u as index of uth users where u ∈ {1, 2, . . ., U} and n as index of nth subchannel where n ∈ {1, 2, . . . , N sc }. In this system, we assume that only two users are multiplexed on the same subchannel. The system employs superposition coding for the multiplexed users, where the design considers U n ∈ {U 1 , U 2 , . . ., U N sc } is the number of users multiplexed on the same nth subchannel and U i,n denotes the ith user on the subchannel n. The BS transmits a signal carrying a superposition coded symbol on the intended subchannel n as shown below: where .. x i is the transmitted symbol of ith user on the subchannel n and the power allocated to ith user is p i,n . The total allocated power to the subchannel n is P n where ∑ U n i=1 P i,n = P n , while if ith user is not assigned to subchannel n, then the p i,n = 0. The received signal at mth user on subchannel n is given as follows: where g m,n is the coefficient between the base station and the desired user U n on subchannel n, where g m,n = h m,n /L(d). The L(d) is the function of the path loss at a distance (d) between the BS and U m,n with Rayleigh fading channel gain as h m,n . The additive Gaussian white noise (AWGN) is denoted as Z m,n with zero mean and σ 2 variance, where Z m,n ∼ CN 0, σ 2 . The variance is σ 2 = (BW total /N sc )N• , where N• is the power spectral density. Each user receives a mixed signal, where the successful reception of the user's message is guaranteed by separating the received user's messages. Since the BS send a superimposed message signal on the same subchannel for the multiplexed users, the co-channel interference is an active phenomenon in NOMA. The successive interference cancellation (SIC) is adopted to solve the interference phenomena in NOMA. The received signal-to-interference-plus-noise ratio (SINR) without SIC of the mth user on subchannel n is given below: where G m,n is the channel response normalized by noise (CRNN) of mth on SC n that represented as G m,n g m,n 2 /σ 2 n , where σ 2 n = E |N m,n | 2 the noise power on subchannel n. According to Shannon's capacity formula, the throughput of subchannel n is given below: The user U m,n receives interference from the other user, where the interferences SI NR m,n , also denoted as γ m,n , are expressed as follows: The NOMA's basic principle is to perform SIC at one receiver to reduce the interference between the multiplexed users on the same subchannel. The SIC technique enables the user with stronger CRNNs to decode the user's signal with poorer CRNNs and cancel it from the superimposed message. However, the user with the poorer CRNNs decodes the intended signal and treats the other signal as noise. Moreover, the increasing order of CRNNs achieves the optimal decoding order for appropriate SIC performance. Hence, any user can decode the other user's signal successfully and correctly based on the CRNNs order.
In power domain multiplexing, the NOMA system allocates more power to the user with lower CRNN to maximize the throughput and achieve balanced Throughput between the multiplexed users. For instance, the two users U 1,n and U 2,n are multiplexed on the same subchannel n with |G 1,n | 2 ≥ |G 2,n | 2 , and the user fairness is ensured by the power allocation scheme of P 1,n ≤ P 2,n based on the NOMA power allocation protocol [4,23,24].
In Figure 2, SIC application is performed for each subchannel, where each user can extract the intended signal. Consider that the users allocated on the same subchannel n are U U n ,n . The user multiplexing scheme is adopted based on CRNNs in order to assign users on the same subchannel as |G 1,n | ≥ |G 2,n | ≥ . . . ≥ |G m,n | ≥ |G m+1,n | ≥ . . . ≥ |G U n , n |. The user UE m decodes and cancels the interference power from the user with a weaker channel condition as UE m+1 ..UE m+2 , . . . , UE U n , according to the optimal SIC decoding order where the interference is cancelled successfully. However, during the decoding process user UE m experiences a weaker channel condition and will not be able to remove the interference from the user UE m−1 , who experiences better channel conditions, so it treats the interference power as noise. The standard NOMA design is assumed to allocate more power ratio to the user with a weak channel gain and less power ratio to the user with a strong channel gain. In the first step, SIC will decode the data signal of the user with a weak channel gain as more power is assigned. In the second step, the second data signal is decoded for the user with a strong channel gain, where the lower power ratio is assigned. The optimal SIC application depends on the power ratio for the multiplexed users, where the power level difference is the main factor in reducing the SIC complexity. Therefore, the user U m,n performs SIC, while SINR is expressed as follows: SI NR m,n SIC = P m,n G m,n is decoded for the user with a strong channel gain, where the lower power ratio is assigned. The optimal SIC application depends on the power ratio for the multiplexed users, where the power level difference is the main factor in reducing the SIC complexity. Therefore, the user , performs SIC, while SINR is expressed as follows:

Problem Formulation
The optimization problem is formulated for resource allocation. In mobile communication networks, the optimization aims to maximize the system's capacity with minimum power allocation to achieve Throughput maximization. In the NOMA system, each subchannel is assigned by power , and the throughput over subchannel is defined as . The total throughput is given as: In the downlink NOMA system, only two users are multiplexed on the same subchannel to reduce the complexity of the SIC performance. In this system, two users share the same subchannel while considering 1, ≥ 2, , and the throughput of the subchannel with respect to can be expressed in (8).
where is the proportional power factor for the two multiplexed users on subchannel . In general, the ∈ (0,1) and the user with high channel gain always performs SIC. The proposed user pairing scheme is deployed to ensure the optimality of the power allocation scheme and guarantee that more power is assigned to the second user who is experiencing weaker channel conditions. In the system, the throughput optimization problem is formulated as below:

Problem Formulation
The optimization problem is formulated for resource allocation. In mobile communication networks, the optimization aims to maximize the system's capacity with minimum power allocation to achieve Throughput maximization. In the NOMA system, each subchannel is assigned by power P n , and the throughput over subchannel n is defined as R n . The total throughput is given as: In the downlink NOMA system, only two users are multiplexed on the same subchannel to reduce the complexity of the SIC performance. In this system, two users share the same subchannel n while considering G 1,n ≥ G 2,n , and the throughput of the subchannel with respect to P n can be expressed in (8).
f (P n ) = B sc1,n log 2 (1 + δ n P n G 1,n ) + B sc2,n log 2 1 + (1 − δ n )P n G 2,n 1 + δ n P n G 2,n where δ n is the proportional power factor for the two multiplexed users on subchannel n. In general, the δ n ∈ (0, 1) and the user with high channel gain always performs SIC. The proposed user pairing scheme is deployed to ensure the optimality of the power allocation scheme and guarantee that more power is assigned to the second user who is experiencing weaker channel conditions. In the system, the throughput optimization problem is formulated as below: subject to: The objective function is limited by the summation of the subchannels power not exceeding the maximum transmit power P Max according to C 1 . Also, the minimum user's throughput is ensured as a minimum target throughput in C 2 . The resource allocation in NOMA is considered a non-convex and NP-hard problem. Therefore, finding the global solution within the polynomial-time is a challenge. The subchannel, user assignment, and power allocation are separated to solve the coupled problem.

Simulated Annealing Based Resource Allocation
The simulated annealing algorithm is adopted to maximize the overall throughput for the downlink NOMA system. The SA algorithm allocates power for each subchannel and the proportional power for each multiplexed user on the same subchannel and assigns multiple users on the same subchannel. The SA algorithm imitates the physical annealing process by putting the metal into a high temperature with high energy, then reducing the heat to obtain the crystal structure with minimum energy [22]. The energy function in the physical annealing is defined as the throughput objective function in the proposed SA algorithm. The objective function is formulated to maximize the total throughput, as shown in (8). The algorithm evaluates the objective function based on the allocated power for each subchannel P n and the power ratio δ n among the multiplexed users, as well as the user and subchannel matching. The SA design defines the parameters a n = P n /P Max , as a fraction of the total transmitted power P Max . The δ n is the power ratio for the multiplexed users on the same subchannel, and the channel gain difference is the main factor for the user and subchannel matching scheme. The SA system started by assigning random channel power based on the factional value of a n , random value of power ratio δ n , and multiplexing two users randomly on the same subchannel. The initial design of the SA algorithm is considered as the current best solution for the objective function, then one parameter is changed according to the system mode. The SA algorithm accepted the solution after each change if the new solution is better than the current best solution, otherwise accepted with probability. The accepted new solution for each system mode is updated in the current best solution set, then the temperature is reduced and used for the next iteration temperature. The parameters are used to estimate throughput by changing one parameter every iteration while keeping the other two parameters fixed. This process can reduce the time complexity of re-calculating the objective function every iteration until the total throughput is achieved. The system initiates with two different configurations of user and subchannel matching. The change of one parameter every iteration can offer less computational time, and decouple the resource allocation problem since the problem is coupled. One parameter is changed in each iteration based on the system mode, and the mode is chosen according to the random value of µ. The user pairing is conducted when µ = 1, the subchannel power is changed when µ = 2, and the proportional power ratio is changed when µ = 3. Moreover, SA is a flexible standalone algorithm that ensures an optimal solution for the coupled problem of resource allocation and user and subchannel matching. SA is a minimization algorithm, so we use a minus sign in the objective function. The SA algorithm is described in the three following subsection steps.

SA for User Pairing
The SA algorithm performed the user pairing scheme when the system mode µ = 1. In this system, the SA algorithm started with two different configurations, such as hot and cold configurations, based on the channel's gain difference. This considers that subchannels are accessible by all users. This assumption addresses the impact of the channel gain difference on the user pairing scheme and the throughput performance [16]. Furthermore, the user pairing scheme exploits the channel gain difference for the multiplexed users, which should be investigated to guarantee the minimum target data rate for the user with the weakest channel gain. The hot configuration started the initial design by randomly multiplexing the user with high channel gain with the user with low channel gain on the same subchannel as the current best solution. The cold configuration established the initial design by matching the users randomly based on descending order of channel gain on the same subchannel as a current best solution [16]. The users and subchannels matching scheme are performed in the cold configuration, enabling the search to start based on both users' good channel gain conditions [16]. The average channel gain for each subchannel is employed in the cold configuration as calculated in (12): where U is the total number of users accessing the particular subchannel and G i,n is the channel gain corresponding to the users.
The SA started the search with the initial configuration, where the user pairing condition is used to guarantee the SIC optimality. Each configuration is practically tested for random power allocation and equal power allocation. The scenarios are adopted to ensure the practicality of the channel's gain difference in improving the system's throughput. The users and subchannel matching scheme is performed according to the two configurations where the channel gain threshold is set for the cold configuration and the channel gain condition for the hot configuration. The initial design started with a random user pairing according to the proposed initial configurations as the current best solution for the objective function, then two random channels are chosen to exchange the users according to the channel gain condition. The objective function is evaluated after the exchange, and the new solution is accepted if it is better than the current best solution. The new solution of the user pairing is updated in the current best solution set, and the temperature is reduced in the current iteration. The user pairing scheme is described in Algorithm 1.
In the hot configuration, the matching process pairs the highest channel gain user with the lowest channel gain user, regardless of the channel gain threshold. Meanwhile, the matching process in the cold configuration matches the highest channel gain user with the first listed user below the average channel gain. The condition in the cold configuration selected the first listed user below the threshold and multiplex it on the same subchannel with the highest channel gain user to suit the condition Second user gain n ≤ G Av . Hence, the matching process tests all possible users and subchannels involved in Throughput maximization.

SA for Subchannel Power Allocation
SA is applied to determine the optimal subchannel power according to the system mode as µ = 2, where a n is defined as the power ratio of the total BS transmitted power to determine each subchannel power. The parameter a n is a factor of the changes of the P n value, where this factor is necessary to assign the power needed for each subchannel. Practically the subchannel power is evaluated as a fraction of the total transmitted power, which is a fixed value in the system. The factor a n is defined as 0 ≤ a n ≤ 1, where ∑ N sc n=1 a n ≤ 1 and ∑ N sc n=1 P n = ∑ N sc n=1 a n × P max = P max . The initial design established with random allocation of channel power P n according to a n factor as the current best solution for the objective function, then a n factor is changed to modify channel power P n for one chosen Appl. Sci. 2021, 11, 4592 10 of 16 channel. The objective function is evaluated after the channel power P n is modified, and the new solution is accepted if it is better than the current best solution. The accepted new solution is updated in the current best solution set, and the temperature is reduced for the current iteration. The subchannel power optimization process is modeled in Algorithm 2.
The initial system design started with the random values of P n , where a n determines the required subchannel power with respect to the maximum transmitted power. Moreover, equal power allocation is applied where a n is not used in the optimization process. The SA determined the subchannel power is observed as close to equal power allocation. An overview of the mathematical proof is presented in Appendix A, where it shows that equal power allocation can be the optimum solution under certain assumptions.

SA for Proportional Power Allocation δ n
SA is performed to determine the power ratio for each subchannel according to the system mode as µ = 3, where the power ratio δ n is a value between 0 and 1. In this system design, we consider only two users, U 1 and U 2 , sharing the same subchannel SC n while considering G 1,n > G 2,n and that more power is assigned to U 2 and less power to U 1 . In the NOMA system, U 1 can cancel the signal interference power from U 2 according to the SIC principle and U 2 treats the U 1 signal as noise. 16.
Accept the new solution. 18.
Accept the solution. 20. End the Algorithm.
Since the power ratio δ n is designed in the objective function to allocate more power to the user with a weak channel condition and less power to the user with a good channel condition. The user with a weak channel condition receives the interference power from the user with a good channel condition. For instance, U 2 received the signal with the interference of U 1 , where the power ratio of U 1 is a small value due to a small power ratio and weak channel gain. Hence, this looks like the noise same as AWGN. The proportional power factor δ n is used to distribute the power for the multiplexed users. The user's throughput on SC n can be maximized by determining the proportional power factor δ n while considering the application of SIC according to the NOMA concept. The SA algorithm is applied in order to find the optimal value of δ n , where the power ratio δ n ∈ (0, 1). The initial design started with a random value of power ratio δ n as the current best solution for the objective function, then the power ratio is changed on the selected channel. The objective function is evaluated on the selected channel after the change of the power ratio, and the new solution is accepted if it is higher than the current best solution. Then this new solution is updated in the current best solution set, and the temperature is reduced for the current iteration. The SA algorithm estimated the value of the power ratio, as described in Algorithm 3.

Result and Performance Analysis
The downlink NOMA system is simulated using MatLab and is designed with a base station at the cell's center with a 500 m radius. In the simulation, the users are uniformly distributed to at least a 50 m minimum distance from the base station, and 40 m is the minimum distance between users. The proposed algorithm has been simulated with the system parameters shown in Table 2. The proposed SA parameters are tuned to achieve the objective function's maximum and ensure the algorithm's convergence. The initial temperature is defined as T initial = 100, which is the highest temperature for the optimization process. Furthermore, the temper-ature is reduced slowly by ( T i = T i−1 − α T i−1 ) where α = 2/3, which can guarantee a slow cooling schedule to obtain a global solution [22]. The SA algorithm achieves system performance with a minimum of 2000 iterations for the system that has many users.
In Figure 3, the system throughput is evaluated for 10 users versus the maximum transmission power. The SA configurations are compared to NOMA-DC [10], the fractional transmission power allocation (FTPA) [4], and OFDMA. The SA-EQ cold configuration outperforms both scenarios of the hot configuration. The search in the cold configuration starts with users experiencing a good channel gain condition that is much better than the hot configuration search. In the cold configuration, the multiplexed users' channel condition is better than the hot configuration channel's condition. This channel gain difference induces a reasonable solution, which can give higher Throughput for the cold configuration. The user pairing in the cold configuration is performed based on the second user channel gain on the same subchannel is better than that of the second user channel gain in the hot configuration. The SA accepts good solutions directly, but the worst solutions are accepted with a probability that can check all feasible solutions. The difference between the neighbouring solutions will not be large enough to vary the optimal solution's probability. Both configurations show a slow increment when the power increases and reaches the maximum transmit power because of the system's power constraints. The SA performed a power allocation that performs as 7% better than NOMA-DC and 43% higher than the FTPA performance and OFDMA. The SA computational time is 93.05 s for the system with 10 users, where the NOMA-DC is 113.5 s. Hence, SA is faster by 20.45 s than NOMA-DC because the SA reaches the optimum solution faster at the beginning and iteratively slows down to end the algorithm with limited steps. Appl Figure 4 shows the SA configurations compared to NOMA-DC [10], FTPA [4], and OFDMA when the number of users increased from 10 to 60 users. The presented algorithms and both SA configurations achieved a lower throughput when the system tested with 10 users, and the throughput gradually increased when the number of users increased to 60 users. The cold configuration gives higher Throughput than the hot configuration when the number of users increased. The EQ-cold configuration outperforms the other schemes because only two parameters are tuned in the system model that enhanced and expedited the search for more users. The SA computational time is 116.5 s for the system with 60 users, where the NOMA-DC is 394.05 s. Thus, the SA is faster than NOMA-DC, which is one advantage of SA for a large number of users. The equal power allocations in the cold and the hot configurations slightly outperform the other power allocations in the cold and hot configurations, hence the equal power allocation can be an optimum solution for the power allocation scheme in the NOMA system.  Figure 4 shows the SA configurations compared to NOMA-DC [10], FTPA [4], and OFDMA when the number of users increased from 10 to 60 users. The presented algorithms and both SA configurations achieved a lower throughput when the system tested with 10 users, and the throughput gradually increased when the number of users increased to 60 users. The cold configuration gives higher Throughput than the hot configuration when the number of users increased. The EQ-cold configuration outperforms the other schemes because only two parameters are tuned in the system model that enhanced and expedited the search for more users. The SA computational time is 116.5 s for the system with 60 users, where the NOMA-DC is 394.05 s. Thus, the SA is faster than NOMA-DC, which is one advantage of SA for a large number of users. The equal power allocations in the cold and the hot configurations slightly outperform the other power allocations in the cold and hot configurations, hence the equal power allocation can be an optimum solution for the power allocation scheme in the NOMA system. Appl. Sci Figure 5 shows the cold-EQ configuration converges earlier than the hot configuration when observed on the system with 60 users. Both SA configurations converge higher than NOMA-DC, but the cold configuration shows a higher convergence than the hot configuration. For a large number of users, more iterations are required for the hot configuration which needs over 2000 iterations to converge, but these amounts of iterations are enough for cold configuration. Moreover, as the number of users increase, the SA with a cold configuration performs better because it starts from a better solution. On the other hand, the NOMA-DC is very slow for a large number of users, while the SA algorithm is relatively faster.

Conclusions
Simulated annealing (SA) is applied to optimize the resource allocation problem and to maximize the overall throughput in the downlink NOMA system. The SA algorithm is deployed to accomplish user assignment, determine the subchannel power, and apply the proportional power factor to the multiplexed users. The user pairing scheme is performed based on two configurations of the channel gain difference to ensure the scheme's optimality. The power allocation is used to assign the power for each subchannel and determine the power ratio for the multiplexed users on the same subchannel. The design tested the NOMA system with a minimum of users as 10 and a maximum of 60 users. The SA algorithm outperformed by 7% the NOMA-DC, 43% FTPA, and 48% OFDM schemes with less computational time.  Figure 5 shows the cold-EQ configuration converges earlier than the hot configuration when observed on the system with 60 users. Both SA configurations converge higher than NOMA-DC, but the cold configuration shows a higher convergence than the hot configuration. For a large number of users, more iterations are required for the hot configuration which needs over 2000 iterations to converge, but these amounts of iterations are enough for cold configuration. Moreover, as the number of users increase, the SA with a cold configuration performs better because it starts from a better solution. On the other hand, the NOMA-DC is very slow for a large number of users, while the SA algorithm is relatively faster. The SA also shows fast execution time for a large number of users and higher throughput achievement. The SA equal power allocation outperformed other power allocation schemes. It also mathematically proved that equal power allocation is the optimum power allocation scheme for the NOMA system. Moreover, according to NOMA concepts, the multiplexed users' proportional power ratio can be fixed to a fractional value that can reduce the optimization's complexity. The results show SA as a solution to both resource

Conclusions
Simulated annealing (SA) is applied to optimize the resource allocation problem and to maximize the overall throughput in the downlink NOMA system. The SA algorithm is deployed to accomplish user assignment, determine the subchannel power, and apply the proportional power factor to the multiplexed users. The user pairing scheme is performed based on two configurations of the channel gain difference to ensure the scheme's optimality. The power allocation is used to assign the power for each subchannel and determine the power ratio for the multiplexed users on the same subchannel. The design tested the NOMA system with a minimum of users as 10 and a maximum of 60 users. The SA algorithm outperformed by 7% the NOMA-DC, 43% FTPA, and 48% OFDM schemes with less computational time.
The SA also shows fast execution time for a large number of users and higher throughput achievement. The SA equal power allocation outperformed other power allocation schemes. It also mathematically proved that equal power allocation is the optimum power allocation scheme for the NOMA system. Moreover, according to NOMA concepts, the multiplexed users' proportional power ratio can be fixed to a fractional value that can reduce the optimization's complexity. The results show SA as a solution to both resource allocation problem and a way to maximize the Throughput in the NOMA-based 5G.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
The total rate of the NOMA can be expressed as: R = BW Total N sc ∑ n=1 log 2 (1 + δ n p n G 1n ) + log 2 (1 + p n G 2n ) − log 2 (1 + δ n p n G 2n ) We will define the Throughput per Bandwidth R BW = R/BW Total R BW = N sc ∑ n=1 log 2 (1 + δ n p n G 1,n ) + log 2 (1 + p n G 2,n ) − log 2 (1 + δ n p n G 2,n ) Define the power allocation factor a n = P n P Total , (with ∑ Nsc 1 a n = 1 and 0 < a n < 1) where P Total is the total transmit BS power and P n = a n P Total we get: R BW = N sc ∑ n=1 log 2 (1 + δ n p n G 1,n ) + log 2 (1 + p n G 2,n ) − log 2 (1 + δ n p n G 2,n ) R BW = N sc ∑ n=1 log 2 (1 + δ n a n P t G 1,n ) + log 2 (1 + a n P t G 2,n ) (1 + δ n a n P t G 2,n ) After we simplify the equation, we get the expression 2 R BW : (1 + δ n a n P t G 1n )(1 + a n P t G 2n ) (1 + δ n a n P t G 2n ) Under the assumption of G 1,n > G 2,n and δ n a n P t G 1,n 1, δ n a n P t G 2,n 1, which are in general valid assumptions, we get: (δ n a n P t G 1n )(a n P t G 2n ) (δ n a n P t G 2n ) ∼ N sc ∏ n=1 (a n P t G 1n ) = N sc ∏ n=1 a n N sc ∏ n=1 P t G 1n We know that the maximum of ∏ N sc n=1 a n with ∑ Nsc n=1 a n = 1 and 0 < a n < 1 is the equal power allocation a n = 1 Nsc where a n = P n P Total , Hence P n P Total = 1 Nsc ; then P n = P Total Nsc which the exact expression of the equal power allocation.

Appendix B
Proof of the δ n power ratio: The fitness function with respect to power ration δ n as following: f (δ n ) = B sc log 2 (1 + δ n P n G 1,n ) + B scn log 2 1 + (1 − δ n )P n G 2,n 1 + δ n P n G 2,n With the assumption that Subchannel bandwidth is an equal distribution among the users.