## 3 Four-Dimensional Dynamic Cooperative Path Planning Algorithm
### Dynamic Priority RRT* Algorithm  
In the cooperative path planning layer, we used the proposed DPRRT* to complete the 4D cooperative path planning of multiple UAVs based on the current initial planning space. The pseudo-code for DPRRT* is shown in Algorithm 2. The core idea of DPRRT* is to enable UAVs with lower priority to avoid conflict with the planned paths of the UAVs with higher priority when planning the cooperative paths in order to meet the requirements of 4D cooperative constraints. Considering that the prioritization of UAVs usually has a great impact on the efficiency and robustness of cooperative path planning, we designed a dynamic heuristic prioritization strategy (i.e., the HeuDyn_Proritization process) to assign the priorities of all UAVs, where UAV\({}_{i}^{j}\) represents the priority of UAV\({}_{i}\) as \(j\) and \(\boldsymbol{\sigma}(t)\) represents the planned cooperative path of the UAVs based on the previously planned space. Thereafter, the cooperative paths of all UAVs are planned in order of priority from high to low. In addition, in order to simultaneously meet the time and space cooperative constraints, this paper improves the classical RRT\({}^{*}\) to an RRT\({}^{*}\) algorithm based on 4D cooperative constraints, named 4 DRRT\({}^{*}\) (i.e., the 4 DRRT\({}^{*}\) process), so that each UAV is able to quickly plan a path that meets the cooperative 4D constraints. Note that before planning the lower-priority UAV paths, the planned paths of the high-priority UAVs need to be added to the space-time occupied area \(H^{j}\) to ensure that the planned paths of the low-priority UAVs do not conflict with those of high-priority UAVs. The dynamic heuristic prioritization strategy and 4 DRRT\({}^{*}\) algorithm will be introduced in detail below. ``` 01:MAIN ALGORITHM 02:H\({}^{j}\leftarrow\varnothing\), \(\boldsymbol{\sigma}^{*}\leftarrow\varnothing\) 02:initialization\(\mathcal{T}.V\leftarrow\{s_{i}\};\mathcal{T}.E\leftarrow\varnothing\) 03:\(\underset{i,j=1}{N}\text{UAV}_{i}^{j}\leftarrow\text{{HeuDyn\_Proritization}}(\boldsymbol{\sigma}(t)



#### 3.2.1 Dynamic Heuristic Prioritization Strategy

A key factor affecting the efficiency and robustness of DPRRT* is the prioritization strategy. If the prioritization is not carefully defined based on a specific problem scenario, it may lead to low-priority UAVs spending more computing time in planning to avoid the occupied area in space and time or even making the planning path infeasible. To solve this problem, a dynamic heuristic prioritization strategy is proposed. Whenever the planning space changes, this strategy can reasonably and dynamically adjust the priority of all UAVs so that the DPRRT* algorithm is able to find a 4D cooperative path planning solution with higher efficiency and robustness. Note that the generation of cooperative paths needs to meet the 4D cooperative constraints based on time consistency and no conflicts of space. Since the HAPF described below can effectively avoid sudden threats in a local range, as well as avoid spatial conflicts between UAVs and allow the UAV to return to the cooperative path based on the previous spatial planning cycle, when DPRRT* is used to replan the cooperative path, not only does the original cooperative path pass through conflict-free space but the time coordination constraint is broken. If the flight time of the UAV, UAV\({}_{i}\), along the original planned path is significantly different from the shortest cooperation time \(t_{co}\) based on the current planning space, the difference between the replanned cooperation path for UAV\({}_{i}\) and the original path will be even greater. Furthermore, when the cooperative path is replanned for UAV\({}_{i}\), the probability of conflict with other UAVs' occupied space and time area is greater. Therefore, it is necessary to ensure that the priority of UAV\({}_{i}\) is assigned to a higher level by planning its path first to improve planning efficiency.