# Optimal Power Allocation with Hybrid Relaying Based on the Channel Condition
## 3 Optimal Power Allocation Schemes for Hybrid Relay Networks
### The DF and AF Relay Networks
#### 3.2.2 Case b (\(P_{s}|h_{1}|^{2}\geq P|h_{2}|^{2}\))  
Since \(0<\alpha_{da}<1\), we can derive the relation \(P_{s}|h_{1}|^{2}\geq\alpha_{da}P|h_{2}|^{2}\). Therefore, \(\min(P_{s}|h_{1}|^{2},\alpha_{da}P|h_{2}|^{2})\) in Equation (28) is determined as \(\alpha_{da}P|h_{2}|^{2}\).  
Firstly, we consider Case b(1) when \(\left|h_{2}\right|^{2}\
eq\left|h_{3}\right|^{2}\).  
Figure 2: Possible cases of \(\alpha_{da}\) in Case a for the DF-AF relay network. DF: decode-and-forward; AF: amplify-and-forward.  
The optimization problem in Equation (27) is rewritten as  
\[\max_{\alpha_{da}}\ f_{da,5}(\alpha_{da}),\ \ \ s.t.\ \ 0<\alpha_{da}<1, \tag{38}\]  
where \(f_{da,5}(\alpha_{da})\) is given by  
\[f_{da,5}(\alpha_{da})=\frac{P^{2}|h_{2}|^{2}|h_{3}|^{2}(\alpha_{da}-\alpha_{da} ^{2})}{\alpha_{da}P(|h_{2}|^{2}-|h_{3}|^{2})+P|h_{3}|^{2}+1}. \tag{39}\]  
By solving the equation \(\frac{\partial f_{da,5}(\alpha_{da})}{\partial\alpha_{da}}=0\), the optimal \(\alpha_{da}\) is obtained as  
\[\alpha_{da}=\frac{\sqrt{\lambda_{da}}-(P|h_{3}|^{2}+1)}{P(|h_{2}|^{2}-|h_{3}| ^{2})}, \tag{40}\]  
where \(\lambda_{da}=P^{2}(|h_{2}|^{2}|h_{3}|^{2}+|h_{2}|^{2}-|h_{3}|^{2})+2P|h_{3}|^{ 2}+1\).  
From Equation (34), we know that \(\alpha_{da}\) is the same as \(\omega_{da,2}\).  
Secondly, we consider Case b(2) when \(|h_{2}|^{2}=|h_{3}|^{2}\).  
By using \(|h_{da}|^{2}=|h_{2}|^{2}=|h_{3}|^{2}\), the optimization problem in Equation (27) is rewritten as  
\[\max_{\alpha_{da}}\ f_{da,6}(\alpha_{da}),\ \ \ s.t.\ \ 0<\alpha_{da}<1, \tag{41}\]  
where \(f_{da,6}(\alpha_{da})\) is given by  
\[f_{da,6}(\alpha_{da})=\frac{P^{2}|h_{da}|^{4}(\alpha_{da}-\alpha_{da}^{2})}{P |h_{da}|^{2}+1}. \tag{42}\]  
By solving the equation \(\frac{\partial f_{da,6}(\alpha_{da})}{\partial\alpha_{da}}=0\), the optimal \(\alpha_{da}\) is obtained as \(1/2\).  
From Equations (29) and (34), we know that \(\omega_{da,1}\) does not depend on \(|h_{3}|^{2}\), and \(\omega_{da,2}\) does not depend on \(P_{s}\) and \(|h_{1}|^{2}\).  
The algorithm in Figure 3 explains the procedure to determine \(\alpha_{da}\) for the DF and AF relay network.  
Figure 4 shows the flow chart of full procedures to illustrate the proposed optimal power allocation schemes.  
Figure 4: Flow chart of the proposed optimal power allocation schemes.  
Figure 3: Algorithm for the three-hop DF and AF relay networks.  
From Equations (19) and (20), the complexity of finding \(\alpha_{ad}\) in AF-DF relay network can be determined as \(14O^{2}+6O\). The \(O^{2}\) represents the operation of multiplication or division. The operation of addition, subtraction, or comparison is expressed as \(O\). From the algorithm for the DF-AF relay network in Figure 3, the complexity to find \(\alpha_{da}\) can be calculated as \(9O^{2}+10O\). Because the proposed optimal power allocation schemes provide the closed form-based formula, the complexity of the proposed schemes is much less than for the grid search schemes. The grid search schemes find the \(\alpha_{ad}\) and \(\alpha_{da}\) that enable to maximize the achievable rate by changing the values of \(\alpha_{ad}\) and \(\alpha_{da}\) at a fixed interval or step size in the range of 0-1, respectively.  
In this paper, we consider the values of 0.01 and 0.1 as the step sizes. From Table 1, we know that the grid search schemes with step size \(\Delta=0.01\) and 0.1 have much higher complexity than the proposed schemes because they perform exhaustive search procedures. Therefore, the proposed optimal power allocation schemes provide not only low complexity but also optimal performance.