# A Novel Approach to Enhance the Energy Efficiency of a NOMA Network
## 5 The Sub-Optimal Solution
### User Sub-Channel Fair Matching Algorithm  
The proposed USFMA is based on CSS-PA, the USMA, and the Hungarian algorithm [35, 36]. Random power allocation (RPA) [37] has a low complexity, but the system performance is poor because the user's channel conditions are not considered. The exhaustive search algorithm (ESA) [38] can maximize the system performance but the computational complexity is too high. Existing user allocation algorithms either have the problem of excessive complexity or sacrifice partial throughput to reduce the complexity. Therefore, we have combined the advantages of several existing user allocation algorithms and proposed a new user allocation algorithm that is not too complex and can ensure user fairness. According to the CSS-PA, the greater the difference in channel gains of users superimposed on the same sub-channel, the better the system throughput. By exploiting the USMA, we can regard the user allocation problem as a bilateral matching problem between the user and the sub-channel, and then we can use the Hungarian algorithm to find the perfect match with the largest channel gain. Taking into account the complexity of the receiver, we assume that each sub-channel only superimposes two users and hence, the number of users is twice the number of sub-channels, \(2V=U\). We construct a channel gain matrix \(G\) of size (\(UV\)) from the users and sub-channels, then the gains for every sub-channel are sorted from small to large. After that, \(G\) is split in the middle into two square matrices (\(G1,G2\)), each with size \(VV\). Then, gain compensation is applied for the users in \(G1,G2\), respectively, according to our USFMA. After compensation, we use the Hungarian algorithm for the two matrices to obtain the gain and maximum user allocation. Let us consider an example of a channel matrix to demonstrate the operation of each algorithm when assigning users to each sub-carrier. We consider in our example a NOMA system with \(U=6\) and \(V=3\). Then, \(G\) can be expressed as:  
\[G=\left[ \begin{array}{ccc}42&80&1586\\ 219&37&183\\ 309&773&678\\ 74&91&49\\ 64&21&23\\ 2&38&9\end{array} \right] \tag{17}\]  
The gain matrices \(G1,G2\) after sorting and splitting \(G\) are:  
\[G1= \left[ \begin{array}{ccc}2&21&9\\ 42&37&23\\ 64&38&49\end{array} \right] \tag{18}\] \[G2= \left[ \begin{array}{ccc}74&80&183\\ 219&91&678\\ 309&773&1586\end{array} \right] \tag{19}\]  
We normalize all the elements in \(G1\) and \(G2\) by their corresponding column sum and compensate them as follows:  
\[\mathcal{G}_{mn}=\left(\frac{\mathcal{G}_{mn}}{\sum_{m=1}^{U/2}\mathcal{G}_{ mn}}\right)^{-\beta}\;\;,\;\mathcal{G}\in\{G1,G2\} \tag{20}\]  
where \(m\) and \(n\) are row and column indices, respectively, and \(\beta\) is the attenuation coefficient. We set \(\beta=0.4\). Therefore, based on (20), the normalized and compensated forms of (18) and (19) are:  
\[\mathcal{G}1=\left[ \begin{array}{ccc}4.9313&1.8366&2.4082\\ 1.4590&1.4643&1.6546\\ 1.2328&1.4488&1.2227\end{array} \right] \tag{21}\]  
\[\mathcal{G}2=\left[ \begin{array}{ccc}2.3128&2.6838&2.8215\\ 1.4985&2.5490&1.6709\\ 1.3057&1.0832&1.1894\end{array} \right] \tag{22}\]  
After that, we apply the Hadamard product between each matrix and its corresponding normalized counterpart as follows:  
\[\mathcal{G}1=G1\;\circ\;\mathcal{G}1=\left[ \begin{array}{ccc}10&39&22\\ 61&54&38\\ 79&55&60\end{array} \right] \tag{23}\]  
\[\mathcal{G}2=G2\;\circ\;\mathcal{G}2=\left[ \begin{array}{ccc}171&215&516\\ 328&232&1133\\ 403&837&1886\end{array} \right] \tag{24}\]  
Then, we use the Hungarian algorithm to perform perfect matching on the \(\mathcal{G}1\) matrix and the \(\mathcal{G}2\) matrix, respectively. The channel gain and the largest user allocation are found under perfect matching. After using the Hungarian algorithm, the user's allocation result is:  
\[\hat{G1}=\left[ \begin{array}{ccc}10&\textbf{[39]}&22\\ \textbf{[61]}&54&38\\ 79&55&\textbf{[60]}\end{array} \right] \tag{25}\]  
\[\hat{G2}=\left[