## 6 Performance Evaluation
### Comparison with QELAR and VBF  
Figure 5 depicts the average latency of each package with different \(\varphi_{0}\) and the comparison with the QELAR protocol, a Q-learning-based lifetime-extended protocol. As \(\lambda\) increases, more packets need to be forwarded and the average latency is prolonged. For example, when \(\varphi_{0}=0.3\), the latency increases about 23% with \(\lambda\) grows from 0.02 to 0.1. This is because both QDAR and QELAR choose detour routing to distribute the residual energy evenly. When there are more packets sent in UWSNs, nodes closer to the sink node have relatively less residual energy. Thus, the nodes far away from the sink node but with more residual energy are chosen to relay packets.  
Figure 4: Average latency with different values of \(\varphi_{0}\), \(\beta_{1}\) and \(\beta_{2}\).  
Figure 5: Average latency comparison between QDAR and QELAR with different packet generation rate \(\lambda\) (packets/s).  
It is also observed that, in UWSNs with a lower \(\lambda\), QDAR can reduce latency more significantly. Especially when \(\varphi_{0}=0.7\), the latency is reduced by nearly 25%. The reason is that at the initial stage of communication, although the residual energy reduces, it is still sufficient and does not worth detour routing. However, QELAR detours from the outset at the initial stage, while QDAR waits until the residual energy of some nodes is lower than a threshold. The higher the \(\varphi_{0}\) is, the more attention is paid to latency. Another reason is that, in QDAR, it is the sink node that takes responsibility to construct routing path. Whereas in QELAR, every node in the network should learn the environment and choose an optimal action, leading to a longer delay. In this way, QDAR outperforms QELAR in the average latency by 20-25% as shown in Figure 5.  
Since the network lifetime is another critical performance of network, we compare the network lifetime of QDAR, QELAR and VBF protocol [23]. The network lifetime is defined as the total performing time until the first node drains its energy. The ratio of QDAR network lifetime and QELAR network lifetime as well as the ratio of QDAR network lifetime and VBF network lifetime is shown in Figure 6. As depicted, the ratio of QDAR network lifetime and VBF network lifetime is about 1.2 with \(\varphi_{0}=0.7\). When \(\varphi_{0}=0.3\), the ratio increases to 1.3. This is because in VBF, all the nodes in the virtual pipe between a source and a destination have chances to relay packets. As a result, many packets are sent repeatedly by different nodes, making them drain energy more quickly. With \(\lambda\) growing from 0.02 to 0.1, more packets are sent and the nodes within the pipe die earlier. On the contrary, QDAR takes the residual energy into account and extends the network lifetime by avoiding to choose nodes with relative less energy. The ratio of QDAR network lifetime and QELAR network lifetime is smaller than 1. The reason is that QELAR can distribute routing traffic to nearly every node in UWSNs, extending the lifetime greatly. While QDAE also take delay into account, avoiding choosing nodes that are too far away from the sink node to forward packets. Thus, some nodes may exhaust energy earlier than that in QELAR. However, even for the worst case, the network lifetime can still achieve 82% of that in QELAR. The factor attributes to the result is our adaptive detouring path strategy: if the residual energy of a node is less than \(\mathrm{e_{\mathrm{\mathrm{wth}}}}\), an adequate path with nodes remaining more energy is chosen to relay packets, to postpone energy depletion of the node.  
Figure 6: Lifetime ratios of QDAR and different routing protocols (QELAR and VBF) with different packet generation rate \(\lambda\) (packets/s).