# A Low Complexity Persistent Reconnaissance Algorithm for FANET
## 3 Algorithm Description
### PSO-Based TARFC
It should be noted that during the simulation, the speed change could be out of the actual. Hence, we bring in a velocity clamping method [34] as shown in Equation (13),  
\[v_{i,j}^{l+1}= \begin{cases}v_{i,j}^{l+1}&\text{if }v_{i,j}^{l+1}\in\left[-V_{j}^{ \max},V_{j}^{\max}\right]\\ \frac{v_{i,j}^{l+1}}{|v_{i,j}^{l+1}|}V_{j}^{\max}&\text{otherwise}\end{cases}  \tag{13}\]where \(v_{i,j}^{l+1}\) is the \(j\)th element of \(v_{i}^{l+1}\), and \(V_{j}^{\max}\) is the velocity clamping threshold. If the modified position can obtain better results in \(\widetilde{f}\), the pBest and gBest for each particle will be altered, as explained in lines 11-18. Eventually, the algorithm terminates when it meets the termination condition, i.e., it runs to a preset number of iterations, or the results no longer improve in a certain number of iterations (line 19). ```
Input: \(r^{C}\), \(r^{S}\), \(r_{thr}\), \(X_{A}\), \(X_{M}\), \(\rho\), \(\varphi\big{(}x\big{)}\), \(w^{M}\), \(w^{C}\), \(w^{T}\) Output: \(x^{*}\)
1 Set PSO-related parameter, KKT-related parameters. \({}^{2}\)Randomly initialize particles \(\big{(}x_{i},v_{i}\big{)}\in\mathbb{N}\), and establish links \(\rho\big{(}X_{A},X_{M},x_{i}^{*}\big{)}\) \({}_{3}g\leftarrow\underset{i}{\text{arg max }}\widetilde{f}\big{(}X_{r^{S}},\big{\{} \varepsilon_{m}\big{\}}_{m\,M},\varphi\big{(}x\big{)},r_{thr},\big{\{}\rho_{m} \big{\}}_{i}^{*}\big{)}\) for each particle \(i\) \(4\,x^{*}\leftarrow\max\big{(}x_{g}^{*}\big{)}\) and \(\big{\{}\rho_{m}\big{\}}^{*}\leftarrow\big{\{}\rho_{m}\big{\}}_{g}^{*}\) 5 While termination conditions are not met \({}^{6}\) Obtain the \(X_{A}\), \(X_{M}\) at the current moment \({}^{7}\) Obtain the threat PDF \(\varphi\big{(}x\big{)}\) of the current search space \({}^{8}\) Update \(x_{i}\), \(v_{i}\) according to (12, 13) \({}^{9}\) For each particle \(\big{(}x_{i},v_{i}\big{)}\in\mathbb{N}\)do \(\big{\{}\rho_{m}\big{\}}_{i}\leftarrow\rho\big{(}X_{A},X_{M},x_{i}\big{)}\) \({}^{11}\) If \(\widetilde{f}_{t}>\widetilde{f}_{t-1}\) then \(x_{i}^{*}\gets x_{i}\) and \(\big{\{}\rho_{m}\big{\}}_{i}^{*}\leftarrow\big{\{}\rho_{m}\big{\}}_{i}\) \({}^{13}\) End if \({}^{14}\) End for \({}^{15}\)\(g\leftarrow\underset{i}{\text{arg max }}\widetilde{f}\big{(}X_{r^{S}},\big{\{} \varepsilon_{m}\big{\}}_{m\,M},\varphi\big{(}x\big{)},r_{thr},\big{\{}\rho_{m} \big{\}}_{i}^{*}\big{)}\) for each particle \(i\) \(\widetilde{f}_{t}\Big{(}X_{r^{S}},\big{\{}\varepsilon_{m}\big{\}}_{m\,M}, \varphi\big{(}x\big{)},r_{thr},\big{\{}\rho_{m}\big{\}}_{i}^{*}\big{)}\) \({}^{16}\) If \(\widetilde{f}_{t-1}\Big{(}X_{r^{S}},\big{\{}\varepsilon_{m}\big{\}}_{m\,M}, \varphi\big{(}x\big{)},r_{thr},\big{\{}\rho_{m}\big{\}}^{*}\Big{)}\) then \({}^{17}\) \({}^{18}\) End if \({}^{19}\)Until termination conditions are satisfied
```  
**Algorithm 1**Threat Avoidance and Reconnaissance FANET Construction  
Although the TARFC algorithm provides FANETs with a feasible network construction method to perform reconnaissance tasks in threatening scenarios, in most real reconnaissance missions, such as military target reconnaissance, to remain undetected, UAVs cannot influence the movement of the detected targets or the relevant scene's alteration. This puts forward a \"sustainable\" reconnaissance requirement for the FANET. As for algorithm II, every FANET adjustment according to the changing targets or scene requires a large number of iterations, which is extremely time consuming. For this reason, in the following Sections 3.3 and 3.4, we first propose an indicator called Total edit distance to measure the variation degree of the FANET and the threat PDF change in related scenarios. Secondly, a low-complexity algorithm named TA&CRFO is proposed. According to the above indicators, the algorithm can conduct two different adjustment modes for the FANET to meet the needs of \"sustainable\" in real situations.