**2. Metaheuristic Algorithms**

Metaheuristics are a special class of algorithms that can be used to solve search and optimization problems. As described in [34], they are approximate, usually non-deterministic methods that aim to search for solutions near the global optimum, exploring this space through a partly guided and partly random search. While the main disadvantage of metaheuristics is the uncertainty of reaching the global optimal solution, their advantages lie in not being problem-specific (allowing the flexibility of applying the same solving principle to several types of problems) and having intuitive mathematical models, borrowing concepts and approaches from the natural world, rather than from theoretical mathematical models. This contributes to their accessibility for a wider range of users. Most modern metaheuristics are population-based, starting from an initial group of solutions, called 'population', generated randomly, and refining it in an iterative process, according to a set of specific steps, until a stopping criterion is met. The performance of each individual from the population is assessed by computing its fitness function. The basic block diagram of a population-based metaheuristic algorithm (PMA) is depicted in Figure 1, where the steps common to all algorithms are represented with white boxes, and the part specific to each algorithm, delimited by symbols (A) and (B) is presented in gray.

**Figure 1.** The basic flowchart of a population-based metaheuristic algorithm.

The initial parameters are partially common to all algorithms, such as population size *N* or maximum number of iterations *maxit*, and partially specific to each algorithm, such as the mutation rate *rmut* for the Genetic Algorithm (GA) or inertia value *w* for the Particle Swarm Optimization (PSO). An individual from a population with *N* members, denoted in the following as

$$X\_i = [\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_m], \quad i = 1 \dots N \tag{1}$$

is encoded as a vector with length *m*, and element types and values dictated by the problem that needs to be solved. It usually represents an input parameter combination or a possible solution for the problem, which must satisfy all the constraints of the optimization model. The fitness evaluation of each population member requires the decoding of the information contained in the solution that it represents, solving the problem and evaluating the results. The optimality degree of the solution is assessed with the fitness function value associated to the respective population member. For a population with *N* members, *Xi, i* = 1, ..., *N*, *N* fitness functions will be computed and ranked.

The (A) to (B) section from Figure 1 consists of several steps, which describe each specific metaheuristic algorithm. While in the figures accompanying Sections 2.1–2.5 are presented all the details specific to each algorithm, delimited by (A) to (B), Table 2 summarizes their main steps, emphasizing their particularities.


**Table 2.** The metaheuristic algorithms used in the paper for solving the OCBA problem.

Among the various metaheuristic algorithms available in the literature, those from Table 2 were chosen taking into account the following reasoning: the genetic algorithm and the particle swarm optimization are the best known and widely used metaheuristics, with numerous applications in power systems, which makes them a valid basis for comparison. The bat algorithm and the whale optimization algorithm are newer algorithms, previously used by the authors in solving similar optimization problems and shown to improve the quality of the results, compared with GA and PSO [35,36]. On the other hand, the sperm whale algorithm is a novelty in solving optimization problems in the power systems field. The results from the case study will show that the SWA outperforms the previous algorithms, making it a viable new alternative for solving optimization problems related to power systems applications.

The best-known PMAs are the genetic algorithm and the particle swarm optimization, which also describe two fundamental search principles used by metaheuristic algorithms: the evolutionary and performance-based patterns.
