## 3 Four-Dimensional Dynamic Cooperative Path Planning Algorithm
### Dynamic Priority RRT* Algorithm
The calculation method is as follows:

\[\textbf{X}_{j+1}=\textbf{X}_{j}+v_{i}\Delta t(\lambda_{1}\frac{\textbf{F}_{j}} {||\textbf{F}_{j}||}+\lambda_{2}\frac{\textbf{F}_{j+1}}{||\textbf{F}_{j+1}||}) \tag{21}\]

where \(\textbf{F}_{j}\) and \(\textbf{F}_{j+1}\) are the resultant forces of the \(j\) and \(j+1\) path nodes, respectively. \(\lambda_{1}\) and \(\lambda_{2}\) are weights, and \(\lambda_{1}+\lambda_{2}=1\). The value of the weight depends on the change of the resultant force angle of path node \(j\) and path node \(j+1\), i.e., the amplitude of the oscillation. In the simulation, we found that if the resultant angle change \(\Delta\alpha\leq\frac{\pi}{4}\) is small, then \(\lambda_{1}\leq\lambda_{2}\) should be adjusted. If the resultant angle change is \(\frac{\pi}{4}<\Delta\alpha\leq\frac{\pi}{2}\), \(\lambda_{1}>\lambda_{2}\) should be adjusted. ### Time Complexity Analysis

This section mainly analyzes the time complexity of the proposed algorithm (i.e, Algorithm 2). The proposed algorithm is mainly composed of three levels; namely, the pre-cooperative planning level, the cooperative path planning algorithm for a single UAV level based on DPRRT\({}^{\star}\) (i.e., Algorithm 2), and the local dynamic threat avoidance planning level based on HAPF. The purpose of the pre-cooperative planning level is to initialize the path of UAVs, i.e., to plan the optimal path for all UAVs without considering the 4D cooperative constraints. Therefore, in this level, we adopt the synchronous decentralized architecture and use RRT\({}^{\star}\) algorithm to plan the optimal path for all UAVs. The pseudocode of the RRT\({}^{\star}\) algorithm is shown in Algorithm A1 of \"Appendix A\". As described in [44; 45], the computational complexity of the RRT\({}^{\star}\) algorithm is similar to that of the RRT algorithm and RRG algorithm, which run in time \(O(n\log n)\). The other steps of the pre-planning level are only executed once, and the time complexity is very low. Therefore, it can be proved that the computational complexity of the pre-planning level of the proposed algorithm is \(O(n\log n)\). Then, we derive the time complexity of the DPRRT\({}^{\star}\) algorithm (i.e., Algorithm 2). As can be seen from the main program (i.e., **MAIN ALGORITHM**) of Algorithm 2, DPRRT\({}^{\star}\) is mainly composed of two parts; namely, the dynamic hydraulic prioritization strategy (**Function_HeuDyn_Propritization_**) and the 4 DRRT\({}^{\star}\) algorithm (**Function 4 DRRT\({}^{\star}\)**). The time complexity of the dynamic hydraulic prioritization strategy is \(O(n)\). We derive the time complexity of 4 DRRT\({}^{\star}\) by comparing it with RRT\({}^{\star}\)[44]. The main difference between the two algorithms is the cost function. The purpose of the cost function of RRT\({}^{\star}\) is to calculate the shortest path, while the purpose of the cost function of 4 DRRT\({}^{\star}\) is to calculate the path with the shortest ETA error. The different cost functions lead to the difference between the expansion process of the two algorithms and the update process of the neighborhood optimal node. However, the highest order of the two cost functions is the same, so the time complexity of the above two processes is basically the same. In addition, the collision checking process (_Conflict_free_) and the sampling process (Algorithm 2 Line 5-9 and Algorithm A1 Line 3-7) of the two algorithms are the same, and they can be executed in a certain number of steps. Therefore, for the 4 DRRT\({}^{\star}\) and RRT\({}^{\star}\), since each iteration has only one sampling, they have the same number of nodes in the iteration \(i\), i.e., \(\mathcal{V}_{i}^{RRT^{\star}}=\mathcal{V}_{i}^{4 DRRT^{\star}}\). Therefore, the two algorithms run in time \(O(\log n)\) in iteration \(i\). Therefore, when the number of iterations \(i\) tends to infinity, similar to [40], we can prove that the time complexity of the two algorithms is basically the same, which runs in time \(O(n\log n)\).