3.2.1. CH Selection
In addition to granting its members access to radio infrastructure, a Cluster Head (CH) assumes a pivotal role in orchestrating communications among nodes residing in distinct clusters [
32]. The primary criterion for selecting CH nodes revolves around the count of neighboring sensor nodes. Each sensor node's neighborhood encompasses all other sensor nodes situated within a specified radius. The neighborhood radius ca be expressed as:
where
is the neighborhood radius for a CH node,
Ar is the approximate radius of the network where wireless sensor nodes are dispersed, and
q is a constant parameter determining the distribution (density) of sensor nodes in the specified region.
Starting with a random chance, each node chooses to be a CH for that round. Accordingly, the predicted number of CHs in the current round can be calculated as:
where
N represents the total number of network’s nodes,
k is the index of sensor nodes, and
Probk (
t) is the probability of node
k for becoming a CH in the current round (
t) which can be expressed as:
where
is the expected number of CHs, and
is the expected number of nodes that are not selected as CHs in the previous rounds.
It is guaranteed that in
rounds, each node will be used exactly once. There is an equal likelihood that each given node in a cluster will be designated as CH [
33]. This guarantees that the energy at each node remains roughly constant during the whole game. Clustering is more likely to occur at higher-energy nodes than at lower-energy anodes [
15]. The energy consumption for a CH node in the network can be calculated as follows:
where
AvgResEn denotes the mean remaining energy of all nodes in the network, and
r represents the current round of simulations.
3.2.2. Cluster Formation
We propose the utilization of an AFSA-driven clustering algorithm aimed at optimizing the performance of CHs in UWSN. The attainment of cluster stability in UWSN is a vital prerequisite. It's crucial to underscore that in networks where data traverses from source to destination through CHs, the mere selection of highly qualified nodes as CHs does not guarantee the efficiency of clustering.
The AFSA serves as a means to enhance the exploration capacity within the search space by acting as a localized optimizer. In the natural world, fish locate richer feeding areas through individual exploration or by trailing other fish; typically, areas with a greater concentration of fish are more abundant in nourishment. AFSA is an effective, stochastic, and parallel searching technique, first introduced by Li in 2002 [
34]. This approach employs the local exploration tendencies of individual fish to ultimately achieve the global optimal solution by mimicking fish behaviors like hunting, grouping, and shadowing.
In AFSA, each artificial fish (AF) symbolizes a potential solution to the optimization problem, aiming to pinpoint the optimum point within the fish swarm with the highest food concentration. Initially, AFs' are randomly generated, and the position with the highest quality is noted on the bulletin board. AFs improve their positions by performing behaviors including swarm, follow, foraging, and random movement. Based on these behaviors' outcomes, they decide whether to relocate, and the bulletin board updates with the best AF position. Over iterations, AFs gradually fine-tune their locations, ultimately converging to the optimal solution recorded on the bulletin board.
In the search for a target position with a superior food concentration, each AF engages in swarming, following, and foraging behaviors. When the predefined criteria for any of these behaviors are met, they are carried out successfully, resulting in the discovery of a fresh position. However, if none of the behaviors of swarm, follow, or foraging, can be executed successfully, the AF resorts to random behavior, adopting the resultant position as its new location. In cases where one or more of the swarm, follow, and foraging behaviors prove effective, the AF chooses the new position with the highest food concentration as its updated location. Details regarding these behaviors are elaborated upon in the following section.
Denoting
UC as the center of positions for all agents within the partnership (neighborhood area) of AF
i within its visual range, the swarm behavior is initiated if
UC exhibits a higher food concentration, and the vicinity of
UC remains uncrowded. Subsequently, AF
i takes a random step towards
UC, leading to the determination of its new position, denoted as
, which can be expressed as follows:
where
is the current position of the AF
i at the current time period
t,
is the updated position of the same AF at the next time period,
STEP is a parameter that signifies the largest possible step size that an organism can move in one time period, and
RND represents a random value generated between 0 and 1. Moreover, ||
Uj –
Ui|| is the Euclidean distance between the AFs
i and
j.
Every AF seeks out the optimal position, denoted as
UBST , characterized by the highest food concentration within its visual range. When
UBST boasts a superior food concentration, and the immediate vicinity of
UBST remains uncongested, the follow behavior is executed effectively. Under the follow behavior, AF
i randomly takes a step towards
UBST, acquiring a fresh position as outlined below:
According to the foraging behavior, the AF
i may collect the states of the other fishes and randomly select a state
Uj that falls inside its detection range. Then, updating of AF
i can be expressed as follows:
If none of the swarm, follow, or foraging behaviors are executed successfully, the algorithm resorts to a random movement. This random behavior serves as an effective mechanism to avoid getting trapped in local optimums. Under this approach, AF
i takes a random step from its current position, resulting in its new location as described below:
Depending on the application, a different fitness measure can be used to determine the effectiveness of each particle. Our proposed fitness function for this strategy aims to do two things: (1) Make CHs more durable, and (2) Limit the intra-cluster distance between nodes and their CHs. It can be formulated as:
where
AvgEnCHs is the average energy of the selected CHs. Moreover,
AvgInterDist and
AvgIntraDist are the average inter-cluster distance and average intra-cluster distance, which can be calculated as:
where
M is the number of selected CHs,
Ci represents the position of
i-th CH within the network,
k is the node number,
CHk is the CH of node
k, and
d(
x,
y) is the Euclidean distance between nodes
x and
y.