## 2 System Model
The optimization problem can be formulated as follow:  
\[\begin{array}{l}\min\limits_{r,A}  
cities directly affects the updating of the pheromone, thus affecting path choice of subsequent ants. In the traditional TSP, the distance between cities (also known as the value of the objective function) can be calculated before the iteration, and it will not change with the increase of the number of iterations of the algorithm. Different from traditional TSP, when solving Problem (14) with the ACA, the distance between cities with the number of iterations. Therefore, we improved the ACA to solve the problem. The algorithm process is shown in Algorithm 1.  
```
1:Initialization: Randomly generate \(N\) users, assign value to the number of ants \(M_{ACA}\), and other parameters in the ACA. Let the hovering radius of the UAV \(r\ =\ r_{o}\).
2: The distance matrix \(C\) for the ACA is calculated according to the initial conditions.
3:Repeat
4:For each \(i\in[1,M_{ACA}]\)do
5: Randomly generated starting city.
6: Update the distance between cities according to the current city by using \(C\).
7: Calculate the transition probability between cities and select the next city.
8: Calculate the path distance.
9:Endfor
10: Update pheromone.
11: Update the shortest path.
12: Number of iterations plus one.
```  
**Algorithm 1**Ant Colony Algorithm  
Firstly, a matrix \(B_{N\times N}\) is constructed according to the number of users \(N\). Each element in the matrix represents the value of the corresponding user objective function within the corresponding time slot, and the element in the matrix \(B_{N\times N}\) can be written as follow:  
\[b_{i,j}\ =\ (SNR_{\max}-SNR_{j}[i])^{2}, \tag{15}\]  
where the elements of each row in \(B_{N\times N}\) represents the value of the objective function of all users in a certain time slot, and the element of each column represents the value of the objective function of a user in all the time slots. Secondly, the distance matrix \(C\) is calculated for the ACA based on \(B_{N\times N}\), and the size of the matrix \(C\) is \(N^{2}\times N\). The element in the matrix \(C\) can be expressed as follows:  
\[c_{i,j}\ =\ \left\{ \begin{array}{cc}b_{\frac{i-\mathrm{mod}(iN)}{N}, \mathrm{mod}(i,N)}&(\mathrm{mod}(i,N)\
eq j)\\ 0&(\mathrm{mod}(i,N)\ =\ j)\end{array} \right.. \tag{16}\]  
Thus, rows \(1+N(n-1)\) through the row \(Nn\) in the matrix \(C\) represent the distance between all the cities within the nth time slot. The core of the algorithm is the iteration to find the optimal path. The specific steps are as follows: Firstly, to build the solution space of the problem, each ant visits each city one by one until it traverses all the cities. Next, the length of each ant's path is calculated. Then, the optimal path in the current iteration is recorded, and the pheromones on the connection paths between the cities are updated in real-time. Finally, after several iterations, the optimal path is found. The distance between cities is constantly updated according to the distance matrix \(C\) in the process of the ants visiting cities. For a given hovering radius \(r\) of the UAV, an optimal selection path \(D\) can be calculated by this algorithm, where \(D\) corresponds to user scheduling, that is, the optimal scheduling of the user under the hovering radius can be obtained by this algorithm.