Optimal Power Dispatch of DGs in Radial and Mesh AC Grids: A Hybrid Solution Methodology between the Salps Swarm Algorithm and Successive Approximation Power Flow Method

: In this paper, we address the problem of the optimal power dispatch of Distributed Generators (DGs) in Alternating Current (AC) networks, better known as the Optimal Power Flow (OPF) problem. We used, as the objective function, the minimization of power losses ( P loss ) associated with energy transport, which are subject to the set of constraints that compose AC networks in an environment of distributed generation. To validate the effectiveness of the proposed methodology in solving the OPF problem in any network topology, we employed one 10-node mesh test system and three radial text systems: 10, 33, and 69 nodes. In each test system, DGs were allowed to inject 20%, 40%, and 60% of the power supplied by the slack generator in the base case. To solve the OPF problem, we used a master–slave methodology that integrates the optimization method Salps Swarm Algorithm (SSA) and the load ﬂow technique based on the Successive Approximation (SA) method. Moreover, for comparison purposes, we employed some of the algorithms reported in the specialized literature to solve the OPF problem (the continuous genetic algorithm, the particle swarm optimization algorithm, the black hole algorithm, the antlion optimization algorithm, and the Multi-Verse Optimizer algorithm), which were selected because of their excellent results in solving such problems. The results obtained by the proposed solution methodology demonstrate its superiority and convergence capacity in terms of minimization of P loss in both radial and mesh systems. It provided the best reduction in minimum P loss in short processing times and showed excellent repeatability in each test system and scenario under analysis. curation, writing—original draft, writing—review and editing, visualization, supervision, project administration, acquisition of funds. L.F.G.-N.: conceptualization, methodology, software, validation, formal analysis, investigation, resources, data curation, writing—original draft, writing—review and editing, visualization, supervision, project administration, acquisition of funds. O.D.M.: conceptualization, methodology, software, validation, formal analysis, investigation, re-sources, data curation, writing-original draft, writing—review and editing, visualization, supervision, project administration, acquisition of funds. F.A.: conceptualization, methodology, writing—review and


