## 3 Algorithm Description and Process
### Algorithm Description
#### 3.2.3. Cluster Head Node Calculating the Depth of Each Node in a Cluster
\right.\] (16)  
\(f_{m}\) subsequently compares the \(CRR\) of every basic node \(b\) to select the minimum \(CRR\). Thereafter, \(f_{m}\) compares the hop number of every basic node to the \(CRR\) that is within the _rang_ range of the minimum \(CRR\) and selects the basic node with the minimum hop number as the basic node of \(N_{f}\) (when the hop number is equal, \(f_{m}\) selects it by the communication radius and diving depth in order of node \(N_{f}\)). \(f_{m}\) determines the optimal position of node \(N_{f}\). \(f_{m}\) finally updates _part_deployed_ and _all_deployed_. An example for the process by which the cluster head node calculates the depths of its in-cluster nodes is described in Figure 4a. In the figure, \(s_{1}\), \(s_{2}\), \(s_{3}\), \(s_{4}\), \(s_{5}\) and \(f\) are on the water surface. Among them, \(f\) represents a cluster head node, and others represent in-cluster nodes. In addition, \(s_{1}\), \(s_{2}\), \(s_{3}\) and \(f\) are in the _part_deployed_. In other words, their depths have been already calculated in the cluster. When \(f\) calculates the depth of \(s_{5}\), it finds that the distance between \(s_{5}\) and each node in _part_deployed_ is greater than \(R_{c}\_Max\). Thus, it ignores calculating the depth of \(s_{5}\) tentatively and continues to calculate the depth of another node (_i.e._, \(s_{4}\)). It firstly selects \(s_{1}\) as the basic node of \(s_{4}\) and calculates the possible diving depth assuming that the distance between the adjusted position of \(s_{4}\) and \(s_{1}\)' is respectively \(R_{c}\_Max\), \(R_{c}\_Max\)-\(1\ldots\)\(d(s_{4}\),\(s_{1})\). Consequently, all of the possible diving depths are on the line segment \(d_{1}d_{2}\). It then calculates the \(CRR\) of every position on \(d_{1}d_{2}\) and chooses the minimum \(CRR\) as the \(CRR\) of \(s_{1}\) and saves the corresponding position \(m_{3}\). In a similar way, all of the possible diving depths are on the line segment \(c_{1}c_{2}\), and the position of the minimum \(CRR\) is \(m_{2}\), when it selects the \(s_{3}\) as the basic node of \(s_{4}\); all of the possible diving depths are on the line segment \(a_{1}a_{2}\), and the position of the minimum \(CRR\) is \(m_{1}\), when it selects the \(f\). Specifically, when it selects the \(s_{2}\) as the basic node of \(s_{4}\), it ignores the situation because the distance between \(s_{4}\) and \(s_{2}\) is greater than \(R_{c}\_Max\). Finally, \(f\) finds the minimum \(CRR\) among these position (_i.e._, \(m_{1}\), \(m_{2}\), \(m_{3}\)) and compares the hop of the basic node whose \(CRR\) is within _rang_ range of the minimum \(CRR\) (_i.e._, compares the hop of \(s_{1}\) and \(f\)). Consequently, \(f\) selects \(m_{1}\) as the diving depth of \(s_{4}\) and \(f\) as the basic node of \(s_{4}\). After finishing calculating the depth of \(s_{4}\), it calculates \(s_{5}\) again. At last, each node synchronously dives to the position according to the calculation result. The result of the nodes' depth adjusting is depicted in Figure 4b. Figure 4: (**a**) Depth calculation process in a cluster (assume that the \(CRR\) on \(m_{3}\) is the minimum and the \(CRR\) on \(m_{1}\) is within _rang_ range of the minimum \(CRR\); the basic node (next-hop node) of \(s_{2}\) and \(s_{3}\) is \(f\), and the basic node of \(s_{1}\) is \(s_{2}\), after their depth is already calculated); (**b**) 3D result of nodes’ depth adjusting. The flow chart of Section 3.2.3 is shown in Figure 5 with a cluster head node \(f_{m}\) as an example.