# An Efficient Mobility Model for Improving Transmissions in Multi-UAVs Enabled WSNs
## 4 System Model and Proposed Approach
### Proposed Approach
```
Initialize Algorithm  Topology Formation 0; UAV Path Generation 0; Data Transmission 0; Data Transmission Lone Regions 0; Exit End
```  
**Algorithm 1** Proposed Approach  
```
Start Input: Set of WSN Nodes \(W_{i}\) Initialize Network Mark sensor nodes to a sector w.r.t \((c,x_{i},y_{i})\), \((c,x_{j},y_{j})\), \((c,x_{k},y_{k})\),\((c,x_{l},y_{l})\) Cluster Head selection of a square \(\longrightarrow Min(H_{d})\) \(H_{d_{i}}=\frac{\sum_{i=1}^{C_{n}}D_{hop}}{C_{n}}\) Calculate Attraction Factor \(F_{A}=\sqrt{\left(\frac{R_{T}}{S_{i}}\right)\times\left(\frac{C_{n}}{S_{a}}\right)}\) \(F_{A_{\text{sys}}}=\sqrt{\left(\frac{R_{T_{\text{sys}}}}{S_{i_{\text{sys}}}} \right)\times\left(\frac{C_{n_{\text{sys}}}}{S_{a_{\text{sys}}}}\right)}\) Calculate average transmissions Calculate \(\mathcal{T}_{A,area}=\frac{\sum_{i}^{C_{n}}\left(\frac{R_{T}}{C_{n}}\right)}{ \mathcal{T}_{A,system}=\frac{\sum_{i}^{C_{n_{\text{sys}}}}\left(\frac{R_{T_{ \text{sys}}}}{C_{n_{\text{sys}}}}\right)}}\) Identify dense and scarce clusters \(\text{Dense}\longrightarrow\mathcal{T}_{A,system}\leq F_{A}\) \(\text{Scarce}\longrightarrow F_{A}<\mathcal{T}_{A,system}\) Calculate link costs \(\longrightarrow\mathcal{W}_{e}=\sqrt{\left(\frac{\sum_{i}^{C_{n}} \left(\frac{R_{T}}{C_{n}}\right)}{C_{n}}-\frac{\sum_{i}^{C_{\text{sys}}} \left(\frac{R_{T_{\text{sys}}}}{C_{n_{\text{sys}}}}\right)}{C_{n_{\text{sys} }}}\right)^{2}}\) Normalize Link Cost \(\mathcal{W}_{e+}=\frac{1}{F_{A_{\text{sys}}}-\mathcal{W}_{e}}\) \(\text{Exit End }
```  
**Algorithm 2** Topology Formation  
```
Input: Set of WSN Nodes \(W_{i}\) Initialize Network Mark sensor nodes to a sector w.r.t \((c,x_{i},y_{i})\), \((c,x_{j},y_{j})\), \((c,x_{k},y_{k})\),\((c,x_{l},y_{l})\) Cluster Head selection of a square \(\longrightarrow Min(H_{d})\) \(H_{d_{i}}=\frac{\sum_{i=1}^{C_{n}}D_{hop}}{C_{n}}\) Calculate Attraction Factor \(F_{A}=\sqrt{\left(\frac{R_{T}}{S_{i}}\right)\times\left(\frac{C_{n}}{S_{a}}\right)}\) \(F_{A_{\text{sys}}}=\sqrt{\left(\frac{R_{T_{\text{sys}}}}{S_{i_{\text{sys}}}} \right)\times\left(\frac{C_{n_{\text{sys}}}}{S_{a_{\text{sys}}}}\right)}\) Calculate average transmissions Calculate \(\mathcal{T}_{A,area}=\frac{\sum_{i}^{C_{n}}\left(\frac{R_{T}}{C_{n}}\right)}{ \mathcal{T}_{A,system}=\frac{\sum_{i}^{C_{n_{\text{sys}}}}\left(\frac{R_{T_{ \text{sys}}}}{C_{n_{\text{sys}}}}\right)}}\) Identify dense and scarce clusters \(\text{Dense}\longrightarrow\mathcal{T}_{A,system}\leq F_{A}\) \(\text{Scarce}\longrightarrow F_{A}<\mathcal{T}_{A,system}\) Calculate link costs \(\longrightarrow\mathcal{W}_{e}=\sqrt{\left(\frac{\sum_{i}^{C_{n}} \left(\frac{R_{T}}{C_{n}}\right)}{C_{n}}-\frac{\sum_{i}^{C_{\text{sys}}} \left(\frac{R_{T_{\text{sys}}}}{C_{n_{\text{sys}}}}\right)}{C_{n_{\text{sys} }}}\right)^{2}}\) Normalize Link Cost \(\mathcal{W}_{e+}=\frac{1}{F_{A_{\text{sys}}}-\mathcal{W}_{e}}\) \(\text{Exit End }
```  
**Algorithm 3** Topology Formation  
```
initialize \(D_{bs}=0\), \(Path=[]\) while\(w_{q}\)do\(w_{q}\longrightarrow queueof\)clusterheads  Select cluster head \(C_{i}\) with min \(\mathcal{W}_{e+i}\) \(D_{bs}=\mathcal{W}_{e+i}\) for\(Every_{N}eighborC_{j}\) of \(C_{i}\)do  Calculate \(D_{j}\) \(D_{j}=\mathcal{W}_{e+_{j}}+\mathcal{W}_{e+_{i\to j}}\) if\(D_{j}<\mathcal{W}_{e+_{j}}\)then \(D_{bs}=D_{j}\) EndIf EndFor \(Path=C_{i}\to C_{j}\)  Return Path, \(D_{bs}\) Endwhile  Exit End
```  
**Algorithm 3** UAV Path Generation  
```
Node from Lone sector  Identify Neighboring dense sectors. Broadcast \"Hello\" \(\leftarrow\) Estimate Hop Count  Sort clusters, base station in Order of Hop Count. whileNode with data do  Select Optimal Cluster or Base Station ifNode With Data then  transmit  else  Select next optimal Cluster or Node End If  Iterate till Node with data = FALSE EndWhile Exit End
```  
**Algorithm 4** Data Transmission Lone Regions