# Cooperative Multi-UAV Collision Avoidance Based on a Complex Network
## 3 Core Algorithm Analysis
### Representation of Cooperative UAV Flight and Conflict Detection  
The background of the problem is that when large scale UAV clusters meet, it is very likely that conflicts will occur. For simplicity, weather perturbations are not discussed when analyzing the trajectories. UAVs share a common airspace in the same or different flight levels, and a UAV cluster can be considered safe only if the separation between each UAV is larger than the given safety distance. A sequence of discrete points is used to model the trajectories of the UAV, and speed information can also be obtained from these discrete tracking points. Because UAV clusters frequently experience threats, and some threats are regarded as potential threats, it is more efficient to perform one resolution at a time rather than comprehensively considering each threat. By constructing a complex network of UAV groups and analyzing the nature of the network under threat conditions to determine the appropriate CA strategy, the human-machine group can self-organize CA under the condition of performance constraints, thus significantly improving the real-time performance and applicability of CA in UAV clusters. The key node in the complex network theory exhibits important properties [33; 34; 35; 36], and it exhibits the greatest effect on the entire complex network system. The UAV CA algorithm based on the complex network proposed herein considers the safety indicators of the UAV group system at each moment, such that the overall safety of the entire flight process is maximized. The CA system consists of two key algorithms: A key node selection algorithm and a collision direction-selection algorithm. The algorithm expresses the threat between the UAVs using a complex network. The UAV network model is established based on three parameters: Flight speed, flight angle, and security zone. In a real-time communication environment, all UAVs fly toward a given target and must perform CA operations. Each UAV owns a flight trajectory control module, and the CA resolution calculated by the CA system interacts with the surrounding UAVs through real-time data links. The UAV node is used to indicate that the state of the UAV is monitored by the system in real time. Its attributes are expressed as {UAV, velocity, position, angle, t, state, sense, strength, approaching time, time cost, key-node). The UAV indicates the UAV number, velocity indicates the UAV speed, position indicates the current position of the UAV, angle indicates UAV flight angle, t indicates the current time of the UAV, state indicates the UAV flight status,'sense' indicates that the UAV collision direction is selected,'strength' indicates the change direction of the UAV, 'approaching time' indicates the remaining time of the UAV approaching the nearest point, 'time cost' indicates the entire flight time consumption, and 'key-node' indicates whether the UAV was selected as a key node. To detect collisions, UAVs are identified in the Cartesian system. The motion of each UAV is driven by the following:  
\[\overrightarrow{R_{i}}(t)=\left[ \begin{array}{c}\overrightarrow{r}_{x,i}(t) \\ \overrightarrow{r}_{y,i}(t)\\ \overrightarrow{r}_{z,i}(t)\end{array} \right]V_{i}(t)=\overset{\cdot}{R_{i}}(t )=\left[ \begin{array}{c}\overset{\cdot}{r}_{x,i}(t)\\ \overset{\cdot}{r}_{y,i}(t)\\ \overset{\cdot}{r}_{z,i}(t)\end{array} \right]=\left[ \begin{array}{c} \overset{\cdot}{v}_{i}(t)\cos\varphi_{i}^{t}\cos\theta_{i}^{t}\\ \overset{\cdot}{v}_{i}(t)\cos\varphi_{i}^{t}\sin\theta_{i}^{t}\\ \overset{\cdot}{v}_{i}(t)\sin\varphi_{i}^{t}\end{array} \right] \tag{1}\]  
In the above formula, \(\overset{\cdot}{R_{i}}(t)\) and \(V_{i}(t)\) are defined as the position vector and speed vector, respectively, of \(UAV_{i}\) at time \(t\). The foot mark \(i\) represent \(i\)-th UAV. The subscript indicates the horizontal axis system and refers to the height. Let \(\theta_{i}^{t}\) designate the horizontal angle which is the direction of speed \(V_{i}(t)\) in the \(x-y\) plane (counter-clockwise along the \(x\) axis).