# A Glider-Assisted Link Disruption Restoration Mechanism in Underwater Acoustic Sensor Networks
## 4 The GALO Algorithm
### The GALO Algorithm  
As the pitch angle \(\theta\) of the glider during gliding is related to the system dynamics parameters, under the control parameters of the \"Petrel\", the range of the pitch angles of the glider in steady-state gliding is \((-69.5^{\circ},-9.2^{\circ})\cup(9.2^{\circ},69.5^{\circ})\). Therefore, due to the limitation of the movement characteristics, there are two situations for solving the nonlinear programming problem:  
* The glider's trajectory intersects with the volume where the objective function is optimal. * The glider's trajectory does not intersect with the volume where the objective function is optimal. For different situations, we need to have different methods. For Case 1 where the trajectory intersects with the optimal region, the optimal solution of the problem can be obtained for the problem. Then the NLP problem can be solved by the multiplier method to obtain the optimal solution to the problem. For Case 2 where the trajectory does not intersect with the optimal region, the optimal solution to the problem does not exist. Then the problem can be transformed into solving the minimum distance between the glider trajectory coverage volume \(A_{1}\) and the optimal region \(A_{2}\). We take this point that meets the minimum distance on the trajectory as the suboptimal solution to the NLP problem. That is, the problem is transformed into the objective function \(\min[d(A_{1},A_{2})]\). Specific solution steps are as follows:  
* The glider's trajectory intersects with the volume where the objective function is optimal. The problem can be solved by multiplier method (PHP) and the corresponding augmented Lagrange function is shown as (8): \[ \begin{array}{l}M(x,\lambda,\delta)=\sqrt{(TL_{gg}-TL_{gg^{*}})^{2}+(TL_{gb} -TL_{gb^{*}})^{2}}-\lambda_{3}\cdot trail(x)+\frac{\delta}{2} trail^{2}(x)+\frac{1}{2\alpha}[\{\max\{0,\lambda_{1}-\delta(TL_{ dH}\\ -TL_{gg})\}]^{2}-\lambda_{1}{}^{2}}+\frac{1}{2\alpha}[\{\max\{0,\lambda_{2}- \delta(TL_{th2}-TL_{gb})\}]^{2}-\lambda_{2}{}^{2}\}\\ \end{array} \] (8)where \(\lambda=(\lambda_{1}\),\(\lambda_{2}\),\(\lambda_{3})^{\mathrm{T}}\) is the corresponding Lagrange multiplier vector. The corresponding multiplier iteration formula is shown as (9): \[ \begin{array}{l}\lambda_{1}{}^{k+1}=\lambda_{1}{}^{k}-\delta(TL_{th1}-TL_{ag}) \\ \lambda_{2}{}^{k+1}=\lambda_{2}{}^{k}-\delta(TL_{th2}-TL_{gb})\\ \lambda_{3}{}^{k+1}=\max\Bigl{\{}0,\lambda_{3}{}^{k}-\delta\mathit{trail}(x^{k })\Bigr{\}}\end{array} \] (9) The original problem (5) is converted to the following unconstrained optimization problem (10): \[\min\Bigl{\{}M(x,\lambda^{k},\delta_{k})\Bigr{\}}\] (10) By separately taking partial derivative of the variable \(x_{1}\),\(x_{2}\),\(x_{3}\) and making \(\frac{\partial M}{\partial x_{1}}=\frac{\partial M}{\partial x_{2}}=\frac{ \partial M}{\partial x_{3}}\ =\ 0\), the optimal solution \(x^{k}=(x_{1}{}^{k},x_{2}{}^{k},x_{3}{}^{k})^{\mathrm{T}}\) can be obtained separately and then substituted into Equation (11) to calculate whether the termination rule is established: \[\phi_{k}:=\{\mathit{trail}^{2}(x)+[\min\{TH_{th1}(x)-TL_{sg}(x),\frac{\lambda_{ 1}^{k}}{\delta}\}]\}^{2}+[\min\{TH_{th2}(x)-TL_{gb}(x),\frac{\lambda_{1}^{k}}{ \delta}\}]\}^{2}\Bigr{\}}^{2}<\epsilon\] (11) If Equation (11) works, the solution is the approximate optimal solution, and if not, it will be brought into Equation (9) to continue calculating for the next iteration until Equation (11) works. At this point, the optimal relay position of glider for link restoration is \(x^{*}=(x_{1}{}^{*},x_{2}{}^{*},x_{3}{}^{*})^{\mathrm{T}}\). * The glider's trajectory does not intersect with the volume where the objective function is optimal. Since the glider's trajectory is limited, the glider may not be able to go through the optimal position represented by Equation (5). The nearest point in the volume \(A_{1}\) to the volume \(A_{2}\) is selected as the sub-optimal solution.