# Optimal Routing for Time-Driven EH-WSN under Regular Energy Sources
## 5 Criterion for Optimal Routing  
It is well known that, in EH-WSN, enhancing performance under self-sustained operation implies maximizing the duty cycle of nodes as much as possible. According to expression (13), maximizing the duty cycle of any node requires minimizing its traffic load (for the rest of the parameters remaining fixed). However, reducing the traffic load of a node may be achieved at the expense of increasing the traffic load of nearby nodes. So, the emphasis will be put on the average traffic load across the network. In a global sense, minimizing the average traffic load across the sensor network will contribute to maximizing the average duty cycle of nodes, fact that in turn will contribute to improving performance metrics. The problem of minimizing the average traffic load can be addressed by decomposing the sensor network into layers. Let us assume that the transmission range of all nodes is \(r\), and let us define \(l_{1}\) as the subset of nodes that are at a distance not greater than \(r\) from the base station. Next, let us define \(l_{2}\) as the subset of nodes that are in the transmission range of at least one node in \(l_{1}\) but at a distance greater than \(r\) from the base station, \(l_{3}\) as the subset of nodes that are in the transmission range of at least one node in \(l_{2}\) but out of the transmission range of all nodes in \(l_{1}\), and so on. In this layer decomposition process, it is assumed that a layer exists if it contains at least one element (node), and that the existence of layer \(l_{i}\) implies the existence of layer \(l_{i-1}\), for any \(i=2\ldots L\). Figure 4 shows an example of layer decomposition for a connected network. Note that, if \(N\) is the number of sensor nodes in the network and \(L\) is the number of (non-empty) layers, the following properties hold:  
* \(L\leq N\). The equality corresponds to the case where each layer contains a single node. * \(l_{i}\cap l_{j}=\varnothing,\ \forall i\
eq j\). This property is a direct consequence of the above definition of layer. * If the network is connected, \(l_{1}\cup l_{2}\cup\ldots\cup l_{L}=u\), where \(u\) represents the set of all sensor nodes. * If the network is disconnected, \(l_{1}\cup l_{2}\cup\ldots\cup l_{L}\subset u\). Once it has been verified that the network is connected, the next step is to find an appropriate routing topology. In our context, this means determining a spanning tree rooted at the base station that minimizes the average traffic load across the network. To achieve this goal, let us first define \(n_{i}\), with \(i=1\ldots L\), as the size of layer \(l_{i}\), that is, the number of nodes contained in this layer. Obviously, \(\sum_{i=1}^{L}n_{i}=N\). If we assume, with no loss of generality, that each node sends one packet per reporting period, then the traffic load supported by node \(x_{k}\), namely \(\sigma(x_{k}),\ k=1\ldots N\), is the total number of descendants of this node in the spanning tree. Let us also assume that only inter-layer connections (directed towards the base station) are allowed. In this case, the following lemma holds:  
**Lemma 1**. : _If \(\overline{\sigma}\) denotes the average traffic load supported by a network that only contains inter-layer connections, the following equation holds: \(\overline{\sigma}=\frac{1}{N}\sum_{i=1}^{L-1}\sum_{j=i+1}^{L}n_{j}\), with \(n_{j}\) the size of layer \(l_{j},\ j=1\ldots L\)._  
Proof. : Let \(\overline{\sigma_{i}}\) be the average traffic load supported by nodes in layer \(l_{i},\ i=1\ldots L\). Then, \(\overline{\sigma_{L}}=0\) and \(\overline{\sigma_{i}}=\frac{\sum_{j=i+1}^{L}n_{j}}{n_{i}},\ i=1\ldots L-1\). The first part of the statement is obvious, since \(\sigma(x_{k})=0\ \forall x_{k}\in l_{L}\) (nodes in the last layer do not receive packets from other nodes). For the second part, let us first consider layer \(l_{L-1}\).