# Graph Layer Security: Encrypting Information via Common Networked Physics
## 3 GLS Encryption Using Physical Networked Dynamic
### Relay Selection & Weight Computation
#### 3.2.2 Weight Computation  
After the derivation of the physical networked dynamic surrogate in Equation (15), we elaborate the process to approximate the non-concave maximisation problem in Equation (9) into a convex minimisation form for optimal (sub-optimal) weight computation. By replacing the unknown networked dynamic matrix \(\mathbf{X}\) with the surrogate matrix \(\mathbf{\Gamma}\), we rewrite Equation (9) as follows:  
\[ \begin{split}\max_{\boldsymbol{\alpha}^{(Tx,Rx)}}\Bigg{[}& \log_{2}\Bigg{(}1+\frac{\mathbb{E}(\mathbf{s})^{2}}{\|\mathbf{ \Gamma}^{T}\cdot\boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{F}^{2}+\| \boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{2}^{2}\cdot\sigma^{2}}\Bigg{)}\\ &-\max_{j\in\{Tx,Rx\}}\log_{2}\Bigg{(}1+\frac{\mathbb{E}( \mathbf{s})^{2}}{\|\boldsymbol{\alpha}_{j}^{(Tx,Rx)}\cdot\mathbf{\Gamma}_{j _{:}}\|_{2}^{2}}\Bigg{)}\Bigg{]}^{+}.\end{split}  \tag{16}\]  
We firstly remove the operator \([\cdot]^{+}\), and prove that the optimal value of Equation (16) is same as that of the following form:  
\[ \begin{split}\max_{\boldsymbol{\alpha}^{(Tx,Rx)}}\Bigg{[}& \log_{2}\Bigg{(}1+\frac{\mathbb{E}(\mathbf{s})^{2}}{\|\mathbf{ \Gamma}^{T}\cdot\boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{F}^{2}+\| \boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{2}^{2}\cdot\sigma^{2}}\Bigg{)}\\ &-\max_{j\in\{Tx,Rx\}}\log_{2}\Bigg{(}1+\frac{\mathbb{E}( \mathbf{s})^{2}}{\|\boldsymbol{\alpha}_{j}^{(Tx,Rx)}\cdot\mathbf{\Gamma}_{j _{:}}\|_{2}^{2}}\Bigg{)}\Bigg{]}.\end{split}  \tag{17}\]  
Suppose \(L_{1}\) and \(L_{2}\) are the optimal values of Equation (16) and Equation (17), respectively. It is straightforward that \(L_{1}\geq L_{2}\), as Equation (16) always takes the maximal value from Equation (17) and 0. Then, denote \(\boldsymbol{\alpha}_{*}\) as the solution of Equation (16) corresponding to the maximal value \(L_{1}>0\). The value of Equation (17) at \(\boldsymbol{\alpha}^{*}\) equalling \(L_{1}\) suggests that the maximal value of Equation (17), i.e., \(L_{2}\), is no less than \(L_{1}\), i.e., \(L_{2}\geq L_{1}\). This, combined with the aforementioned analysis of \(L_{1}\geq L_{2}\), proves that \(L_{1}=L_{2}\), which validates the replacement of original objective function in Equation (16) with that of Equation (17). The problem then is converted to minimise the opposite of Equation (17), i.e.,  
\[ \begin{split}\min_{\boldsymbol{\alpha}^{(Tx,Rx)}}\Bigg{[}& -\log_{2}\Bigg{(}1+\frac{\mathbb{E}(\mathbf{s})^{2}}{\|\mathbf{ \Gamma}^{T}\cdot\boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{F}^{2}+\| \boldsymbol{\alpha}^{(\mathrm{Tx,Rx})}\|_{2}^{2}\cdot\sigma^{2}}\Bigg{)}\\ &+\max_{j\in\{Tx,Rx\}}\log_{2}\Bigg{(}1+\frac{\mathbb{E}( \mathbf{s})^{2}}{\|\boldsymbol{\alpha}_{j}^{(Tx,Rx)}\cdot\mathbf{\Gamma}_{j _{:}}\|_{2}^{2}}\Bigg{)}\Bigg{]}.\end{split}  \tag{18}\]In Equation (18), it is seen that the second term is a convex function with respect to \(\alpha_{j}^{(\text{Tx},\text{Rx})}\). We will then make the first term of Equation (18) convex, by introducing a slack variable \(\beta\). The objective problem in Equation (18) is converted as:  
\[\min_{\mathbf{\alpha}^{(\text{Tx},\text{Rx})}\atop\beta} \bigg{[}-\log_{2}\bigg{(}1+\frac{\mathbb{E}(\mathbf{s})^{2}}{\beta}\bigg{)}+ \max_{j\in\{Tx,Rx\}}\log_{2}\Bigg{(}1+\frac{\mathbb{E}(\mathbf{s})^{2}}{\| \alpha_{j}^{(Tx,Rx)}\cdot\mathbf{\Gamma}_{j,\cdot}\|_{2}^{2}}\Bigg{)}\bigg{]} \tag{19}\] \[\text{s.t.}\ \|\mathbf{\Gamma}^{T}\cdot\mathbf{\alpha}^{(\text{Tx},\text{Rx})} \|_{F}^{2}+\|\mathbf{\alpha}^{(\text{Tx},\text{Rx})}\|_{2}^{2}\cdot\sigma^{2}- \beta\leq 0. \tag{20}\]  
In Equation (19), \(\beta\) is assigned as an upper-estimator of \(\|\mathbf{\Gamma}^{T}\cdot\mathbf{\alpha}^{(\text{Tx},\text{Rx})}\|_{F}^{2}+\|\mathbf{ \alpha}^{(\text{Tx},\text{Rx})}\|_{2}^{2}\cdot\sigma^{2}\), therefore making the objective function in Equation (19) an upper-estimator of that in Equation (18). As such, the minimisation problem in Equation (18) can be converted to minimising its upper-estimator in Equation (19) with the constraint in Equation (20).