# Novel Resource Allocation Techniques for Downlink Non-Orthogonal Multiple Access Systems
## 4 Proposed Resource Allocation Techniques
### User Pairing Approach Based on HNG Algorithm  
We utilize HNG algorithm to maximize the sum rate and energy efficiency of the strong and weak users by finding their maximum available transmission power and minimum acceptable data rate. HNG algorithm is an accurate combinatorial optimization method for finding the corresponding optimal matching between users that need to be assigned in a subchannel. It is well known for its use in solving resource allocation problems. \(O(N^{3})\) is the computational complexity of the algorithm, which is especially high in a large-scale scenario; however, it ensures an optimal global performance [32; 33]. Suppose there are two sets of users, with \(u=\{1,\,2,\,\ldots,\,\mathrm{U}\}\) and \(v=\{1,\,2,\,\ldots,\,\mathrm{V}\}\) denoting strong and weak users representing rows and columns, respectively. Therefore, a cost matrix (cost function) is formulated as \(m=u\times v\) to attain the best optimal match for both sets of users. The element in the \(u\)th row and \(v\)th column characterizes the sum rate or energy efficiency of the cost matrix in the NOMA system. The proposed HNG solution is presented in Algorithm 1. ```
Step 1: Formulation of cost matrix. a) Formulate the cost matrix \(m\). b) Find the largest possible value from the entire cost matrix and subtract it from each cost matrix element. Step 2: Reduction of row and column. a) Find the lowest value from each row and subtract it from every value of the same row. b) Find the lowest value from each column and subtract it from every value of the same column. Step 3: Optimization procedure. a) Checking of row. a) If exactly one zero in any row is found, mark the zero with a circle and draw a vertical line across it, but if not, skip that row. a) If all zeros are traversed with lines, then proceed to Step 4. But if not, do column checking. b) Checking of column. a) If exactly one zero in any column is found, mark the zero with a circle and draw a horizontal line across it, but if not, skip that column. a) Make confirmation whether all the zeros are traversed with lines. Step 4: If the number of circles is equal to the number of cost matrix rows, then proceed to Step 5, but if not, proceed to Step 3. Step 5: The marked circles are the objective function solutions for all marked users pairs. ```  
**Algorithm 1** User pairing based on Hungarian algorithm  
In the first step, the cost matrix \(m\) is formulated. Each user data rate or energy efficiency is first calculated, accompanied with the estimation of the total data rate (Mbps) or total energy efficiency (Mbits/Joule) that is assigned to the two users within the cost function (\(\mathrm{W}_{s,w}\) represents the total data rate, and \(\mathrm{E}_{s,w}\) represents the total energy efficiency for strong and weak user pairings). The main aim is to maximize the user's sum rate and energy efficiency. Therefore, the largest possible value is first determined and then deducted through the whole cost matrix (\(\mathrm{W}_{s,w}\) or \(\mathrm{E}_{s,w}\)). Tables 1 and 2 illustrate the \(\mathrm{W}_{s,w}\) and \(\mathrm{E}_{s,w}\) for 10 Users (UEs) available in the BS. The size of rows and columns is decreased by determining the minimum value in each of them in the second step. The determined value is deducted from corresponding row or column. \begin{table}
\begin{tabular}{c c c c c c  
The determination of the zero-element value in each row and column commences as the next optimization procedure in step 3. If any row has only one zero, a circle is drawn around the zero with a vertical line through it. A circle is drawn around the zero with a horizontal line through it if only one zero element appeared in a column. However, a row/column containing multiple zeros is skipped to proceed to the next row or column. For verification, the numbers of circles and rows are compared in the cost matrix in step 4. An equal number in the matching procedure is an indication of the optimal solution, while the contrary result takes the process back to step 3.