# An Evolutionary Algorithm to Optimise a Distributed UAV Swarm Formation System
## 6 Conclusions  
In this article, we have proposed an optimisation algorithm and tested two different crossover operators to optimise the configuration of a swarm of autonomous UAVs when performing a formation surrounding a rogue drone. This is a complex problem wherein the swarm members use the novel distributed formation algorithm (DFA3) to self-organise and achieve the desired formation by using only communication beacons and a set of parameters. Hence, the calculation of these optimal parameters is challenging and prone to be done by using an intelligent algorithm such as a metaheuristic. Consequently, we have designed a hybrid EA built with a genetic algorithm and a local search stage at the end of the optimisation process to better exploit the best solution found by the first stage. The optimisation results showed that the proposed EA outperformed the RS results in all the case studies as expected, whereas for swarms of three and five UAVs, both tested EAs (EA.ucx using a uniform crossover operator and EA.dcx using a drone crossover operator) presented similar results. In the most difficult case study featuring 10 UAVs, the proposed alternative algorithm (EA.dcx) outperformed the other two, achieving better fitness values, which were statistically validated. Having obtained the optimal parameter set for each swarm, we have tested them on 90 unseen scenarios (UAVs in different initial positions) to address the robustness of the swarm configurations. From our results, we can conclude that the formation problem using the proposed DFA3 is viable and it achieves competitive results when using an intelligent algorithm, e.g., EA, to calculate the system parameters. The two EA variants proposed performed well in most of the 300 tested scenarios although some overfitting was observed. Hence, the proposed DFA3 and the proposed hybrid EAs are capable of achieving accurate formations by using three UAVs and five UAVs, while for swarms of 10 UAVs, successful formations were built in 95% of cases with plus/minus 10% accuracy. As a matter of future work, it would be interesting to address more case studies as well as the main issue observed, the aforementioned overfitting, by using a higher number of optimisation scenarios or even using a different technique such as \(k\)-fold cross validation. Because the number of experiments is limited by the required simulation time (if we want realistic simulations), we would like to study the use of surrogates to speed up the optimisation process and then validate the results by using heavy simulations. We plan to study robot failures to assess how the swarm rebuilds a broken formation using the initial configuration, e.g., eight- or nine-UAV swarm using the parameters calculated for 10 UAVs. Different formation shapes are also to be studied and the ways the DFA3 can be modified to achieve such other formations. Currently, we are working in the implementation of the DFA3 by using real UAV robots to validate in vivo the results we have observed and presented in vitro. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Case Study**} & \multirow{2}{*}{**Algorithm**} & \multicolumn{3}{c}{**D\({}_{\text{rd}}\)+ (m)**} & \multicolumn{1}{c}{**Shape**} & \multicolumn{1}{c}{**Shape**} \\  & & **Minimum** & **Mean** & **Maximum** & **(\(\pm\)5\%)** & **(\(\pm\)10\%)** \\ \hline \multirow{3}{*}{3 UAVs} & RS & **5.052** & 5.063 & 5.080 & **100.0\%** & **100.0\%** \\  & EA.ucx & 5.031 & **5.039** & **5.045** & **100.0\%** & **100.0\%** \\  & EA.dcx & 5.005 & 5.067 & 5.099 & **100.0\%** & **100.0\%** \\ \hline \multirow{3}{*}{5 UAVs} & RS & 4.887 & **5.018** & 5.286 & 56.7\% & **100.0\%** \\  & EA.ucx & 4.986 & 5.097 & 5.286 & 47.8\% & **100.0\%** \\  & EA.dcx & **5.001** & 5.059 & **5.118** & **100.0\%** & **100.0\%** \\ \hline \multirow{3}{*}{10 UAVs} & RS & 4.186 & **5.053** & 5.617 & 0.0\% & 0.0\% \\  & EA.ucx & 4.709 & 5.109 & 5.683 & 0.0\% & **93.3\%** \\ \cline{1-1}  & EA.dcx & **4.768** & 5.254 & **5.598** & 0.0\% & 51.1\% \\ \hline \hline \end{tabular}
\end{table}