# Novel Approach Sizing and Routing of Wireless Sensor Networks for Applications in Smart Cities
## 3 Problem Formulation
### Wireless Sensor Network Routing
#### 3.2.3 Multiple Flow Routing
#### 4.1.1 Routing Based on Graph Theory

After solving the sizing problem, a change in the scenario was generated, and we then had \(N=40\) sensors and \(M=9\) DAPs with which we proceeded to apply the routing model based on graph theory. For this stage, a connectivity matrix was generated among all resources (sensors and DAPs) based on the calculation of distances between two geographical points using the Haversine distance; then, the connectivity matrix \(G\) was generated based on the passing weight, which was the coverage radius of the DAPs: \(R=60\,\mathrm{m}\). Therefore, to find the minimum cost of the tree, [PERSON]'s algorithm was used. The model presented two minimum-cost trees from two Dijkstra variations. Figure 4a

Figure 3: Energy consumption of the wireless technology. Figure 2: Minimization of the DAPs based on the sizing model. shows the solution generated in the shortest time (0.4219 s) by starting the routing from the DAPs to the sensors (down-link). Figure 3(b) presents the routing from the sensors to the DAPs (up-link) in a longer time (1.6094 s). This variation in time and computational performance is important when generating a planning model with a larger number of resources to explore. #### 4.1.2 Multi-Cast Routing

A variation of the routing presented in this work allowed us to make a minimum spanning tree (MST) to link the resources to be placed (sensors and DAPs). This offered the possibility of achieving an MST that generated resilience when interconnecting the resources. This solution is less expensive than a partial or total mesh topology in smart cities depending on the type of application. If it is necessary to ensure the real-time collection of information, this type of routing can contribute. Figure 5 presents a feasible mesh from the distance restriction represented by the coverage radius (\(R=60\) m); it depends on this variable. The MST was determined to generate a multi-cast routing. #### 4.1.3 Multiple-Flow Routing

In general, this model presents a routing that considers the capacity of the links as a constraint. In addition, it calculates the number of data flows that can pass through each wireless link; in the case of finding a congested route, the model shows resilience and evaluates another route through which it can send the data. Figure 5(a) shows the MST achieved in the previous stage, which was acted upon by defining links with an origin and destination; the cost and link capacity were previously use to make a flow matrix with its source and destination, as well as a requirement in terms of the number of packets to be sent. Figure 5(b) presents the best route that was constructed by the algorithm, which connected the link from \(DAP9\) to \(DAP2\). Figure 4: Optimal routing based on the Dijkstra algorithm. In Figure 7, we can see that the most significant amount of flow per wireless link was from \(DAP2\) due to the number of DAPs around it. It was solved as an MILP. This model allowed us to dimension the amount of traffic that could circulate from the beginning to the end in order to optimize the resources and ensure the correct quality of service in the wireless links. Table 3 shows the results generated by LPSolve. Figure 5: Minimal spanning tree—wireless network backup. Figure 6: Optimal routing of wireless link—capacity link constraint. The capacity of each DAP has a direct impact on the search for optimal candidate sites and the problem graph because the selected DAPs may be different. Therefore, there is a direct impact on the total path cost when varying the capacity of a DAP. However, when the capacity of each DAP is low, the total path cost is higher and may remain somewhat higher in contrast to medium or higher capacities. Figure 8 also shows that there is a trend of linear growth as the the radius of coverage becomes more significant. Depending on the arrangement of the resulting networks, scenarios with higher total path costs can occur. Finally, Figure 8 shows that after 200 m of coverage, the total path cost remains constant.