2.1. Electric Fish Optimization Algorithm
The Electric Fish Optimization Algorithm (EFO) divides the population into active and passive electro-located electric fish based on the magnitude of the electric field frequency of the weak electric fish itself. The active electro-located electric fish can be used to search for food and avoid danger within a limited range through the electric signals generated by themselves, while the passive electro-located electric fish can be used for electro-location through receiving electric signals [
2]. The design of EFO algorithm mainly consists of three parts: population initialization, active electrical positioning, and passive electrical positioning.
(1) Population initialization
In the EFO algorithm, the core parameters of electric fish individuals are their own position, frequency and amplitude of their electrical signals. The population initialization adopts a random initialization scheme, which randomly generates the coordinate values of N electric fish individuals in the D-dimensional space.
After initializing the position, the electric fish will set the frequency value of its electrical signal according to its own position. The frequency value
of the
i-th individual in the algorithm at the
t-th iteration will be determined by the individual’s fitness value, that is:
In equation (
1),
is the fitness value of the
i-th individual at the
t-th iteration;
and
represents the worst and best fitness values of the electric fish population at the t-th iteration, respectively;
and
are the minimum and maximum values of frequency, respectively. In the algorithm, this frequency is mainly used for probability calculation, so
and
are set.
The amplitude value of an individual determines the movable range of active electric field localization for electric fish, and also determines the probability of being perceived by passive electric field localization electric fish. In the EFO algorithm, the amplitude value
of the
i-th individual at the
t-th iteration is determined by the amplitude value
from the previous iteration and the frequency value
at this time. The calculation formula is as follows:
In equation (
2),
is a constant within the interval
, which determines the weight of the previous amplitude and the current frequency. The initial amplitude value of the
i-th individual is equal to its current frequency value
.
In the EFO algorithm, after each iteration, individuals with higher frequency values use active electric field localization (active mode), while individuals with lower frequency values will perform passive electric field localization (passive mode) . Afterwards, each individual moves in parallel according to their own situation to find the global optimum.
(2) Active electric field localization
In the EFO algorithm, the range of active electric field localization is limited, so active electric field localization determines the local search ability of the EFO algorithm. The range of motion of the
i-th individual in active mode is determined by its current amplitude value
, and its calculation formula is shown in (
3):
The distance between the
i-th and
k-th individuals is determined by the Cartesian distance formula:
Afterwards, if there are no other individuals within the search range of the active individual, then the active individual will perform Brownian motion within the active electric field range, as shown in equation (
5). If there are other individuals present, the individual will randomly select one active individual for position update, as shown in equation (
6).
In equations (
5) and (
6),
k is a randomly selected individual from other individuals within the search range,
is a uniformly distributed random number within the interval
, and
represents the candidate position for individual
i.
(3) Passive electric field localization
Unlike active electric field localization, passive electric field localization does not depend on the number of other active mode individuals around individual i, and its movable range is much larger than the range of active electric field localization. Therefore, in the EFO algorithm, passive electric field localization determines the algorithm’s global search ability.
The probability that individual
in active mode is perceived by individual
in passive mode,
, is related to the individual amplitude values of all active modes and the distance between individual
i and individual
k. It is calculated using the Roulette Wheel Selection, and the formula is as follows:
According to the probability value obtained from equation (
7), select K individuals from
, determine their reference position
using equation (
8), and generate a new position
using equation (
9).
In this logic, it is still possible for individuals with higher frequencies to perform passive electrical localization. When this situation occurs, the individual will completely lose their location information. To avoid this situation, the EFO algorithm considers using equation (
10) to update the candidate position of individual
i in the
j-th dimensional search space. Among them,
is a random number uniformly distributed in the
interval.
The final step in passive electric field localization is to use equation (
11) to modify the candidate position of individual
i in the
j-th dimensional search space, in order to increase the diversity of the population.
In the process of individual population localization, if the generated candidate position coordinates in a certain dimension exceed the specified global search range, the boundary coordinates of that dimension are considered as the candidate position coordinates to avoid going out of bounds.
After processing, the EFO algorithm will perform movement, and individuals will compare the fitness values of the candidate position with the current position. If the fitness of the candidate position is better than the current position, the individual will move to the candidate position, otherwise they will not move.
The basic process of EFO algorithm is shown in
Figure 1. This figure illustrates the workflow of the EFO algorithm, including population initialization, active electric field localization, and passive electric field localization. It highlights how individuals in the population switch between active and passive modes based on their frequency values, guiding the optimization process. Based on the active/passive electric field localization logic of the EFO algorithm, it can be concluded that the active electric field localization of the EFO algorithm enables active mode individuals to approach other active mode individuals, while passive mode individuals rely on passive electric field localization to approach the areas where active mode individuals gather, reflecting the aggregation behavior of EFO algorithm individuals.
2.2. Problems Encountered by EFO
When facing high-dimensional complex environments where the number of dimensions of an individual or the number of extreme values in the search environment is gradually increased, the optimization performance of the EFO algorithm is significantly reduced. The main problems that arise due to these limitations are as follows:
(1) Premature convergence
The characteristic of many heuristic algorithms, including the EFO algorithm, is to choose a better position to move than the current one. In complex environments, the individual’s reference position may not be better than the current position. At this time, the individual will not move, resulting in multiple ineffective iterations and a significant decrease in algorithm efficiency, which is known as premature convergence [
12,
13,
14].
(2) Easy plunges into local optimum
Trapping into local optimum is a common problem faced by most heuristic algorithms, and once trapped in local optimum, individuals will find it difficult to escape [
15,
16]. Due to the clustering trend of electric fish, the EFO algorithm is also susceptible to this problem, reducing its optimization ability.
(3) Passive electric field localization stagnation
According to equations (
7) and (
8), it can be inferred that, the passive electric field localization operation of the EFO algorithm needs to refer to the position of the active individual in the field. During the operation of the EFO algorithm, there may be a situation where the electrical signal frequency of all individuals is very low, and all individuals are in passive mode. In this case, if there are no active mode individuals on the field, it will be difficult for all passive individuals to move and the algorithm will come to a standstill. After testing, the probability of this situation occurring is very small, which is referred to as the passive electric field localization stagnation problem in this article.