# Energy Efficient and Reliable Routing Algorithm for Wireless Sensors Networks
## 4 Ds-Eera
### Attribute Indexes  
(1) Transmission energy efficiency ratio  
This paper considers the spatial positional relationship between the current node \(i\), the forward neighbor node \(a\) and the sink node, as well as the energy status of each node to establish a data transmission path that reduces energy consumption and delay. The closer the forward neighbor node of node \(i\) is to the sink node, and the closer the straight-line distance \(d_{is}\) is, the fewer hops it forwards along the path, the faster the data can be transmitted to the sink node. As can be seen from Figure 1, node \(a\) is closer to the sink than node \(b\) and closer to a straight line \(d_{is}\) than node \(c\), so node \(i\) under this index will prefer node \(a\) as the next hop node. At the same time, from the perspective of residual energy, when residual energy \(E_{i}\) is small, it is hoped that the smaller the energy consumption \(e_{ia}\) is, the forward distance \(d_{as}\) is as large as possible, and node \(a\) can bear more forward energy consumption \(e_{as}\). On the contrary, when the residual energy \(E_{i}\) is relatively abundant, and the residual energy \(E_{a}\) of the forward neighbor node \(a\) is generally small, it is hoped that node \(i\) can share more transmission energy consumption as large as possible. Based on the above two aspects, the transmission energy efficiency ratio is established to reflect the ability of nodes to balance energy utilization in data transmission. Its expression is as follows:  
\[p(a)=\frac{d_{is}}{d_{in}+d_{as}}.(\frac{e_{as}}{E_{i}}+\frac{e_{in}}{E_{a}}) \tag{4}\]  
Normalize \(p(a)\) for unified dimension:  
\[P(a)=\frac{p(a)}{\max\{p(a)\}} \tag{5}\]  
where \(P(a)\) is a benefit index, the larger \(P(a)\) is, the more efficient it is to utilize energy so that the data is forwarded along the shortest path as much as possible.  
(2) Idleness degree  
Considering the transmission energy efficiency ratio, the data can be forwarded along the path with the highest energy efficiency ratio. However, due to the uneven distribution of nodes in the wireless sensor network and bursts of data streams, some nodes in the forwarding path, especially those near the sink node, are prone to packet loss due to the excessive data forwarding tasks. The amount of data exceeds the size of the cache area, seriously affecting the Quality of Service (QoS). Therefore, from the perspective of balanced traffic, the idleness degree is defined as follows:  
\[C_{idle}(a)=1-\frac{Q_{c}^{a}+Q_{in}^{a}-Q_{out}^{a}}{Q_{\max}} \tag{6}\]  
where \(Q_{c}^{a}\) is the current data traffic of the node \(a\), \(Q_{in}^{a}\) is the data traffic of the inflow node \(a\), \(Q_{out}^{a}\) is the data traffic of the outflow node \(a\) and \(Q_{\max}\) is the maximum length of the buffer. \(C_{idle}(a)\) can reflect the ability of the node to accommodate the amount of data, it is a benefit index. Thus, the larger \(C_{idle}(a)\), the more data the node \(a\) is able to receive.  
(3) Energy density factor  
In the next hop selection process, in order to balance the network energy, the data should be transmitted to the forward neighbor nodes with more residual energy as much as possible. At the same time, the energy state around the next hop node should be considered to avoid transmitting to the energy empty area. For this purpose, the index of energy density factor of node \(a\) is established, and the expression is as follows:  
\[J(a)=\frac{E_{a}}{E_{o}}.\frac{1}{0.5\pi l^{2}}\left(\sum_{a\in FN(i),l\in FN(a )}E_{l}\right) \tag{7}\]  
where \(l\) is the max distance between node \(i\) and the nodes of \(FN(i)\). The energy density factor \(J(a)\) is benefit index, that is, the larger \(J(a)\) is, and the higher residual energy and energy density node will be preferred when choosing the next hop.