# W-GUN: Whale Optimization for Energy and Delay-Centric Green Underwater Networks
## 3 Green Underwater Sensor Network Framework using Adapted Whale and Wolf Optimization
### The Complete Working Structure of the Adapted Optimization Framework (W-GUN)  
The working structure of the adapted whale optimization-based relay node optimization for the W-GUN framework with a dynamic duty cycle is given in Figure 2.  
Figure 1: Flowchart of the proposed adapted whale optimization for the green underwater network (W-GUN). Figure 2: The working structure of proposed adapted relay node optimization framework W-GUN. Next, we will discussed the working of the proposed underwater framework W-GUN, in detail as per Figure 2 (above). In the first step, the underwater sensor nodes that were deployed in a uniform random fashion are located in the underwater network sensing area. In the second step, underwater relay nodes deployed in a normal random distribution fashion are identified. In the third step, the initial estimation of the network is performed with the objective function of the deployed underwater relay nodes. Thus, this step initially calculates the fitness of each search agent. In the fourth step, the adapted underwater optimization framework W-GUN, is utilized to find the optimal set of underwater relay nodes from the direct neighbor nodes. A flowchart of the adapted whale and wolf optimization framework is given in Figure 1. The adapted underwater optimization has been designed by integrating the whale and wolf optimization techniques. Here, the optimal best relay node solutions are obtained simultaneously from both algorithms, and the final decision is taken to select the best relay node among them during each optimization iteration. At the completion of every underwater relay node optimization iteration, the best underwater relay node solution will be given to both optimization algorithms to generate solutions that are better than the previous underwater relay node solutions, then the same cycle is repeated. Thus, the output of the fourth step is an optimal set of underwater relay nodes to be used as the next-hop forwarder. After finding the optimal set of underwater relay nodes, their current duty cycle is calculated in the fifth step. Now, the underwater relay set for each node is identified, and all relay nodes become active in the underwater network path. In addition, in the fifth step, the expected effective transmission cost (EETC) is calculated, and relay nodes are prioritized accordingly [37; 38]. Therefore, the actual underwater relay node list for each node is discovered in this step. For each sender node \(m\), the underwater relay nodes n are identified. The EETC of the underwater single-hop data forwarding, \(EETC\Big{(}T_{single-hop}^{mn}(u)\Big{)}\), at particular slot u, is derived from the sum of the underwater transmission cost and the waiting cost, as expressed in Equation (24):  
\[EETC\Big{(}T_{single-hop}^{mn}(u)\Big{)}=cost\Big{(}T_{wait}^{mn}(u)\Big{)}+ cost\Big{(}T_{transmission}^{mn}(u)\Big{)} \tag{24}\]  
where \(T_{wait}^{mn}\) is the waiting time interval and \(T_{transmission}^{mn}\) represents a transmission time interval. The expected time interval between receiving a packet and beginning to send that packet to other nodes is considered to be the waiting cost. The underwater multi-hop data forwarding uses the single-hop EETC and an average of subsequent underwater relay nodes. This can be calculated as given in Equation (25):  
\[EETC(T^{mn}(u))=EETC\Big{(}T_{single-hop}^{mn}(u)\Big{)}+\frac{\sum_{o\in Set _{initial}^{n}}EETC(T^{no}(u))}{size\Big{(}Set_{initial}^{n}\Big{)}} \tag{25}\]  
where \(size\Big{(}Set_{initial}^{n}\Big{)}\) is the size of the relay set, \(EETC\Big{(}T_{single-hop}^{mn}(u)\Big{)}\) is the expected effective transmission cost for a single hop of the receiver node \(n\) in the relay node-set \(Set_{initial}^{n}\). Moreover, \(\frac{\sum_{o\in Set_{initial}^{n}}EETC(T^{no}(u))}{size\Big{(}Set_{initial}^{ n}\Big{)}}\) is the average dynamic transmission cost of the relay node-set \(size\Big{(}Set_{initial}^{n}\Big{)}\).