## 4 MEMAC Algorithm Design
### Design and Implementation of Clustering Protocol
The length of the data packets is 1024 bits, and the length of the control packets for campaigning for CH nodes is 150 bits. The operational data rate of the nodes is maintained at 1 kbps. The transmission power of the nodes can beadjusted between 1 W and 30 W to meet different communication requirements within and between clusters. A single simulation run lasts for 15,000 s. The repetitions with different seeds are set to 2000. In this simulation experiment, a collision avoidance MAC (DC-MAC) protocol in the literature [25] was adopted to carry out CH scheduling and transmission. The complete parameter settings are detailed in Table 1.

The performance of the MEMAC algorithm proposed in this paper is verified by comparing it with three representative algorithms in the field: LEACH [9], CCCS [7], and GTC [6]. ### Comparison of the Lifespan of a Network

Network lifetime is considered one of the key metrics for assessing the effectiveness of clustering algorithms, and it is gauged according to the time until the first node within a cluster dies post-clustering. As depicted in Figure 3, the first node deaths for the four algorithms, LEACH, GTC, CCCS, and MEMAC, occurred at rounds 484, 900, 1200, and 1430, respectively. The reason for this is that the MEMAC algorithm employs a multipath channel information model, an environment-adaptive CH competition mechanism, a traffic weight model, a residual energy-balancing mechanism, and a CH rotation mechanism, comprehensively, and it takes into account the overall remaining energy of the network to comprehensively decide on the election of CH nodes, thereby delaying the occurrence of node death to the latest possible time. Compared to the other three algorithms, the network lifetime was extended by 195.5%, 58.9%, and 19.17%, respectively, which effectively balances \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Network size & 6000 \(\times\) 6000 \(\times\) 6000 (m) \\ Sink location & (3000, 3000, 3000) \\ Node size & 30 \\ Transmission rate & 1 kbps \\ f & 10 kHZ \\ \(E_{1}\) & 100 nJ/bit \\ Transmitter power & 1 to 30 w \\ \(\delta\) & 0.5 to 1 \\ \(\eta\) & 0.65 \\ \(\delta_{1}\),\(\delta_{2}\) & 0 to 1 \\ \(\mu\) & 0.46 \\ Simulation time & 15,000 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameter. Figure 2: Network topology scene simulation. the energy consumption among nodes. However, between rounds 1300 and 1400, there was a significant increase in the death rate of nodes within the MEMAC algorithm's cluster, indicating that there may be a short period during which the algorithm cannot balance all nodes in the network. As can be seen from the curve changes of CCCS in Figure 3, most nodes in the algorithm began to die after 1369 simulation rounds, and only a few nodes died between the 1200 th and 1369 th rounds. This is because CCCS's centralized control mechanism evaluates the node's own energy, resulting in the premature deaths of very few nodes. It can be seen that the energy consumption of a single node is a decisive factor in the length of the network lifetime. The premature exhaustion of the energy of a single node in the CCCS algorithm greatly shortens its lifetime. As can be seen from the greatly increased number of continuous simulation rounds of nodes, the algorithm can optimize the overall energy consumption of its underwater mobile network. The MEMAC proposed in this paper not only draws on the advantages of the CCCS algorithm for centralized control in each cluster but also fully considers the energy benefits of each node from the perspective of the whole network, thus achieving higher efficiency than CCCS. Figure 4 presents a comparison of the number of simulation rounds for these algorithms when the proportion of node deaths reaches 1%, 30%, 50%, and 80%. The larger the number of simulation rounds, the longer the network life is at various stages of remaining node numbers.