## 3 Fairness-Aware Power and Resource Block Allocation with Single Relay LTE-A Network
### BOPA Algorithm  
Bisection based optimal power allocation BOPA Algorithm 1 allocates the power to the RBs assigned to a particular user. Given the RB allocation from MT or SAMM and throughput of each user at equal power allocated to all RBs we can calculate \(\lambda\) \"rate parameter\" as given below:  
\[\lambda_{k}=\frac{R_{1}}{\alpha_{1}}=\frac{R_{2}}{\alpha_{2}}=...=\frac{R_{K}} {\alpha_{K}} \tag{12}\]  
where \(R_{k}\) is the rate of each user and \(\alpha_{k}\) is proportional rate constraint set for fairness [6]. Optimal power allocation is water filling operation and obtained for single user as  
\[\hat{p}_{k,n}=\max\left\{\frac{1}{\theta_{L}\ln 2}-\frac{1}{g_{k,n}},0\right\} \tag{13}\]  
where \(\theta_{L}\) is Lagrangian multiplier and its value is chosen such that \(R_{k}\) is satisfied. Hence, the user power can be expressed as \(P_{k}(\lambda\alpha_{k}|D_{k})\) and the total transmit power \(P_{T}(\lambda)\) can be rewritten as  
\[P_{T}(\lambda)=\sum\limits_{k\in K}P_{k}(\lambda\alpha_{k}|D_{k}) \tag{14}\]  
EE can be given as user rate divided by power consumed to achieve that rate.  
\[EE(\lambda)=\frac{\lambda\sum\limits_{k\in K}\alpha_{k}}{P_{T}}, \tag{15}\]  
and total transmit power is also limited by  
\[\lambda\leq\lambda_{\max}. \tag{16}\]  
According to [24] if transmit power \(P_{T}(\lambda)\) is strictly convex in rate then \(EE(\lambda)\) is quasi-concave, global optimal solution proof is given in the appendix of paper [22]  
\[f(\lambda)=P_{T}(\lambda)-\lambda\ln 2\sum\limits_{k\in K}\min_{n\in D_{k}} \left\{\frac{1+\hat{p}_{k,n}g_{k,n}}{g_{k,n}}\right\}\alpha_{k} \tag{17}\]Bisection method is a simple and robust. Since the method brackets the root, it is guaranteed to converge. We apply BOPA on the RB allocation scheme SAMM, an alternating MT and PF scheme for the relay-assisted LTE-A for the optimal power allocation with the objective of maximizing the EE. In addition, we trained neural network with the dataset generated by the BOPA. Since power is a monotonically increasing function of the rate parameter \(\lambda\), we apply bisection method on the following equation to find the root,  
\[P(\lambda)=\sum_{k}\sum_{n}\frac{2^{\lambda_{k}N}-1}{g_{k,n}}-P_{total}=0 \tag{18}\]  
```
1:Require:\(\hat{p}_{k,n}\) is the optimal power allocation matrix.
2:Ensure: Prior RB allocation through any algorithm and given as \(D_{k}\).
3:Getting all the \(\lambda\) then calculate \(\lambda_{max}\) which gives the max energy Efficiency by substitution in Equation (6).
4:Using \(\lambda_{max}\) set user rate as \(\alpha_{k}\)\(\lambda_{max}\), do water filling using Equation (13) and calculate f(\(\lambda_{max}\) ) based on Equation (17).
5:If f (\(\lambda_{max}\) ) \(\geq\) 0
6:Return ; \(\hat{p}_{k,n}\)
7:Else Go to Step 9;
8:End if
9:Set \(\lambda_{high}=\lambda_{max}\), \(\lambda_{low}\) = 0, \(\lambda_{current}=\lambda_{max}\) /2
10:Repeat: Set user rate according to \(\alpha_{k}\)\(\lambda_{max}\), do water filling using Equation (13) and calculate f(\(\lambda_{max}\)) based on Equation (17).
11:If f (\(\lambda_{current}\) ) \(>\) 0
12:Set \(\lambda_{low}=\lambda_{current}\)
13:Else Set \(\lambda_{high}=\lambda_{current}\)
14:End if
15:Set \(\lambda_{current}=\lambda_{high}+\lambda_{low}\) / 2
16:Return \(\hat{p}_{k,n}\)
17:End if
```  
**Algorithm 1** BOPA Algorithm