# Interference Avoidance through Periodic UAV Scheduling in RIS-Aided UAV Cluster Communications
## 3 UAV Scheduling to Avoid Interference
### Local Interference Minimization Scheme
To prove this result, we assume that two UAVs collide in one slot and then collide again after \(n_{1}\) periods of UAV \(1\) and \(n_{2}\) periods of UAV \(2\), then we have \(n_{1}T_{1}=n_{2}T_{2}\). By letting \(T_{1}=\xi_{1}\epsilon(T_{1}T_{2})\) and \(T_{2}=\xi_{2}\epsilon(T_{1}T_{2})\), we obtain  
\[\frac{n_{1}}{n_{2}}=\frac{T_{2}}{T_{1}}=\frac{\xi_{1}}{\xi_{2}}. \tag{15}\]  
Given that \(\xi_{1},\xi_{2}\) are prime numbers, the minimum integer numbers that satisfy Equation (15) are \(n_{1}=\xi_{2}\) and \(n_{2}=\xi_{1}\). As a result, the next collision occurs with an interval of \(\xi_{2}T_{1}=\frac{T_{1}T_{2}}{\epsilon(T_{1}T_{2})}\), which is the least common multiple (LCM) of their periods. Since collisions occur at every \(\frac{T_{1}T_{2}}{\epsilon(T_{1}T_{2})}\) time slots, the proportion of collision time slots is the reciprocal of this value. When \(N\) is large, the number of collision time slots between two UAVs in the \(N\) time slots can be approximated by  
\[I\left(\hat{s}_{j^{\prime}}^{i},s_{j^{\prime}}^{i^{\prime}}\right)=\left\{ \begin{array}{cc}0&\frac{s_{j}^{i}-s_{j^{\prime}}^{i^{\prime}}}{e\left(T_{ j}^{i},T_{j^{\prime}}^{i^{\prime}}\right)}\
otin\mathbb{Z}\\ \frac{\epsilon_{ij^{\prime}}(j,j^{\prime})Ne\left(\tau_{j}^{i}\tau_{j^{\prime} }^{j^{\prime}}\right)}{T_{j}^{i}\tau_{j^{\prime}}^{i^{\prime}}}&\frac{s_{j}^ {i}-s_{j^{\prime}}^{i^{\prime}}}{e\left(T_{j},T_{j^{\prime}}^{i^{\prime}} \right)}\in\mathbb{Z}.\end{array} \right. \tag{16}\]  
The details of the LIM algorithm are presented in Algorithm 1. In the algorithm, steps 4-9 identify all candidate time slots that meet the constraint of the limited number of RIS. Steps 10-13 are dedicated to selecting the initial time slot for the UAV in order to minimize local interference with the already scheduled UAVs. ```
1 Let \(k=0\), initial the UAV scheduling vector as \(\tilde{s}=\Phi\), and initial the RIS occupation vector as \(\mathbf{s}_{o}=\mathbf{0}_{N}\) ;
2 forstage\(k=1,\ldots,MN_{c}\)do
3 Calculate the cluster index and UAV index: \(n=mod(k,M)\)\(m=\lceil k/M\rceil\)\(n^{\prime}=mod(k-1,M)\), \(m^{\prime}=\lceil k-1/M\rceil\) ;
4 Initial the candidate slot set as \(\mathcal{N}(k-1)=\phi\) ;
5 for\(s=1,\ldots,T_{m}^{n}\)do
6 if\(\mathbf{s}_{o}+\mathbf{1}_{N}(s+zT_{m}^{n})\prec(L+1)\mathbf{1}_{N}\)then
7\(\mathcal{N}(k-1)=\left\{\mathcal{N}(k-1),s\right\}\) ;
8
9 end if
10
11 end for
12 Calculate the local interference by \(\hat{\gamma}_{k}(s)=\sum\limits_{i^{\prime}=1}^{n^{\prime}}\sum\limits_{j^{ \prime}=1}^{m^{\prime}}\left(I\left(s,s_{i^{\prime}}^{j^{\prime}}\right)+I\left( s_{i^{\prime}}^{j^{\prime}},s\right)\right)\) for \(s\in\mathcal{N}(k-1)\) ;
13 Find the optimal slot that minimizes the local interference, i.e., \(s_{k}^{*}=\underset{s\in\mathcal{N}(k-1)}{\text{arg min}}\ \hat{\gamma}_{k}(s)\) ;
14 Update the RIS occupation vector as \(\mathbf{s}_{o}=\mathbf{s}_{o}+\mathbf{1}_{N}(s_{k}^{*}+tT_{m}^{n})\);
15 Update the UAV scheduling vector by appending \(s_{k}^{*}\), i.e., \(\tilde{s}=\left(\tilde{s},s_{k}^{*}\right)\) ;
16 end
```  
**Algorithm 1**Local interference minimization (LIM).