# Resource Allocation for Relay-Based OFDMA Power Line Communication System
## 3 The Optimal Resource Allocation Strategy for a PLC System
### The Subcarrier Allocation Strategy  
Assume the resource allocation strategy is any given, the power on subcarrier \(n\) is \(P_{n}^{{}^{\prime}}\), and the information rate can be written as \(R_{n}^{{}^{\prime}}\ (n\in\Omega_{T})\). Let the \(n\)-th subcarrier licensed to the \(k\)-th PLC users that with the best forward channel, that is  
\[k_{n}^{*}=\arg\ \max_{k}\ \{|h_{n,1}^{2}|^{2},\cdots,|h_{n,K}^{2}|^{2}\},\ \ \ m\in\Omega_{T}, \tag{13}\]  
then  
\[\max_{x_{n}}\ \ f(\mathbf{x})=\sum_{n\in\Omega_{T}}\log_{2}\left(1+ \frac{x_{n}}{b_{n}x_{n}+c_{n}}\right),\] (17) s.t. \[\sum_{n\in\Omega_{T}}x_{n}=P_{S},\] \[\sum_{n\in\Omega_{T}}\theta_{m}x_{n}=I_{tol},\ \ \ \ \ x_{n}\geq 0,\ \ \ \forall\ n,\]  
where the constraint function \(h_{1}(x_{m})=\sum_{m\in\Omega_{T}}x_{m}-P_{S}\) and \(h_{2}(x_{m})=\sum_{m\in\Omega_{T}}\theta_{m}x_{m}-I_{th}\) is affine function, respectively. Therefore, the optimization problem (17) is convex optimization problem, which can be solved by the Karush-Kuhn-Tucher (KKT) conditions. In the following, based on the subcarrier allocation strategy, we discuss the optimal power control scheme with both the power and interference constraints by using the Lagrangian multiplier method. The Lagrangian function of (17) is given by  
\[L=f(\mathbf{x})+\sum_{n\in\Omega_{T}}\lambda x_{n}-\
u_{1}\left( \sum_{n\in\Omega_{T}}x_{n}-P_{S}\right)-\
u_{2}\left(\sum_{n\in\Omega_{T}} \eta_{n}x_{n}-I_{tol}\right). \tag{18}\]  
where \(\lambda\) is a constant. Let \(\frac{\partial L}{\partial x_{n}}=0\), the derivative of (18) with respect to \(x_{n}\) is given by  
\[G_{n}(x_{n})+\lambda-\
u_{1}-\eta_{n,m}\
u_{2}=0, \tag{19}\]  
where  
\[G_{n}(x_{n})=\frac{c_{n}}{(b_{n}x_{n}+c_{n})(b_{n}x_{n}+x_{n}+c_{n})}. \tag{20}\]  
according to the KKT (i) condition [40; 41; 42], i.e., \(\lambda\geq 0\), we can obtain  
\[\
u_{1}+\eta_{n}\
u_{2}\geq G_{n}(x_{n}), \tag{21}\]  
with KKT condition (ii), i.e., \(\lambda x_{n}=0\), substituting (19) into (21), we can obtain  
\[\left[\
u_{1}+\eta_{n,m}\
u_{2}-G_{n}(x_{n})\right]x_{n}=0. \tag{22}\]  
Since \(x_{n}\) denotes the power allocated on the \(n\)-th subcarrier, which is non-negative real number. Let \(z_{n}\triangleq\frac{1}{c_{n}}\), we can obtain  
\[\left\{ \begin{array}{ccc}x_{n}>0\,&\
u_{1}+\eta_{n}\
u_{2}=G_{n}(x_{n})<G_{n} (0)=z_{n},&\forall\ n\in\Phi_{1},\\ x_{n}=0\,&\
u_{1}+\eta_{n}\
u_{2}\geq G_{n}(0)=z_{n},&\forall\ n\in\Phi_{2}. \end{array} \right. \tag{23}\]  
where \(\Phi_{1}\bigcup\Phi_{2}=\Omega_{T}\), \(\Phi_{1}\bigcap\Phi_{2}=\emptyset\). When \(x_{m}>0\), substituting (23) into (19), we can obtain  
\[x_{n}=\frac{c_{n}}{b_{n}(b_{n}+1)}\left[\sqrt{1+\frac{b_{n}(b_{n}+1)}{c_{n}( \
u_{1}+\eta_{n,m}\
u_{2})}}-b_{n}-1\right]^{+}, \tag{24}\]  
where \([x]^{+}=\max\{0,x_{n}\}\), parameters \(\
u_{1},\ \
u_{2}\) are determined by the two equality equations of power and interference constraints. (24) gives the expression of the optimal solution for (17) and in what follows, we will prove there exists a unique solution that satisfies (24). Assume the subcarrier sets \(\mathcal{N}_{1},\ \mathcal{N}_{2}\subseteq\Omega_{T},\overline{\mathcal{N}}_{1},\ \overline{ \mathcal{N}}_{2}\) is the complement set, respectively. Let \(\mathcal{N}_{0}=\mathcal{N}_{1}\bigcap\mathcal{N}_{2},\ \mathcal{M}_{0}=\mathcal{N}_{1}\bigcup \mathcal{N}_{2},\ \mathcal{C}_{1}=\mathcal{N}_{1}-\mathcal{N}_{0},\ \mathcal{C}_{2}=\mathcal{N}_{2}- \mathcal{N}_{0}\), and suppose the power allocation solution of (24) is exist in subcarrier sets \(\mathcal{N}_{1}\) and \(\mathcal{N}_{2}\) simultaneously, we have  
\[\left\{ \begin{array}{ll}x_{n\in\mathcal{N}_{1}}(v_{1},v_{2})>0,\ \ \ x_{n\in\overline{\mathcal{N}}_{1}}(v_{1},v_{2})\leq 0,\\ x_{n\in\mathcal{N}_{2}}(v^{\prime}_{1},v^{\prime}_{2})>0,\ \ \ x_{n\in\overline{\mathcal{N}}_{2}}(v^{ \prime}_{1},v^{\prime}_{2})\leq 0.\end{array}