## 4 An Analysis on the Stability of the Visual Reference Topological Structure
### Calculation of Network Connectivity in the Undirected Topological Diagram  
To calculate the network connectivity of the visual topological diagram for different scale UAV clusters, we adopted the algorithm mentioned in the Reference [53], which is more straightforward than the traditional algorithm. The flow chart of the algorithm is as shown in Figure 22. Condition: Suppose that \(G\) has \(n\) vertexes \(v_{i}\) (\(i=1,2,\cdots,n\)); then, the adjacent matrix is \(C=(c_{ij})_{n\times n}\). If \(v_{i}\) and \(v_{j}\) are adjacent, \(c_{ij}=1\). Otherwise, \(c_{ij}=0\). Here, \(d_{i}\) refers to the degree of the vertex \(v_{i}\). Matlab Simulations of Network Connectivity of Nested Magic Squares' Topological Structure under Different-Scale UAV Formations  
This chapter employed the matlab simulation of the network connectivity of the topological structure from 3 \(\times\) 3 to 83 \(\times\) 83 nested magic squares formation according to the connectivity algorithm. The regression curve equation of the connectivity was concluded, as shown in Table 2, and Figure 23.  
Figure 22: The algorithm flow chart of the undirected network connectivity. This study used the least square method to establish the regression model curve via the network values of different-scale network topological diagrams, as shown in Figure 23. Thus, the network connectivity values of topological structures of any scale nested magic squares can be calculated.The regression model curve equation is:  
\[K(G)=-30.7292-0.0146(M_{n})+26.3306\log_{10}(M_{n}) \tag{16}\]  
where \(K(G)\) represents the network connectivity index and \(M_{n}\) refers to the UAV cluster number. According to the simulation results, the 95% confidence intervals of the gradients were [0.0131, 0.0161] and [21.9585, 30.7027], and the 95% confidence interval of the intercepts was [\(-41.4515\), \(-20.0070\)]. The intercepts and gradients of the regression model curve equation satisfied the requirement. The network connectivity index of the visual reference \begin{table}
\begin{tabular}{c c} \hline
**UAV Cluster Number** & **Network Connectivity Value** \\ \hline  
\hline \end{tabular}
\end{table} 
Table 2: Network connectivity values of different-scale UAV formations. Figure 23: Connectivity regression curve of different-scale UAV clusters. topological diagram had an R2 variance-explained rate of 0.9937, proving the significance test of the regression equation with excellent fitting. According to the fitted curve equation, the cluster accelerated in expanding, but the network connectivity increased rather slowly. However, the network connectivity is an index to evaluate the trivial graph formed after deleting k nodes in the network topological diagram. Thus, applying nested magic squares' network topological diagrams into large-scale formations could help to greatly enhance the stability of UAV formations. The simulation results show that, at a formation size of 961 UAVs, the resulting visual reference network topology subgraph is still connected after the loss of a random 60 UAVs. Dynamic Self-Healing of Grid Formation Based on the 3 \(\times\) 3 Magic Square and the Chain Rules of Visual Reference  
We calculated the network connectivity and concluded that the topological structure of nested magic squares has relatively high static stability. Still, the formation based on the 3 \(\times\) 3 magic square and the chain rules of visual reference could lead to better stability. For instance, the UAV at square 4 in the dotted rectangle in Figure 13 has 16 planes that satisfy the reference principle, as shown in Figure 14. If the adjacent UAVs at squares 5, 9, 5, 3, 5, 9, 5, and 3 (UAVs in the blue dashed box) in directions 1-8 were destroyed due to fire attacks, the UAV at square 4 could seek reference from 8 UAVs (UAVs in the green dashed box) in its periphery.