# A Novel Resource Allocation Scheme in NOMA-Based Cellular Network with D2D Communications
### Principles of Tree-Based Search Power Allocation Algorithm  
In this section, we suppose that the power \(q_{l}\) assigned to the transmission from the transmitter CU\(l\) to receiver (DR) in each D2D group is a fixed value which can be calculated by (20) with the condition that \(\mathrm{SINR}_{\mathrm{L},un}^{D2D}=\mathrm{SINR}_{thr}^{D2D}\). Note that, by NOMA technology, some access algorithms can allocate power in a gradient increasing way with the deterioration of the users' channel state. This method simply calculates the representation of the objective function and need not derivative in the process of solving the problem. In order to reduce the cost of computing compared with [30] and [32], we propose a tree-based search power allocation algorithm, which gives a suboptimal method to maximize the system sum rate. In NOMA, the main interference is from low power signals which cannot be eliminated by SIC. Through the decoding order, because the channel gain of a CU in the cell center is larger, a lower power is allocated to the CU. Thus, by using the SIC technology, other users can gain greater SINR after eliminating the interference of the CUs with higher power and hence have better system performance. We set the target of power allocation to be maximizing the arithmetic average of achievable user data transmission rates of each SC. The optimization problem can be obtained as  
\[\left\{\beta_{1,m},\beta_{2,m},\cdots,\beta_{n_{m},m}\right\}=\mathrm{argmax} \bigg{\{}\frac{1}{n_{m}}\sum\
olimits_{k=1}^{n_{m}}R_{k,m}\bigg{\}}, \tag{22}\]  
\[s.t.\ 0<\beta_{i,m}<1,i=1,2,\cdots,n_{m} \tag{23}\]  
\[\beta_{i,m}\leq\beta_{j,m},i=1,2,\cdots,n_{m}-1,i<j \tag{24}\]  
\[\sum\
olimits_{i=1}^{n_{m}}\beta_{i,m}=1 \tag{25}\]  
where \(\beta_{i,m}\) represents a proportional coefficient of the power value that can be allocated to each CU on SC\(m\). (22) is the objective function and constraint (23) is imposed to guarantee the power allocated to the CUs will not exceed the total power from the BS. Constraint (24) shows the power allocated to the CUs of the same SC follow the policy for SIC decoding order. Constraint (25) presents that all the power can be allocated to the CUs. \(n_{m}\) is the max number of CUs on SC\(m\). In the tree model of TSA, we need to explain several concepts. The first one is the node of the tree which represents a candidate coefficient \(\beta\) of the assigned power. The second one is the depth of a node which is defined by the length of the path from the root to the node. In addition, the nodes with the same depth are identified to be in the same layer and the quantity of the layers depends on the number of the non-orthogonal users on the same SC. Then we define the branches, each of which connects the nodes of two adjacent layers. The tree model of TSA is shown in Figure 2. \(\beta_{k,m},\forall k\in N\) represents the power coefficients allocated to the users in the \(k-\)th layer on SC\(m\). In a descendant order of the SINR of the CUs according to (5), the coefficients \(\beta\) also satisfy (23)-(25), which means the coefficient in current layer cannot be higher than the next layer and cannot be lower than the previous layer at the same time. Two specific conditions that need to be met are shown as follows:  
\[0<\beta_{1,m}\leq\frac{1}{n_{m}} \tag{26}\]  
\[\beta_{k-1,m}\leq\beta_{k,m}\leq\frac{1-\sum_{j=1}^{k-1}\beta_{j,m}}{n_{m}-k+1} \tag{27}\]  
where \(k\in N\). In Figure 2, the power allocated to the CUs in each layer is in the order from low to high. The survival nodes and the redundant nodes in the tree represent whether the power assigned to the current CU can satisfy the requirement of the target function. The path through the redundant node is called a redundant path which does not undergo the search process of the next layer. Therefore, it reduces the searching complexity compared with the ESA. Similarly, the paths through the survival nodes are survival paths. Finally, the longest path becomes the final path containing all the power allocation coefficients of the CUs every layer.