# Ocean-Current-Motion-Model-Based Routing Protocol for Void-Avoided UASNs
## 4 OCMR Protocol
### Searching Process of the Optimal Relay Node  
In this section, we mainly detail the searching process of the optimal speed-based relay node selection algorithm and protection radius with optimal outage probability. We first initialize the whale population and velocity, and determine the search coverage with the optimal outage probability using Equation (19). A top-to-bottom view of the surface is shown in Figure 6b. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Function** & **Num** & **Range** & \(f_{min}\) \\ \hline \(F_{1}(x)=\sum_{i=1}^{n}x_{i}^{2}\) & 30 & [\(-\)100,100] & 0 \\ \(F_{2}(x)=\sum_{i=1}^{n}|x_{i}|+\Pi_{m=1}^{n}|x_{i}|\) & 30 & [\(-\)10,10] & 0 \\ \(F_{3}(x)=\sum_{i=1}^{n}\left(|x_{i}+0.5|\right)^{2}\) & 30 & [\(-\)100,100] & 0 \\ \(F_{4}(x)=\sum_{i=1}^{n}x_{i}^{2}+random(1)\) & 30 & [\(-\)128,128] & 0 \\ \(F_{5}(x)=\sum_{i=1}^{n}x_{i}^{2}-\sin(\sqrt{|x_{i}|})\) & 30 & [\(-\)500,500] & \(-\)418.9829 \(\times\) 5 \\ \(F_{6}(x)=\sum_{i=1}^{n}[x_{i}^{2}-10\cos(2\pi x_{i})+10]\) & 30 & [\(-\)5.12,5.12] & 0 \\ \(F_{7}(x)=\frac{\pi}{\pi}\left\{10\sin(\pi y_{1})+\sum_{i=1}^{n}\left(y_{i}-1 \right)^{2}[1+0\sin^{2}(\pi y_{i+1})]+\left(y_{n}-1\right)^{2}\right\}+\sum_ {i=1}^{n}u(x_{i},10,100,4)\) & 30 & [\(-\)50,50] & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Basic description of F1–F7. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Function** & **IWOA** & **WOA** & **PSO** & & **GSA** \\ \hline
**Avg** & **Std** & **Avg** & **Std** & **Avg** & **Std** & **Avg** & **Std** \\ \hline F1 & \(5.3597\times 10^{-34}\) & \(4.2268\times 10^{-18}\) & \(1.41\times 10^{-30}\) & \(4.91\times 10^{-30}\) & \(0.000136\) & \(0.000202\) & \(2.53\times 10^{-16}\) & \(9.67\times 10^{-17}\) \\ F2 & \(2.0685\times 10^{-23}\) & \(2.0727\times 10^{-23}\) & \(1.06\times 10^{-21}\) & \(2.39\times 10^{-21}\) & \(0.042144\) & \(0.045421\) & \(0.05655\) & \(0.194074\) \\ F3 & \(1.8898\) & \(2.2742\) & \(3.116266\) & \(0.532429\) & \(0.000102\) & \(8.28\times 10^{-5}\) & \(2.5\times 10^{-16}\) & \(1.74\times 10^{-16}\) \\ F4 & \(0.00021516\) & \(0.009757\) & \(0.00425\) & \(0.001149\) & \(0.122854\) & \(0.044957\) & \(0.089441\) & \(0.04393\) \\ F5 & \(-\)5879.313 & \(600.976165\) & \(-\)5080.76 & \(695.7968\) & \(-\)4841.29 & \(1152814\) & \(-\)2821.07 & 493.0375 \\ F6 & \(0\) & \(2.98065\times 10^{-9}\) & \(0\) & \(0\) & \(46.70423\) & \(11.62938\) & \(25.96841\) & \(7.470068\) \\ F7 & \(0.72669\) & \(1.67734\) & \(0.339676\) & \(0.214864\) & \(0.006917\) & \(0.026301\) & \(1.799617\) & \(0.95114\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of avg and std of different functions. Figure 5: Comparison of convergence rates of WOA and IWOA. As shown in Figure 6, (a) is the space diagram of the search area at a certain depth, (b) is the top view of (a). We set the red point A as the center of the circle, and \(2d_{\varepsilon}\) is the diameter. The diameter splits the circle into two symmetrical parts with a dotted line, forming opposing groups within the search coverage to increase the convergence rate. O and \(\overset{\rightarrow}{\textbf{x}}\) represent nodes within opposing groups, and the phase difference between them is \(\pi\). \(\Delta\) indicates the nodes outside the search coverage. Assuming there is a node \(v\) in \([l,u]\), then the opposite node \(v^{\prime}\) is written as \(v^{\prime}=l+u-v\). We suppose \(\overset{\rightarrow}{v}=(v^{1},v^{2},\ldots,v^{d})\) is a node in the d-dimensional space, where \(v^{j}\in[l^{j},u^{j}],j=1,2,\ldots,d\); the opposite node can be shown as \(\overset{\rightarrow}{v}^{\prime}=(v^{1},v^{2},\ldots,v^{d})\), where \(v^{ij}=l^{j}+u^{j}-v^{j},j=1,2,\ldots,d\).