# Energy-Efficient Resource Allocation for Downlink Non-Orthogonal Multiple Access Systems
## 3 Proposed Algorithm
### Subchannel Assignment Algorithm (SAA)
In \(SC_{3}\), the user with the worst channel gain is \(U_{5}\), with a channel gain of 0.84. In \(SC_{4}\), the user with the worst channel gain is \(U_{4}\), and the channel gain is 1.02. After the channel gain matrix has gone through the operational process in step 1, we note it as \(H1\), as shown below. Similarly, after steps 2, 3 and 4, the channel gain matrix is denoted as \(H2\), \(H3\) and \(H4\), respectively. \[H1=\left[ \begin{array}{cccccc}1.32&5.78&0.67&1.21&1.06&4.37&2.15&2.23\\ 0.07&3.21&0.87&3.54&1.12&5.01&1.87&4.33\\ 2.38&1.33&4.20&2.68&0.84&1.93&1.70&1.39\\ 1.55&1.96&5.84&1.02&3.21&2.10&1.46&2.79\end{array} \right] \tag{11}\]  
Step 2: According to the ascending order of channel gain, the order of matching users of each subchannel is sorted. The matching sequence is \(SC_{2}\), \(SC_{1}\), \(SC_{3}\), and \(SC_{4}\). This gives the following results. \[H2=\left[ \begin{array}{cccccc}0.07&3.21&0.87&3.54&1.12&5.01&1.87&4.33\\ 1.32&5.78&0.67&1.21&1.06&4.37&2.15&2.23\\ 2.38&1.33&4.20&2.68&0.84&1.93&1.70&1.39\\ 1.55&1.96&5.84&1.02&3.21&2.10&1.46&2.79\end{array} \right] \tag{12}\]  
Step 3: Each subchannel matches the user with the best channel quality in the subchannel according to the sorting order as the strong user. \(SC_{2}\) takes the lead in selecting user U8 with the strongest gain on the local channel. Since \(U_{8}\) has been chosen as a strong user on \(SC_{2}\), we exclude \(U_{8}\) before matching the user to the next subchannel. Next, select \(U_{2}\) for \(SC_{1}\), \(U_{3}\) for \(SC_{3}\), and \(U_{5}\) for \(SC_{4}\). At this point, a strong user has been matched on all subchannels. The matching results are shown below. \[H3=\left[ \begin{array}{cccccc}0.07&3.21&0.87&3.54&1.12&5.01&1.87&4.33\\ 1.32&5.78&0.67&1.21&1.06&4.37&2.15&2.23\\ 2.38&1.33&4.20&2.68&0.84&1.93&1.70&1.39\\ 1.55&1.96&5.84&1.02&3.21&2.10&1.46&2.79\end{array} \right] \tag{13}\]  
Step 4: The four users that have already been matched are excluded. In the order of sub-channel matching, the remaining users are again matched to the sub-channel with the highest channel gain. Finally, \(SC_{1}\) multiplexes \(U_{2}\) and \(U_{7}\), \(SC_{2}\) multiplexes \(U_{6}\) and \(U_{8}\), \(SC_{3}\) multiplexes \(U_{3}\) and \(U_{4}\), and \(SC_{4}\) multiplexes \(U_{1}\) and \(U_{5}\). The result after matching two users per sub-channel is as follows. \[H4=\left[ \begin{array}{cccccc}0.07&3.21&0.87&3.54&1.12&5.01&1.87&4.33\\ 1.32&5.78&0.67&1.21&1.06&4.37&2.15&2.23\\ 2.38&1.33&4.20&2.68&0.84&1.93&1.70&1.39\\ 1.55&1.96&5.84&1.02&3.21&2.10&1.46&2.79\end{array} \right] \tag{14}\]  
To illustrate the complexity of the algorithm, we take the NOMA downlink system with \(M\) users and \(N\) subchannels \((M=2N)\) as the background. In order to complete the subchannel allocation, the exhaustive search algorithm needs to perform \(\frac{(2N)! }{2^{N}}\) operations with complexity of \(\mathcal{O}\left(\frac{(2N)!}{2^{N}}\right)\). In our proposed algorithm, the subchannel needs \(\sum_{n=1}^{N}(M-1)=N(M-1)\) operations to find the user with the worst gain. Next, sorting all subchannels according to the selected channel gain ascending order requires 2 NInN operations. The subchannel needs \(\left(2*\sum_{n=1}^{N}\frac{(M-1)}{2}=N(M-1)\right)\) operations to match two users. That is,the algorithm needs a total of \((2N\ln N+2N(M-1))\) operations to complete subchannel allocation, and the complexity is \(\mathcal{O}\big{(}N^{2}\big{)}\). From the above analysis, we can see that the proposed subchannel allocation algorithm has low complexity and can greatly shorten the operation time.