# Flying Real-Time Network to Coordinate Disaster Relief Activities in Urban Areas +
## 3 Proposed Network System
### Initial Network Deployment
```
Data: Set \(P\) as the current locations of user nodes and maximum transmission distance \(d\) Result: Set \(Q\) as the locations of the TWUs (cluster centroids)  Initialize \(Q=\{p\}\), where \(p\in P\) (randomly selected)  Initialize \(Q^{\prime}=\{p^{\prime}\}\), where \(p^{\prime}\in P\) (randomly selected) and \(p^{\prime}\
eq p\) whileTruedo while\(distance(Q,Q^{\prime})\
eq 0\)do  Each user point \(p\in P\) is assigned to the closest TWU \(q\in Q\)  Set \(Q^{\prime}=Q\)  Each TWU point \(q\in Q\) is recalculated given the mean distance from its assigned points  end while if\(\exists p\in P\), \(\exists q\in Q\) such as \(distance(p,q)>d\)then \(Q=Q\cup\{p^{\prime\prime}\}\), where \(p^{\prime\prime}\in P\) is randomly selected else  Stop algorithm  end if  end while
```  
**Algorithm 1** Initial placement of TWUs in a given the emergency area  
Because the proposed TWU deployment is a heuristic approach based on the \(k\)-means algorithm, it may fall in local minima. In order to address this situation, we used a common practice, which is to restart the deployment process many times with different initial conditions, up to a set limit, and then report the best result found. In our case, after restarting ten times the process was adequate to get useful approximated results for each deployment scenario. Using a discrete event network simulator (sim2 net) ([[https://pypi.org/project/sim2](https://pypi.org/project/sim2) net/3.1.2/]([https://pypi.org/project/sim2](https://pypi.org/project/sim2) net/3.1.2/)), we modeled an ad-hoc network consisting of a set of communicating nodes (in our case, SAR team  
Figure 2: TWUs deployment scenarios: (**a**) small area with a single TWU providing communication to members of a SAR team; (**b**) large area supported by a single TWU; in this case, nodes count on weak or no communication signal to interact among them; and (**c**) large area with four TWUs that can provide adequate communication with bounded delay; this is an example of a feasible solution to cover large areas. members and TWU nodes), where each one moves according to a specific mobility pattern. Initially, no flying mules were considered to link disconnected teams, if any. The simulated area was a square of 1000 \(\times\) 1000 m using a Wi-Fi antenna of 200 m range, where several numbers of TWUs were deployed. The algorithm for nodes placement uses as input the location of the teams to be supported, and the communication range of the technology utilized to do that; therefore, a change in the communication technology being used or in the location (or number) of teams to be supported represents only a change in the input parameters for the algorithm. It is important to remark that the goal of the algorithm is to identify the minimal number of TWUs, and their location, required to provide communication support to a set of teams in the field. Moreover, the most suitable location for the TWUs should be adjusted periodically, given that the SAR teams change their location after finishing the operations in a certain quadrant. The simulations considered that the communication among nodes was carried out by sending/receiving messages via the wireless links considered by the transmission model. A simplified path loss model was also used to allow these nodes to communicate directly when they were within a suitable transmission range of each other, considering a signal strength above the minimal operational level. This means that no packet is lost during communication and the message delay is bounded (the bound is known). Figure 3 shows the several deployments that were simulated, and the number and location of the TWUs supporting the communication in the whole area. Each dot in the grid represents a potential end-user (e.g., a first responder) and the color of the lines indicates the quality of the communication link between the TWU and each end-user; green lines indicate a communication quality good enough to support message exchange, and red lines means poor-quality links (or no communication).