General Context
As is well known, access to electricity is a fundamental right and is one of the United Nations' Sustainable Development Goals, given its importance in the development of society, as electricity provides comfort and a wide range of benefits for people [1][2][3][4]. However, its consumption has risen exponentially in recent years, and its misuse has caused severe environmental and economic impacts on the planet due to the increased CO 2 emissions and higher operating costs associated with its distribution [5][6][7]. Different solutions to these problems have been sought, including the development of new energy management technologies and strategies to increase electricity production around the world, as well as the development and application of new energy distribution technologies such as Distributed Generators (DGs) [8] and energy storage elements (e.g., batteries, capacitors, ultracapacitors, and superinductors) [9]. These solutions have lead us to reconsider the way conventional energy transport systems operate [10]. For the above reasons, network operators and researchers in this field have looked for energy alternatives other than fossil fuels and proposed the use of renewable energies and the integration of DGs into electric networks to meet energy demands while remaining environmentally friendly [11][12][13].
The integration of DGs into an Alternating Current (AC) network helps to minimize the system's power losses (P loss ), improve the voltage profiles, and reduce the currents flowing through the distribution lines, which could reduce the gauge of the conductor being employed, and thus the costs associated with energy distribution within the AC system, while respecting the technical and operational constraints of this type of electrical system. The positive or negative effects of installing DGs in electrical networks are closely related to their level of power injection, which depends on the power demanded by users and the characteristics of the electrical system itself [11,14,15].
The problem of the optimal power dispatch of DGs in electrical power networks is known as the Optimal Power Flow (OPF) problem, which entails determining the power to be injected by each DG to meet the goal established by the network operator. In this study, we selected the reduction in P loss as the objective function [16][17][18]. Importantly, to solve the OPF problem, it should be divided into two stages. The master stage is the first one. This is responsible for proposing the optimal power levels to be supplied by each DG in the AC networks, which are linked to their minimum and maximum power levels. The slave state is the second one. This is in charge of solving the power flow problem and evaluates the impact of each solution proposed by the master stage in the objective function and constraints that represent the problem under analysis. In this way, the slave stage allows us to determine both the P loss and the nodal voltages for each of the solutions proposed in the master stage [15,18,19]. The OPF problem is considered a nonlinear nonconvex problem that must be solved using methods that produce high-quality solutions in short processing times. Thus, we propose using numerical methods and optimization algorithms that allow us to find the global optimum for the objective function of the OPF problem [8,[20][21][22][23].

State of the Art
In recent years, various authors have proposed solutions to the OPF problem in AC networks, with the goal of achieving proper power dispatch into the network and obtaining benefits from power injection by DGs. Some of the objective functions that have been used for this purpose are: (i) the minimization of P loss associated with the optimal location and sizing of DGs in the network, (ii) the proper management of energy through energy storage systems, (iii) the reduction of CO 2 emissions, and (iv) the minimization of related costs [24]. Considering the intelligent operation of DGs, the OPF problem in AC networks seeks (in most of the reported cases) to minimize the P loss associated with energy distribution [14]. To solve this problem, different studies in the specialized literature have proposed using commercial software, as well as optimization techniques based on sequential programming that can be replicated using open source software [17]. These solution methodologies help to determine the power levels to be injected by the DGs in order to minimize P loss in AC networks and ensure that the set of constraints that compose the OPF problem are respected [8,17,22,23].
The authors of [25][26][27] used commercial software to solve the problem of OPF in AC grids. In the particular case of [25], the OPF problem was tested in the IEEE 14-and 30-node systems, and a multi-objective mixed integer nonlinear programming model was proposed. The problem was modeled in the software GAMS (General Algebraic Modeling System) and solved using DICOPT solver. As objective functions, the authors of such study considered the reduction in total fuel cost, the minimization of active power losses, and the improvement of the system's loadability. Their proposed model produced excellent results in terms of solution quality, and was compared with the following techniques: the Differential Evolution (DE) algorithm, Sequential Quadratic Programming (SQP), and Particle Swarm Optimization (PSO). Moreover, the authors analyzed processing times, as well as the reduction in minimum P loss , but did not evaluate the currents flowing through the lines (as part of the constraints), the repeatability of the obtained solutions, and the behavior of the proposed solution methodology in larger networks. In [26], the authors employed the PSO algorithm and DigSILENT as the solver, with the minimization of P loss as the objective function. The simulations were carried out in the 9-and 22-node test systems, taking into account the costs associated with power generation and the nodal voltages. In such study, however, the currents flowing through the lines and the processing times and standard deviations of the proposed solution methodology were not considered. In [27], the authors used a discrete-continuous programming method, which employs the Chu & Beasley genetic algorithm to identify the power levels to be injected by the DGs. They also employed DigSILENT to solve the load flow problem using as objective function the minimization of P loss in the 6-, 14-, and 39-node test systems under four different scenarios. The authors of such study took into account the nodal voltages, the processing times, and the loadability of the lines, but did not take into account the standard deviations of the proposed solution technique when executed (the repeatability of the solution was not analyzed). Additionally, the proposed solution methodology was not compared with other techniques, which does not allow the impact of its solution to be measured.
Furthermore, open-source software that uses optimization techniques based on sequential programming has been widely employed in the specialized literature to solve the OPF problem in AC networks, avoiding the need for commercial software, which is costly and highly complex [28][29][30]. For instance, in [28], the authors employed the Artificial Bee Swarm Optimization (ABSO) algorithm, with the minimization of P loss in AC networks as the objective function, and tested it in the IEEE 18-and 30-node test systems. They considered the nodal voltages bounds, without analyzing the processing times and standard deviations of the solution obtained; as well as the currents limits assigned to the lines (as part of the set of constraints). In [29], a bio-geography-based optimization algorithm was proposed, having, as the objective function, the minimization of P loss in the IEEE 30and 57-node test systems. In such study, the authors took into account the processing times to evaluate the efficiency of the proposed solution methodology, but did not analyze the repeatability of the obtained solutions. Additionally, the currents flowing through the conductors of the AC network were not considered as part of the set of constraints proposed in the mathematical formulation. In [30], the PSO algorithm and two of its variants (TPSO and TCPSO) were used to solve the OPF problem, with the objective function being the minimization of P loss in the IEEE 57-and 118-node test systems. In such study, the authors took into account the nodal voltages (as part of the operational constraints) of the test systems under analysis, but did not consider the currents flowing through the conducting lines. Likewise, they did not analyze the processing times and standard deviations of the methodology they employed. Finally, Table 1 summarizes the commercial and sequential programming solution methods identified inside the state of the art reported for solving the problem addressed in this work.
Importantly, if the behavior of the currents flowing through the conductors is not considered in the proposed mathematical formulations, it is not possible to ensure that the results obtained by the implemented methodologies will satisfy the technical and operational constraints of the test systems under analysis. Moreover, after the literature review, we noticed that, the optimization techniques were not tuned in any of the studies mentioned above; hence, the conditions for the solution methodologies proposed in each paper are not guaranteed to be the same [17]. Table 1. Commercial and sequential programming solution methods reported in literature for solving the power dispatch problem in AC grids.

Method Year Reference
Bio-geography Optimization Algorithm 2010 [29] Artificial Bee Swarm Optimization Algorithm 2012 [28] Turbulent Crazy Particle Swarm Optimization 2017 [30] Continuous Genetic Algorithm 2018 [31] Particle Swarm Optimization 2018 [32] Ant Lion Optimizer 2021 [33] Black Hole 2021 [15] Multi-Verse Optimizer 2022 [14] Considering the previous literature review, it was identified that the OPF problem is a very important problem for power engineering at any voltage level, and it continues to be an extensively studied problem. For this reason, new methodologies, preferably in free software, are needed to ensure good numerical results with low computational effort. Additionally, these methodologies should include, in their mathematical formulation, all the constraints associated with the operation of AC networks in an environment of distributed generation, such as active and reactive power balance, power limits associated with the DGs and conventional generators, and current limits through the power distribution lines of the systems under analysis. Additionally, to evaluate the repeatability of the proposed solution methodologies, their results must be statistically analyzed, taking into account the standard deviations obtained by the methodologies each time they are implemented. Furthermore, it is necessary to analyze the processing time required by each solution method. The purpose of these performance indices is to guarantee to the users that the algorithm will provide a high-quality solution every time it is executed.
In light of these current needs, this paper presents a master-slave methodology that can be used to solve the OPF problem and that can be replicated in any type of open-source software. The master stage uses the Salp Swarm Algorithm (SSA) presented in [34], which was selected because of its excellent performance in solving different research problems and its different applications in engineering problems focused on renewable energies, power generation, and distribution systems [22,23,35,36]. The slave stage employs the Successive Approximation (SA) numerical method proposed in [37], which was selected because of its outstanding performance in terms of convergence and processing time when solving the load flow problem. To validate the proposed solution methodology, we use one 10-node mesh test system and three radial text systems of 10, 33, and 69 nodes. For each test system, we consider the maximum power allowed for the DGs of 20%, 40%, and 60% of the power supplied by the slack generator in a scenario with out DGs. Each scenario will be tested 100 times to evaluate standard deviation, repeatability, and average processing time of all solution methodologies used.

Scope and Main Contributions
In this study, we address the OPF problem in AC networks in an environment of DG and solve it using a master-slave methodology based on sequential programming to avoid the need for commercial software. Such methodology uses the SSA in the master stage to determine the power levels to be injected by the DGs and the SA numerical method in the slave stage to evaluate the load flows, and thus analyze the impact of the power configurations suggested by the master stage on the P loss and the limits of the problem. The purpose of this is to present a hybrid methodology that is highly efficient in terms of solution quality and processing times and with an adequate repeatability every time it is implemented. The following are the main contributions of this study to the electrical power literature field: • A new solution methodology for solving the AC OPF problem based on a master-slave strategy by considering the reduction of power loss as objective function and all sets of constraints that make up the operation of a AC grid under a distributed generation environmental.

•
An OPF solution approach that solves different distribution network topologies (radial and meshed) and improves recent literature reports based on combinatorial optimization algorithms such as continuous genetic algorithm, Multi-Verse Optimizer, black hole optimization, particle swarm optimization, and ant lion optimization. • The implementation of a global parameter-tuning optimization algorithm to guarantee the same conditions for each technique being employed in terms of solution quality, repeatability, and processing times.
Note that to validate the proposed optimization method, we selected the 10-bus grid and the IEEE 33-and IEEE-69 bus systems, since these are distribution networks typically employed for evaluating optimization models in AC distribution networks. Some of the studies in which these test feeders have been employed include: (i) power flow studies [38]; optimal placement and sizing-dispersed generation [39]; optimal siting and sizing capacitor banks [40]; optimal location of series reactive power compensators [41]; and optimal grid reconfiguration problems [42], among others. In addition, the proposed OPF solution approach is tested, considering that the DGs can inject 20%, 40%, or 60% of the total power injected by the slack where no DGs are connected to the distribution grid. These values were selected since previous literature reports have used these values to make multiple validations in OPF solution methodologies with excellent numerical results and multiple scenarios for making cross-validation [17].

Structure of the Paper
The rest of this paper is organized as follows. Section 2 explains the mathematical formulation and the set of constraints that compose the OPF problem, with the objective function being the minimization of P loss associated with energy distribution in AC networks. Section 3 reports the proposed master-slave methodology, which uses the SSA in the master stage and the SA numerical method in the slave stage. Section 4 shows the methods employed for comparison, as well as the parameters that allow each algorithm to find the best possible solution to the OPF problem. Section 5 details the radial and mesh test systems employed for the simulations. Section 6 presents the results obtained by the proposed optimization algorithm and the techniques used for comparison in the test systems under analysis. Finally, Section 7 draws the conclusions and proposes future lines of work.

Mathematical Formulation
This section shows the mathematical model used to solve the OPF problem in AC networks in an environment of distributed generation. This model employs as an objective function the minimization of P loss in AC networks, and considers the set of constraints that make up the problem. We selected such objective function because it is widely used to evaluate the efficiency, solution quality and convergence capability of the optimization algorithms that solve the OPF problem in AC networks [25,[27][28][29][30].

Objective Function
The Equation (1) presents the selected objective function, which is entrusted to minimize the active power losses associated with the distribution of electric energy inside the AC networks.
In Equation (1), the variable P loss symbolizes the active power losses. Y L is a square symmetric matrix that is composed by the admittances of the lines that interconnect the nodes in the system; and v is a vector that contains all voltage nodes.

Set of Constraints
The equations from Equations (2)-(6) described all technical limits of an AC network under an environmental of the distributed generation.
Equation (2) presents the total power balance in the AC grid, where S CG , S D and P DG are the complex power provided by the slack generator, the complex power demanded by the loads, and the active complex power supplied by the DGs into the system, respectively. Y N and D(v) are the nodal admittances matrix, and the symmetric matrix that contains the complex voltages of the network in its diagonal. Equation (3) denotes the power limits fixed for each DG installed in the network, where S min DG and S max DG are the minimum and maximum power injected for each DG with respect to the active power allowed by the slack generator. It is good notice that, in this mathematical formulation, it is considered that the DGs just supply active power into the AC grid. Equation (4) expresses the voltage bounds for each node in the system, where v min is the minimum and v max the maximum voltage. Equation (5) describes the maximum current that can flow through the lines of the system, where I B is the maximum current flowing through the lines of the AC network, and I max B is the maximum current that the conductor used for the electrical system can support; by considering a non-telescopic grids. Equation (6) denotes the maximum active power percentage fix for each DG, where 1 T denotes a vector filled with ones, and α is the allowable penetration in percentage, which, in this study, can take a value of 20%, 40%, or 60%. Real{S D } in this equation, corresponds to the real part of the complex demand power vector (S D ), which is associated with the active power generated by the DGs installed in the network.
In addition to these equations, we present Equation (7), which is used to guarantee that each constraint of the OPF problem is respected, as it penalizes the algorithm if the limits established in Equations (2)-(6) are violated. As a result, an adaptation function is generated for the problem, which allows the algorithm to explore infeasible regions in order to improve the quality of its solution and reduce its processing time [17].
In the Equation (7), penalty coefficients were determined using a heuristic strategy: by assigning the same penalty factor (1000) from β 1 to β 6 . When the whole set of constraints is satisfied, the adaptation function takes the same value of the objective function, so z becomes P loss .

Proposed Solution Methodology
As observed in the mathematical formulation, the OPF problem is of a nonlinear, nonconvex nature, which implies that it must be solved using specialized commercial software or optimization algorithms and numerical methods. In this paper, we propose using numerical methods and optimization algorithms that can be replicated in open-source software, thus limiting the use of commercial software. To solve the OPF problem, we propose dividing it into two stages. The first stage (master stage) uses the SSA [34,43] to determine the level of active power to be injected by each DG into the AC network. The second stage (slave stage) employs the SA numerical method [38] to run the load flow for each solution proposed by the master stage and calculate the P loss based on the power levels defined by the optimization algorithm. The proposed master-slave (SSA-SA) methodology is further described below.

Master Stage: Salp Swarm Algorithm (SSA)
The SSA is a bio-inspired optimization technique employed to solve discrete and continuous problems. This technique is based on the foraging behavior of salps, which pump water through their internal feeding filters to feed on phytoplankton while moving in swarms (in the form of a chain) in a coordinated and fast manner. This behavior can be modeled mathematically to be used as an optimization method [34]. Figure 1 presents the flowchart that describes the stages required for the computational development to obtain a solution to the OPF in AC networks through the SSA. All the steps developed within this algorithm are described below: Generating the Initial Population Initially, within the proposed SSA algorithm, the data must be read and then assigned the initial conditions that represent the problem under study. These conditions include, among others, the parameters of the electrical system, algorithm parameters for optimization and stop criteria of the SSA. It is important to highlight that for the parameterization of the optimization method, a PSO was used to tune and adjust the parameters of the algorithm to the needs of the problem under study. In other words, this is carried out with the aim of guaranteeing the equality of conditions between the validation methods and ensuring that each optimization algorithm obtains the best solution for the selected objective function) [24]. After loading the parameters and main data of the problem, the initial population is generated, taking into consideration the restrictions of the problem and a random variable to form the chain of Salps. Within this population, each individual corresponds to a salp, which is composed of the possible power supply by each DGs located in the AC network. To generate each component of the salts that are part of the initial population (Sal ps (i,j) ), Equation (8) is used, where i represents the number of Salps to be used within the solution space and j represents the number of variables to be determined (the powers to be injected by each of the DGs installed within the CA network). Equation (8) is focused on the creation of Salps particles and allows larger regions of the search space to be explored, which generates the values contained within each Salp chain from the upper and lower limits (ub) and (lb), which correspond to the maximum and minimum power levels allowed in each DG within the electrical grid. It is important to highlight that the diversity among the individuals of the population is achieved through the implementation of random values (rand) between [0-1]. These random numbers multiplied by the difference of the limits allow a larger distribution of the particles to be generated within the search space.

Sal ps
After the creation of the initial population of Salps, it is necessary to evaluate their impact on the objective function and the restrictions of the problem. To perform this task, the ability of the (Sal ps (i,j) ) within the objective function is evaluated for each Salp chain (adaptation function) by using the slave stage. Then, each of the obtained values are stored in Equation (9), which is in a matrix of size nx1 called MO Sal p (n,1) ; this matrix stores the impact of each of the Salps in the adaptation function; we use these values to carry out the advance strategy of the algorithm. The algorithm advance considering the best solution achieved by each Salp and the best solution of the chain (incumbent).
Once the evaluation of the adaptation function of the initial population has been carried out, Equation (10) stores the incumbent of the problem as the leading Salp (X) or individual of the population that presents the best fitness function, which is the X that presents the best solution within the chain of Sal ps (i,j) ; becoming the Salp leader of the problem, while the rest of the individuals that make up the chains of Salps will be called followers.
It should be noted that the value obtained by the leading Salp will be stored in Equation (11), where it refers to phytoplankton (incumbent F) and it is represented as an information vector of size 1xd, which allows the storage of said Salps chain information.
After selecting the incumbent of the problem in the Iterative process of the SSA, the process starts with the advancing of the algorithm through the displacement of the leading Salp to half of the individuals corresponding to the chain of Salps, which allows the generation of new populations and the improvement of the incumbent F within the iterative process. It should be noted that the advance mechanism is given by a random variable that guarantees exploration of the region surrounding the incumbent, this with the aim of safely exploring the solution space. Equation (12), represents the advancement method of half of individuals updating the Sal ps (i,j) . Where C 1 , is a coefficient that controls the exploration and exploitation of the solution and the displacement of Salps, l and L represent the current iteration and the maximum number of iterations, respectively. Parameters C 2 and C 3 are random values given between [0, 1]. It should be noted that the parameter C 3 is used as a condition for addition or subtraction between the values calculated from the best population F (i,j) and the maximum and minimum limits given by the constraints of the problem.

Sal ps
To complete the advance method, it is necessary to update the rest of the individuals in the Salps chain (from the middle plus one to the end of the population), using Equation (13). This equation allows information to be shared between Salps with the best response and those with the worst in the population of the chain of Salps. This equation is used in order to obtain a higher probability of generating new locations within the solution space.
The particle advance method is repeated until the stopping criteria established for the algorithm are reached. The optimal solution of the problem is provided by the leader Salp F (1,j) and X obtained when the iterative process ends. Finally, for the master stage (SSA), two stopping or convergence criteria were used to control the exploration and processing times of the algorithm: The first criterion ends the process when a maximum number of iterations is reached. While the second stop criterion terminates the algorithm after reaching a certain number of iterations without obtaining improvements in the response or without obtaining a better response. This is done in order to avoid scans that only affect the convergence times of the algorithm.

Slave Stage
To perform the calculation of the power flow, it is necessary to apply the SA method to determine the voltages profile in the electrical system by considering the power demanded and supplied by the loads and DGs. These voltages profiles will be used inside the objective function to calculate the P loss , and with this information and the penalty calculated with the voltages profiles too, we will calculate the adaptation function used inside the master stage. The selection of the SA [38] in this paper is due to its ability to solve the load flow in any type of electrical network (meshed and radial), and the excellent results reported by the author for this power flow method in terms of convergence and processing time. This method is based on the following equation: In this equation, Y dd and Y dg represent the components of the nodal admittance related to the load and generator nodes, respectively. Furthermore, the voltage related to the Slack generator is defined as v g , and v d is a vector that contains the voltages at the demand nodes. Given this equation, a mathematical development can be performed in order to obtain the equation that allows us to determine the nodal voltages at the demand nodes: To compute the voltages in the nodes other than the slack node in an iterative manner and with an almost-null convergence error, a t counter must be used. Such counter is thus added to Equation (15). As a result, the following equation can be used to calculate the voltage profiles:

Optimization Algorithms Employed for Comparison and Parameters
To evaluate the robustness, convergence capacity, and quality of the solution provided by the methodology proposed in this paper, we employed the most widely used techniques in the literature field to solve the OPF problem in AC networks: the Black Hole (BH) [44], the Ant Lion Optimization (ALO) [33], the Multi-Verse Optimizer (MVO) [45], the Continuous Genetic Algorithm (CGA) [46] and the Particle Swarm Optimization (PSO) [46]. In addition, the selection of these optimization methodologies was based on the excellent performance in terms of quality of the solution and processing times reported by the authors. Each one of them was employed as a master-slave, using the SA as slave stage in all scenarios.
The simulations were performed in the 10-, 33-, and 69-node radial test systems and in the 10-node mesh test system [17,37,47]. These test systems were selected with the aim of evaluating the convergence capacity and quality of the solution provided by each optimization algorithm in networks of any size with both radial and mesh topologies.
To guarantee a fair comparison between the optimization algorithms used, it is necessary to perform a tuning of each optimization methodologies with the aim of finding the optimization parameters that allow us to obtain the best results for the problem studied. Given this, a PSO algorithm [46] is used, to perform such tuning. This PSO uses a population of 10 individuals and 300 iterations. The ranges used to tune all parameters were: number of particles or individuals over a range of [1-100], the maximum number of iterations [1-1000] and a non-improvement or convergence counter with a range of [1-1000]. The parameters obtained for each algorithm are presented in Table 2, which is ordered as follows from left to right: the first column shows the optimization algorithm, the second column shows the number of individuals, the third column shows the maximum number of iterations, and finally, the fourth column shows the number of non-improvement iterations. These parameters allow each algorithm to find the best possible solution for the OPF problem in AC networks.

Test Scenarios and Considerations
To assess the impact and convergence capacity of each optimization algorithm, as well as the precision and repeatability of their solution to the OPF problem in AC grids with mesh and radial topologies, we employed one 10-node mesh test system and three radial text systems with 10, 33, and 69 nodes, respectively. These test systems were selected because they are widely employed in the specialized literature to solve the OPF problem [8,17,28,48]. Each test system features a single slack generator and no DGs in the base case.

Radial Test Systems
This subsection describes the radial test systems employed in this study to carry out the simulations. 5.1.1. 10-Node Radial Test System Figure 2 shows the electrical diagram of a 10-node radial test system, which has 9 lines and 10 nodes (see Table 3 without considering information regarding lines 5-10, and 8-10, respectively.). In the base case, this system employs a base voltage of 23 kV and a base apparent power of 100 kVA. The power losses of this system amount to 223.4181 kW, and the slack generator injects a complex power of (12591.4181-4493.9356i) kVA. The electrical parameters of this system were taken from [38], and the DGs were located at nodes 5, 9 and 10, allowing them to inject 20%, 40%, and 60% of the active power supplied by the slack generator in the base case. For all the DGs, the minimum power to be injected was 0 kW for all the three penetration levels of distributed generation, and the maximum power to be injected was 2518.2836 kW, 5036.5673 kW and 7554.8509 kW for the 20%, 40% and 60% penetration levels, respectively. After running a load flow analysis for this system, the maximum operating current was 581.2757 A. Hence, a 1250-kcmil conductor operating at 75 ºC was selected, which was located in all the segments of the network. This conductor can support a maximum current of 590 A. Additionally, the voltage at which this system operates should be within +/−10% of the nominal voltage.   Figure 3 illustrates the 33-node radial test system, which consists of 32 lines and 33 nodes, and the way its components are interconnected. In a scenario with no DGs, this system employs a base voltage of 12.66 kV and a base power of 100 kVA. Additionally, the power losses of this system amount to 210.9785 kW, and the slack generator injects a complex power of (3925.9785 + 2443.1281i) kVA. The electrical variables that make up this system were taken from [47], and the DGs that were allowed to inject power were defined as in [17] and located at nodes 12, 15 and 31. As in the 10-node radial test system, the DGs were allowed to inject 20%, 40%, and 60% of the power supplied by the slack generator. For all the DGs, the minimum power to be injected was 0 kW for each penetration level, and the maximum power to be injected was 785.1957 kW, 1570.3914 kW, and 2355.5871 kW for the 20%, 40%, and 60% penetration levels, respectively. After running a load flow analysis using the SA numerical method, the maximum current was 365.2518 A. Hence, a 700 kcmil conductor operating at 60ºC was employed in each segment of the network, which allows a maximum current of 385 A. As in the previous test system, the voltage at which this system operates should be within +/−10% of the nominal voltage.   Figure 4 shows how the components of the 69-node radial test system, which consists of 68 lines and 69 nodes, are interconnected. This system employs a base voltage of 12.66 kV and an apparent base power of 100 kVA. In addition, the active power losses of this system amount to 242.1523 kW, and the slack generator supplies a complex power of (4132.8423 + 2803.0132i) kVA. The electrical parameters of this system were taken from [47], and the DGs were located as in [17] at nodes 26, 61, and 66. As in the previous two test systems, three penetration levels of distributed generation (20%, 40%, and 60%) were considered for this system. For all the DGs, the minimum power to be injected was 0 kW, and the maximum power to be injected was 826.5685 kW, 1653.1369 kW and 2479.7054 kW for the 20%, 40% and 60% penetration levels, respectively. After running a load flow analysis, the maximum current was 394.4489 A. Hence, a 50 kcmil conductor operating at 60ºC was used, which was located in each section of the network, allowing a maximum current of 400 A. As in the previous two test systems, the voltage at which this system operates should be within +/−10% of the nominal voltage.

Mesh Test System
This subsection describes the mesh test system used in this study to perform the simulations. Figure 5 depicts the 10-node mesh test system, which is a variation of the 10-node radial test system presented in the previous subsection. However, in this case, it has 10 nodes and 11 lines (see Table 3). The information about the distribution lines and loads of this system was taken from [38]. In this system, the slack generator supplies complex power of (12,558.3237-4480.7386i) kVA, and the power losses amount to 190.3237 kW. For all the DGS, the minimum power to be injected was 0 kW, and the maximum power to be injected was 2511.6647 kW, 5023.3295 kW and 7534.9942 kW for the 20%, 40%, and 60% penetration levels, respectively. The maximum current flowing through the segments of the system was 579.7276 A. Hence, a 1250 kcmil conductor operating at 75 ºC was selected, which supports a maximum current of 590 A and was located in each segment of the network. As in the previous test systems, the voltage at which this system operates should be within +/−10% of the nominal voltage.

Simulations and Results
This section presents the results of the simulations carried out to solve the OPF problem in AC networks. All the simulations were performed in Matlab ® (version 2021b) running on a laptop with an Intel ® Core TM i5-8250U@1.60GHz 1.80 GHz processor, 4 GB of RAM, a 225-GB solid-state drive, and Windows 11. To evaluate the repeatability and standard deviation of each technique and guarantee the same conditions for all, the techniques were tuned and executed 100 times.

Radial Test Systems
This subsection analyzes the results obtained by each optimization method employed to solve the OPF problem in AC grids with a radial topology. Table 4 shows the results reached by each optimization method in the 10-node radial test system. From left to right, this table details the optimization algorithms used to solve the OPF problem; the nodes where the DGs are located and the active power they inject into the network (kW) while respecting the set of constraints of the problem; the minimum P loss (kW) and the percentage of reduction with respect to the base case (%); the average P loss (kW) and the percentage of reduction with respect to the base case (%); the processing time employed by each algorithm to solve the OPF problem (s); the standard deviation (STD) of each optimization algorithm (%); the worst potential difference in the system (p.u.) and the node where it occurs; and in the last column, the maximum current in the solution provided by each optimization algorithm (A). Importantly, this table also reports the behavior of the system in the base case, in which the P loss amount to 223.4181 kW and the maximum current supported by the conductor selected for this system is 590 A. Table 4. Results of the simulations in the 10-node radial test system. From the information presented in Table 4, it is possible to identify the differences between the proposed methodology (SSA) and the optimization techniques selected for comparison. Using these results, we constructed Figures 6-8, which compare the results obtained by the different techniques used for comparison purposes to those of the SSA. Figure 6 depicts the minimum P loss reduction obtained by each technique at the three penetration levels of distributed generation: 20%, 40%, and 60%. In relation to the first penetration level (20%), the SSA and PSO obtained the best results in term P loss reduction with a reduction of 47.6668% when is compared with the base case (an scenario without DGs), outperforming the MVO by 0.0001%, the ALO by 0.0114%, the CGA by 0.0536%, and BH by 0.4488%. With respect to penetration level of 40%, the SSA and PSO obtained the best solution, with a minimum P loss reduction of 63.8522%, improving the results obtained by the MVO, the CGA, the ALO, and BH in 2 × 10 −5 %, 0.0089%, 0.0141%, and 0.0965%, respectively. Finally, for the third scenario (60%), the SSA, the MVO, and PSO achieved the best solution in relation to the minimum P loss with a value of 72.1260%; outperforming the ALO by 0.021%, the CGA by 0.0038%, and BH by 0.0107%. Figure 6. Percentage of reduction in minimum power losses obtained by the SSA in the 10-node radial test system compared to that of the other methodologies. Figure 7 depicts the average P loss reduction reached by each optimization algorithm for the three penetration levels used. For the penetration level of 20%, the SSA achieved the best average reduction of P loss in relation to the base case with a value of 47.6660%; by improving the results obtained by the comparison methods in a 0.5767%. In the particular case of the penetration level of 40%, the SSA obtained the best average P loss reduction with a percent of 63.8521%, outperforming the MVO by 0.0004%, PSO by 0.0973%, the CGA by 0.1104%, the ALO by 0.4892%, and BH by 0.7502%. Finally, for the penetration level of 60%, the SSA, PSO, and the MVO exhibited an average P loss reduction of 67.1260%, improving the results obtained by the ALO, the CGA, and BH in an average percentage of 0.0055%. Figure 8 presents the STD reached by each optimization algorithm at the three percentages of penetration used. From this figure, one may determine how precise the algorithms are at finding a solution to the OPF problem in AC networks. At 20% penetration, the SSA obtained the best STD (0.0025%), outperforming the MVO by 0.0024%, the CGA by 0.1709%, the ALO by 0.7186%, PSO by 1.3254%, and BH by 1.7438%. At 40% penetration, the SSA presented the best STD with a value of 3.47%, outperforming the MVO, the CGA, PSO, BH and the ALO by 0.0006%, 0.1787%, 0.9093%, 1.0836%, and 1.7968%, respectively. Finally, at 60% penetration, the SSA exhibited a STD of 4.23 × 10 −11 , outperforming the other techniques by an average percentage of 0.5607%.  According to these results, the SSA provided the best solution to the OPF problem in small networks, in terms of both minimum P loss reduction and average P loss reduction. It also obtained an excellent STD, which guarantees that a high-quality solution can be found every time the algorithm is executed. Table 5 shows the results obtained by each optimization technique in the 33-node radial test system. Based on the information reported in this table, which is organized the same way as Table 4, we constructed Figures 9-11, which compare the minimum P loss reduction, the average P loss reduction, and the STD obtained by the optimization algorithms, respectively. Importantly, this table also includes (in its upper part) the P loss in the base case, i.e., 210.9785 kW, and the maximum current that can be supported by the conductor distributed throughout the network, i.e., 385 A. Table 5. Results of the simulations in the 33-node radial test system.   Figure 9 depicts the difference between each optimization technique used for comparison and the proposed methodology in terms of minimum P loss reduction at penetration levels of 20%, 40% and 60%, respectively. In the first penetration level (20%), the SSA, the MVO, and PSO exhibited the same minimum power loss reduction (39.5680%), outperforming the ALO, the CGA and BH by 0.0021%, 0.0098% and 0.0603%, respectively. For the second penetration level (40%), the SSA achieved the best minimum P loss reduction, outperforming the MVO by 1 × 10 −5 %, PSO by 2 × 10 −5 %, the ALO by 0.0043%, the CGA by 0.0118% and BH by 0.0583%. Finally, at the third penetration level (60%), the SSA, the MVO, and PSO reached the best minimum P loss reduction with 59.3423%, outperforming the CGA by 0.0007%, the ALO by 0.0011%, and BH by 0.0121%. To continue with the analysis, Figure 10 illustrates the difference between the SSA and the other optimization techniques in terms of average P loss reduction at the three penetration levels of distributed generation. At 20% penetration, the SSA presented a reduction in average P loss of 39.5652%. It was outperformed by the MVO by 0.0024%, but it outperformed the CGA, the ALO, PSO, and BH by 0.0473%, 0.0581%, 0.1833% and 0.4484%, respectively. At 40% penetration, the SSA achieved a reduction in average P loss of 57.1625%. It was outperformed by the MVO by an almost negligible difference (0.0001%) and outperformed the CGA by 0.0490%, the ALO by 0.0982%, PSO by 0.1949% and BH by 0.6349%. Finally, at 60% penetration, the SSA, the MVO and PSO obtained the same reduction in average P loss (59.3423%), outperforming the CGA, the ALO and BH by 0.0100%, 0.1094% and 0.2806%, respectively. Figure 10. Percentage of reduction in average power losses obtained by the SSA in the 33-node radial test system compared to that of the other methodologies. Figure 11 presents the STD reached by each optimization methodology at the three penetration levels used for the distributed generation. For 20% penetration level, the SSA presented a STD of 0.0077%. It was outperformed only by the MVO by 0.0068%. By reducing the STD with respect to the CGA, ALO, BH and PSO in 0.0362%, 0.0833%, 0.3965% and 0.5163%, respectively. When the 40% penetration level was analyzed, the proposed algorithm reached a STD of 0.0012%. It was outperformed by the MVO again by just 0.0003% and outperformed the CGA by 0.0523%, the ALO by 0.2169%, BH by 0.7758% and PSO by 1.1576%. Finally, at 60% penetration level, the SSA, the MVO and PSO presented the same STD (8.65 × 10 −11 ), outperforming the CGA by 0.0168%, the ALO by 0.3471% and BH by 0.6068%. Figure 11. Percentage of standard deviation obtained by the SSA in the 33-node radial test system compared to that of the other methodologies.

33-Node Radial Test
According to these results, the solution methodology proposed in this study is the most suitable in terms of minimum P loss reduction. It also showed an outstanding performance in reducing the average P loss , as it outperformed most of the other techniques and was only outperformed by the MVO. Table 6 shows the results reached by each algorithm in the 69-node radial test system. This table, which is organized the same way as Tables 4 and 5, also includes (in its upper part) the P loss of the system in the base case, i.e., 242.1523 kW, and the maximum current that can be supported by the conductor selected for this system (a 50 kcmil conductor operating at 60 ºC), i.e., 400 A. Based on the information reported in this table, we constructed Figures 12-14, which illustrate the minimum P loss reduction, the average P loss reduction and the STD obtained by the optimization algorithms, respectively.  Figure 12 shows the difference between the SSA and the other optimization techniques in terms of minimum P loss reduction at the three penetration levels of distributed generation. At 20% penetration, the SSA and PSO presented the same reduction in minimum P loss (44.8435%), outperforming the MVO, the ALO, the CGA and BH by an average percentage of 0.0604%. At 40% penetration, the minimum P loss obtained by the SSA was 86.4573 kW, for a reduction of 64.2963% with respect to the base case. It outperformed the MVO and PSO by 2 × 10 −5 , the CGA by 0.0040%, the ALO by 0.0101% and BH by 0.2166%. Finally, at 60% penetration, the SSA, the MVO and PSO exhibited the same reduction in minimum P loss (68.2193%), outperforming the CGA and the ALO by 0.0006% and BH by 0.0168%. Regarding average P loss , Figure 13 compares the average P loss reduction obtained by each optimization algorithm at the three penetration levels of distributed generation. At 20% penetration, the SSA achieved a reduction in average P loss of 44.8055%. It was outperformed by the MVO by 0.0355%, but it outperformed the other techniques by an average percentage of 0.6348. At 40% penetration, the SSA presented a reduction in average P loss of 64.2955%. It was outperformed by the MVO by an almost negligible difference (0.0003%) and outperformed the CGA by 0.0584%, PSO by 0.0785%, the ALO by 0.2505% and BH by 1.6598%. Finally, at 60% penetration, the SSA, the MVO and PSO exhibited the same reduction in minimum P loss (68.2193%), outperforming the CGA, the ALO, and BH by 0.0116%, 0.1788%, and 0.8731%, respectively. To finish the simulations of the 69-node radial test system, Figure 14 presents the STD reached by each method at the distribution generation penetration levels of 20%, 40% and 60%. For the penetration level of 20%, the SSA obtained a STD of 0.1034%. It was outperformed by the MVO by 0.1001% by reducing the STD in relation to the other comparison methodologies in 0.8328%. In relation to the penetration level of 40%, the MVO exhibited a STD of 0.0017%, outperforming the SSA by only 0.0019%. In this scenario, the SSA was followed by the CGA, the ALO, PSO and BH, with a difference in STD with respect to the SSA of 0.0939%, 0.6222%, 0.6602 and 1.9205%, respectively. Finally, at the last penetration level (60%), the SSA, the MVO, and PSO reached the same STD (around 1 × 10 −6 ). The SSA outperformed the other algorithms by an average percentage of 0.8628%. After a general analysis of these results, the SSA proved to be the most suitable algorithm in terms of minimum P loss reduction. It also produced excellent results in terms of average P loss reduction, and it was only outperformed by the MVO. Moreover, it obtained an excellent standard deviation, which guarantees that a high-quality solution can be found every time the algorithm is executed.

Mesh Test Systems
This subsection studies the results reached by each optimization method employed to solve the OPF problem in AC grids with a mesh topology. Table 7 presents the results reached by each method used to solve the OPF problem in the 10-node mesh test system. Based on the information reported in this table, which is organized the same way as Tables 4-6, we constructed Figures 15-17, which compare the minimum P loss reduction, the average Ploss reduction, and the STD obtained by the optimization techniques, respectively. After running a load flow analysis for this system, the P loss in the base case was 190.3237 kW.  Figure 15 shows the difference between the proposed methodology and the other optimization techniques in terms of minimum P loss reduction at the three levels of penetration of distributed generation. At 20% penetration, the SSA achieved the best reduction in minimum P loss (44.9617%), outperforming the MVO, PSO, the ALO, the CGA and BH by 1 × 10 −5 %, 5 × 10 −5 %, 0.0250%, 0.0297% and 0.115%, respectively. At 40% penetration, the SSA provided the best solution, with a reduction of 69.2705% in minimum P loss , outperforming all the other techniques by an average percentage of 0.0202%. Finally, at 60% penetration, the SSA and PSO presented the best reduction in minimum P loss (79.3054%), outperforming the MVO by 1 × 10 −5 , the CGA by 0.0022%, the ALO by 0.0057% and BH by 0.0704%.

10-Node Mesh Test System
As for minimum P loss , Figure 16 compares the average P loss reduction reached by the SSA and the other methodologies at the penetration levels of 20%, 40% and 60%. At the first penetration level, the SSA achieved a reduction in average P loss of 69.2573%. It was outperformed by the MVO by 0.0088%, but it outperformed the ALO, the CGA, PSO and BH by 0.1397%, 0.1551%, 0.2900% and 0.6437%, respectively. At the second penetration level, the SSA reduced the average P loss by 69.2573%. It was outperformed by the MVO by 0.0118%, but it outperformed the CGA, the ALO, BH and PSO by an average percentage of 1.0527%. Finally, at the last penetration level, the SSA was outperformed by the MVO by just 0.0006%, but it outperformed the other optimization techniques by an average percentage of 0.3891%. Figure 15. Percentage of reduction in minimum power losses obtained by the SSA in the 10-node mesh test system compared to that of the other methodologies. To complete the analysis of the 10-node mesh test system, Figure 17 compares the STD reached by each algorithm with that obtained by the SSA. At 20% penetration, the SSA presented a STD of 0.0446%. It was outperformed by the MVO by 0.0425%, but it outperformed the CGA, the ALO, BH and PSO by 0.0728%, 0.1350%, 0.4934% and 1.7425%, respectively. At 40% penetration, the SSA obtained a STD of 0.058%. It was outperformed by the MVO by 0.0522%, but it outperformed the other optimization techniques by an average percentage of 6.4658%. Finally, at 60% penetration, the SSA ranked second, with a STD of 0.0081%. It was outperformed by the MVO by 0.0063%, but it outperformed the other optimization algorithms by an average percentage of 3.1708%. After a general analysis of these results, the SSA achieved the best reduction in minimum P loss in the 10-node mesh test system in a very short processing time and with a remarkable STD. It was only outperformed by the MVO in terms of STD.
According to the results presented in this section, the SSA showed an outstanding performance in terms of minimum P loss , as, in most cases, it provided the best solution and reduction in a short processing time. In terms of STD, it provided the best solution in some scenarios and ranked second in the other scenarios, in which it was only outperformed by the MVO. For these reasons, we may conclude that the SSA is the most suitable algorithm to solve the OPF problem in AC networks with both radial and mesh topologies.

Conclusions
The OPF problem in AC distribution networks with high penetration of dispersed generation was addressed in this research through application of a master-slave optimization methodology. The master stage was entrusted with determining the amount of power injection of each DG connected to the AC grid using a continuous codification by applying the SSA. The slave stage dealt with the solution of the power flow problem by using the successive approximation method that evaluates the feasibility of the power injected in all the power sources in terms of voltage regulation, current limits and power generation capacities. The objective of the OPF problem was the reduction of the grid power losses for a particular load condition, which allowed confirmed the effectiveness of the SSA approach when was compared with recent literature reports.
Comparative analysis with different literature algorithms such as PSO, CGA, BH, MVA and ALO, which are efficient optimization techniques to deal with large-scale complex continuous optimization problems in the 10-, 33-and 69-bus grids with radial and meshed configurations demonstrated that the proposed SSA approach has better numerical performance for all the scenarios of power injection considered, i.e., 20%, 40%, and 60% of the power supplied by the main generator in an environment without DGs. Note that to ensure a fair comparison between all the presented algorithms, all of them were evaluated 100 consecutive times and tuned appropriately. i.
In the case of radial networks, the SSA proved to be superior in terms of minimum P loss reduction, as it outperformed the other optimization algorithms by an average percentage of 0.0433%, 0.0107%, and 0.0327% in the 10-, 33-and 69-node radial test systems, respectively. It produced such good results in short processing times and with low standard deviations: an average processing time of 3.49 s, 9.94 s, and 43.52 s in the 10-, 33-and 69-node radial test systems, respectively, and an average STD of 0.013% at the three penetration levels of distributed generation (20%, 40% and 60%). This demonstrates the superiority and convergence capacity of the SSA, which is why we may conclude that it is the most suitable optimization algorithm to solve the OPF problem in radial networks of any size. ii. In the case of mesh networks, the SSA also proved its superiority, as it provided the best solution in terms of minimum P loss reduction in every test scenario, with an average reduction of 64.5125%, outperforming the other algorithms by an average percentage of 0.034%. It produced such results in processing times of around 0.058 s and with an average STD of 0.0369%. This demonstrates the superiority of the SSA in providing the best solution in terms of minimum P loss reduction in very short processing times. Thus, we may conclude that it is the most suitable optimization algorithm to solve the OPF problem in mesh networks.
Future research could implement the methodology proposed in this paper to solve the OPF problem for a 24 h load flow, considering the integration of energy storage elements in the electrical network. Furthermore, the proposed solution methodology could be employed to solve the OPF problem using other objective functions, such as the reduction in the operating costs of the network, the minimization of CO 2 emissions (using photovoltaic panels as DGs) and the improvement of the operating conditions of AC networks. Finally, we recommend future studies to propose parallel processing tools, which could significantly reduce the processing times required by the optimization algorithms to find the best solution to the OPF problem.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.

Conflicts of Interest:
The authors declare no conflict of interest.