# DARAL: A Dynamic and Adaptive Routing Algorithm for Wireless Sensor Networks
## 2 Routing Algorithms for WSN  
Routing algorithms are an important part in Smart City and Internet of Things (IoT) projects, due to the critical function they play. Although there are different routing methodologies like multicast [15], mesh [16] or graph-based [17], routing algorithms based on clustering [18; 19; 20] are designed to improve different parameters such as QoS [21], network lifetime [22], energy consumption [23], traffic reduction or range maximization [24]. Thus, our proposal, DARAL, is based on clustering techniques. Within clustering-based routing algorithms, there are mainly hierarchical cluster tree algorithms, but other alternatives exist like the clustering mesh-like alternative proposed by [PERSON] in [18] or the spanning tree proposed by [PERSON] et al. in [25]. Usually, the implementation of a hierarchical clustering scheme is based on the definition of two different roles or functionalities for the nodes of the network, the cluster-heads and non-heads nodes. A cluster is formed by a cluster-head and a set of non-head nodes, where the nodes of the cluster communicate between them (sensor-to-sensor) and mainly with their cluster-head, which also leads the inter-cluster communications. As the role selection mechanism is a fundamental aspect in hierarchical cluster-based routing algorithms, there exist different cluster-head election schemes that consider a wide range of parameters such as location, residual energy or Link Quality Indicator (LQI). For example, [PERSON] et al. [26] described an adaptive routing optimization based on the energy balancing algorithm for hierarchical networks in ZigBee, where they limited the number of hops depending on the battery available, limiting the range of a certain node as well. Another possibility for the cluster-head election is the one proposed by the MultihopLQI routing algorithm [27], where a tree of multiple hops is dynamically built for routing tasks by the analysis of the impact of an LQI threshold in the routing formation, considering _MinLQI_ and _MaxLQI_ values. However, this cluster-head election scheme does not take into account some important parameters such as QoS, convergence time or control overhead, focusing instead on the analysis of path length and network lifetime. This is a common pitfall in most of the common cluster-head election schemes. As long as they need to analyse different parameters to produce a measurable result, they suffer from two major drawbacks: an increment of the convergence time and also a message overhead, making them unsuitable for Smart City or IoT projects. There is also a wide diversity in hierarchical cluster-based routing algorithms, mainly due to different scenario characteristics. Thus, each routing algorithm usually focuses on a specific set of parameters related to a concrete scenario, looking for their improvement. For example, [PERSON] et al. [28] explored the maximum lifetime of the routing in WSN through the reformulation of the energy efficiency problem. They improved the total energy efficiency of the system using the network lifetime increment instead of minimizing the total energy consumed to reach the destination. Another approach is presented by [PERSON] et al. in [29], where the problem of the coverage for WSN is analysed, assuming that all the nodes are under a certain coverage grade. However, focusing on Smart City/IoT applications, and as [PERSON] et al. commented in their article [30], routing solutions for these scenarios should consider different traffic patterns, such as one-to-many, many-to-one and many-to-many, due to the dynamical nature of Smart City/IoT applications. This requirement has favoured that most of the Smart City/IoT proposals are based on two well-known routing algorithms: AODV and RPL, mainly because both present low-complexity and good performance in these scenarios.