# Cooperative Multi-UAV Collision Avoidance Based on a Complex Network
## 3 Core Algorithm Analysis
### Direction of Collision Avoidance
This implies that after the critical node is cleared, the robustness of the connection and the number of connected components should be as low as possible. This implies that the UAVs are leaving each other and the risk of crashes is becoming smaller. Meanwhile, this model also considers the number of intruder UAVs of the corresponding direction, implying that a lesser domino effect will occur because the density of the intruder UAV is small due to the sense selected by the model. In the simulation step, the new model obtains the key nodes and evaluates the robustness of the connections or the number of connected components when different choices are made by the critical nodes. The key nodes will select the course of change and form a new network in the next simulation step. The new model will again select the key node. The model will monitor multiple UAV systems to determine if a TA alert is present; if the model stops searching for critical nodes, multiple UAV systems will be considered safe. It is noteworthy that this method is a solution to the deadlock problem. The reasons for solving the deadlock problem are as follows: During the entire simulation period, the threat detection between real-time UAVs is performed and the network is built in real time; the key nodes are selected, and the direction of CA is selected. Therefore, the deadlock problem can be avoided. The algorithm proposed in this paper has a simple logical structure and strong stability. Decision calculations consume very little time and meet real-time requirements. The algorithm can be applied to engineering practice due to the following reasons. Firstly, the method we proposed is designed from the perspective of scheduling. Our innovation was to abstract the collision avoidance problem of the UAV to the network's collapse problem, aiming to solve the collision avoidance problem by using network theory. Second, the proposed method allows the UAV to perform only one maneuver--that of the flight level change. This maneuver is used in the traffic collision avoidance system (TCAS), and it is simple but very effective. As such, it can definitely be applied to the UAV collision avoidance system. The algorithm is shown below as Algorithm 1. ```
Input: Initial position, target position, initial velocity of the UAVs, the number of UAVs N, the simulation step length S Output: Trajectories of all the UAVs R for j = 1:S do for i = 1:N do  Calculate whether a TA is issued; while TA is issued do  Construct the network of the UAVs involved;  Calculate the relative distance and relative velocities of all the involved UAVs;  Select the key node;  Calculate the weight (relevant to the number of intruders, robustness and connected component);  Choose the optimal directions for the key node;  Update the current direction of the key node; if no collision then  break; else  R[i][j] = the coordinate of the step j of UAV i;  Calculate the state of all the UAVs involved in the scenario; if all the UAVs have reach the safe area then  break;  return R;
```  
**Algorithm 1** Novel Model Based on Key Node Research