Cross-entropy boosted CRO-SL for optimal power flow in smart grids

Optimal power flow (OPF) is a complex, highly nonlinear, NP-hard optimization problem, in which the goal is to determine the optimal operational parameters of a power-related system (in many cases a type of smart or micro grid) which guarantee an economic and effective power dispatch. In recent years, a number of approaches based on metaheuristics algorithms have been proposed to solve OPF problems. In this paper, we propose the use of the Cross-Entropy (CE) method as a first step depth search operator to assist population-based evolutionary methods in the framework of an OPF problem. Specifically, a new variant of the Coral Reefs Optimization with Substrate Layers algorithm boosted with CE method (CE+CRO-SL) is presented in this work. We have adopted the IEEE 57-Bus System as a test scenario which, by default, has seven thermal generators for power production for the grid. We have modified this system by replacing three thermal generators with renewable source generators, in order to consider a smart grid approach with renewable energy production. The performance of CE+CRO-SL in this particular case study scenario has been compared with that of well-known techniques such as population’s methods CMA-ES and EPSO (both boosted with CE). The results obtained indicate that CE+CRO-SL showed a superior performance than the alternative techniques in terms of efficiency and accuracy. This is justified by its greater exploration capacity, since it has internally operations coming from different heuristics, thus surpassing the performance of classic methods. Moreover, in a projection analysis, the CE+CRO-SL provides a profit of millions of dollars per month in all cases tested considering the modified version of the IEEE 57-Bus smart grid system.


Introduction
In the current global scenario of climate emergency, there is a truly need for sustainable and clean energy production. According to Makhdoomi and Askarzadeh (2020), some recent situations such as the increasing demand load electrical energy, the fluctuation of diesel fuel costs, and new strict regulations on environmental issues have led to the implementation of clean energy sources to supply electricity. Part of this energy is intended to be produced in the near future within smart grid systems, connected to a public main grid to be fully operational. Market-driven policies are increasingly focused on promoting the deployment of micro renewable systems, to meet energy efficiency in micro grids and smart grid systems. This is, however, a challenging task, specially for micro-grids which try to exploit renewable resources locally available, such as micro-wind, micro-PV, or with use of small hydro generators. In this context, some optimization problems arise, often exhibiting hard characteristics such as high dimensionality, mixed types of design variables, non-linearity, non-convexity and conflicting objectives. Moreover, these optimization problems can be broadly structured into three different types: (1) Optimal Power Flow (OPF) problems, (2) Planning-type tasks, and (3) Scheduling-type problems (Reddy et al. 2017). In this work, we present a novel optimization metaheuristic process to tackle OPF problems in a smart grid approach, the Coral Reefs Optimization with Substrate Layers (CRO-SL) coupled with an in-depth pre-search mechanism based on Cross-Entropy method (CE+CRO-SL).
The OPF seeks to optimize the overall operation cost of generating and transmitting electric power in a micro-grid or smart-grid, subject to a number of system constraints and control limits (Marcelino et al. 2018(Marcelino et al. , 2022a(Marcelino et al. , 2023. Several OPF solution methods have been proposed in the literature, each with different mathematical characteristics and computational requirements. A cyber-constrained Optimal Power Flow model for smart grid resilience enhancement was proposed by Huang et al. (2019). The problem was solved via mixed integer programming (MILP) solver under the IEEE RTS-79 and IEEE RTS-96 systems, and the modeling adopted provided a fundamental method to analyze the operation of cyber-physical systems. Home-Ortiz et al. (2021) proposed the use of Variable Neighborhood Descent (VND) to solve the OPF. The approach was compared to MILP indicating better results. Reddy et al. (2017) showed a review of stochastic optimization methods applied to OPF problems in the field of smart grids. Since the use of metaheuristics based on observation of nature has been used to solve engineering problems, the related works below present the newest methods applied to OPF solution. Papadimitrakis et al. (2021) presented a recent review on the main metaheuristics applied to smart grid solutions in the OPF context. A security solution for cyber-attacks against optimal power flow in smart grids network is described in (Yang et al. 2017). To combat the investigated data integrity attack, the authors developed two types of defensive stochastic schemes applied to the IEEE 30-Bus System. The experimental results showed that the investigated attack can increase the minimum fuel cost. Awada et al. (2019) proposed a variation of Differential Evolution (DE) algorithm to solve the OPF based activereactive dispatch problem considering renewable generators and comparing the results using the IEEE PES 2017 competition black-box system (see, Rivera et al. (2018)). Biswas et al. (2018) proposed a methodology based on Differential Evolution techniques to solve three different objective functions applied on the standard IEEE 30-Bus, IEEE 57-Bus Systems, and IEEE 118-Bus Systems. The authors concluded that the approach minimized the cost of energy production.
Different algorithms based on swarm intelligence have also been applied to solve OPF problems. Phommixay et al. (2020) presented a literature review, showing a diversification of smart grid problems solved via the Particle Swarm Optimization (PSO) algorithm. A multi-objective hybrid particle swarm and salp optimization (PSO-SSO) was proposed by Sehiemy et al. (2020) to provide a technical-economicenvironmental operation in power systems. The PSO-SSO was applied to solve the electric power generation of the IEEE 30-Bus, IEEE 57-Bus, and IEEE 118-Bus systems. The objective of minimizing the costs and emissions simultaneously was achieved. This solution demanded a high computational cost due to the nature of the algorithm. An improvement in SSO was addressed in (El-sattar et al. 2021). The results showed better results when compared to standard PSO and SSA in IEEE 30-Bus, IEEE-57-Bus, and IEEE 118-Bus test systems.
A hybrid algorithm based on DE and PSO algorithms was proposed by Marcelino et al. (2020) to solve the electric dispatch in a smart grid system. This work addressed the importance of including battery storage devices in the system. Naderi et al. (2021) proposed a hybrid self-adaptive heuristic algorithm to handle single and multi-objective OPF problems. The approach used a fuzzy adaptive configuration oriented to a joint self-adaptive particle swarm optimization (SPSO) and differential evolution algorithms (FAHSPSO-DE). When compared to a standard DE and Genetic Algorithms (GA), FAHSPSO-DE showed better results in terms of minimizing costs and losses of IEEE 30-Bus and IEEE 118-Bus systems. Karthik et al. (2021) proposed a multiobjective OPF solution using a modified Interior Search Algorithm in which Levy Flight feature (LISA) in a renewable energy sources environment. This approach showed better results in relation to the standard PSO. Gilvaei et al. (2020) proposed the FA-APTFPSO, a hybrid optimization approach for solving the reactive power dispatch problem considering voltage stability index. FA-APTFPSO obtained robust results compared to other metaheuristics such as Particle Swarm Optimization (PSO), Biogeography-Based Optimization (BBO), and the cultural algorithm (CA).
Some innovative methods have taken place for solving electrical problems. For example, we can mention an approach using the elephant herd optimization-firefly (EHO-FF) proposed by Muthukumaran and Kalyani (2021) to construct a smart controller for reactive power optimization applied on smart grid production. The improved chaotic electromagnetic field optimization (ICEFO) algorithm was proposed by Bouchekara (2020) to solve the minimization costs of OPF problems, using the IEEE 30-BUS, 57-Bus and 118-Bus systems. The results demonstrated that the developed algorithm was able to minimize the generation losses in these three systems. Nusair and Alasali (2020) applied the golden ratio optimization method (GROM) to solve the OPF management system for a power network with renewable energy sources (RES). The network operators were forced to optimally control the conventional power generations in some RES inserted on IEEE 30-Bus system. Results showed that the approach respected the restrictions imposed on the problem. Kaur and Narang (2020) proposed the integration of the invasive weed optimization (IWO) and Powell's pattern search (PPS) to solve the OPF in the IEEE 30-Bus and IEEE 57-Bus systems. The results showed that the difference between the IWO method and the IWO-PPS coupling was low. Alhejji et al. (2020) proposed an Adaptive Grasshopper Optimization Algorithm (AGOA) for solving the OPF problem with the optimal incorporation of a center-node unified power flow controller. Results showed that AGOA obtained better results in comparison to the previous GOA.
A hybrid method based on Cuckoo Search and Sunflower Optimization (HCSA-SFO) was proposed to solve the OPF in Duong et al. (2020). The approach was applied to solve the IEEE 30-Bus and IEEE 118-Bus system with the objective functions of minimizing generator costs, power loss, and voltage deviation. Results showed that HCSA-SFO obtained better results than standard DE and BBO algorithms. An adaptive constraint differential evolution (ACDE) algorithm was proposed by Li et al. (2021) to solve the IEEE 30-Bus system. An Optimal power flow solution with stochastic wind power using the Lévy Coyote Optimization Algorithm (LCOA) was proposed by Kaymaz et al. (2021). Farhat et al. (2021) proposed an optimal power flow solution based on Jellyfish Search Optimization (JS) considering uncertainty of renewable energy sources. JS achieved better results than Artificial bee colony (ABC) and success history-based adaptive differential evolution (SHADE). The IEEE 30-Bus, IEEE 57-Bus, and IEEE 118-Bus test systems were adapted to consider the addition of the PV panel and/or wind generators in respective systems in work of Shaheen et al. (2021). The results indicated that the proposed HEAP Optimization Algorithm (HOA) was flexible and applicable compared with that achieved by using the GA. A dynamic electric dispatch for wind power plants was proposed by Marcelino et al. (2021a). In this work, the OPF problem was solved as a dynamic problem and the adopted algorithm was tuned in a real-time approach, generating the best results. An analysis study to energy consumption in smart grid using a hybrid algorithm based on Harmony Search algorithm (HSA) and PSO was studied on Hemalata et al. (2020). Based on the Mont Carlo method, Li et al. (2022) proposed a solution to IEEE 30-Bus System in a smart grid approach. Many metaheuristics have been applied to solve OPF problems in a microgrid scenario in (Yang et al. 2021). Thus, it was concluded that metaheuristics are a useful tool to guarantee electrical dispatch considering uncertainty of the smart grids. In addition, approaches using hybridization with techniques based on swarm intelligence and vector combination of solutions have been successful when performing electrical dispatch in smart grid networks with the presence of electric vehicles (Marcelino et al. 2022b).
As smart grids integrate multiple renewable energy sources, the resulting OPF problem becomes more challenging. Despite the large amount of previous work in OPF problems, very few studies tackle the OPF problem from a smart grid perspective with more than one renewable source. For instance, (Shaheen et al. 2022a) proposed a hybridization between a machine learning technique based on artificial neural networks and Transient Search Optimization (TSO) algorithm. This algorithm dubbed ML-TSO employs a modified version of Self-Organizing Map (SOM) as an initial deep search operator for the TSO to perform a global search in the decision space. The proposed approach was applied to solve the IEEE 57-Bus and IEEE 118-Bus standard test systems, which were modified to include PV panels and/or wind generators. Results indicated that ML-TSO showed better results when compared to standard versions of PSO and GA in terms of minimizing fuel costs. A Circle Search Algorithm (CSA) was proposed by (Shaheen et al. 2022b) to solve an OPF problem with the presence of PV panels and/or wind turbines. The proposed solution updates the population of solutions toward the optimal solution by drawing random circles centered at the optimal solution found so far. By varying the radius of the circles, the algorithm is able to balance between exploration and exploitation. The algorithm was applied to solve adapted versions of IEEE 57-Bus and IEEE 118-Bus standard test systems. The experimental results showed that CSA outperformed both standard PSO and GA in minimizing operational costs in both test systems.
Motivated by the lack of more studies addressing the OPF problem with multiple renewable source in a smart grid approach and by the successful real-world applications, standard versions of Coral Reefs Optimization with Sub-Layers (CRO-SL) (Salcedo-Sanz et al. 2016a), Evolutionary Particle Swarm Optimization (EPSO) (Miranda and Fonseca 2002), and Covariance Matrix Adaptation Evolution Strategy (CMA-ES) (Auger and Hansen 2005), we have employed these metaheuristics in this work to assess the performance of IEEE 57 Bus-System in the electrical dispatch problem. As a novelty, we propose the use of the Cross-Entropy method (Rubinstein and Kroese 2004) as an initial deep search operator for the aforementioned metaheuristics. Taking advantage of a mix of the Simulated Annealing and Evolutionary algorithms Del Ser et al. (2019), the CRO-SL (see Garcia-Hernandez et al. 2020)) is compared with two algorithms, EPSO and CMA-ES. The experimental results show that the coupled CE+CRO-SL is extremely competitive in solving electric dispatch in a smart grid approach. We particularly chose the EPSO and CMA-ES algorithms, as they have been successfully applied in the 2018 IEEE PES competition for solving the test problems . Therefore, CE+CRO-SL acts as an electrical dispatch controller system capable of offering optimized solutions for the hourly planning horizon. Furthermore, CE+CRO-SL guarantees the minimum costs in power production differing from the techniques to which it has been compared. In addition, CE+CRO-SL is able to overcome initialization problems with a few hyperparameters for CE initial deep search. More specifically, this paper presents the following contributions: -A study on the effectiveness of the Cross-Entropy method as a starting method for a deep search in the solution space; -A new CE+CRO-SL algorithm version boosted with Cross-Entropy mechanism is proposed; -An in-depth performance assessment of CE+CRO-SL comparing to four different and well-known algorithms, CE, CMA-ES, and EPSO (all them with and with out CE mechanism) in the optimal power flow problem, and; -A projection analysis has been carried out indicating a profit of million's dollar per month when solving the problem using the proposed approach.
The rest of the paper is organized as follows: Sect. 2 describes the IEEE 57 Bus-System detailing the electrical dispatch mathematical modeling. Section 3 addresses the optimization techniques used so solve the OPF problem introducing the fundamentals of the CE+CRO-SL method. Section 4 comprises the experimental design performed by mono-objective algorithms solving the power dispatch problem on the security-constrained optimal power flow, and the comparative analysis of CE+CRO-SL with other methods taking into account the optimized solutions found and the savings ratio achieved by the method proposed here. Finally, Sect. 5 illustrates the conclusions regarding the overall CE+CRO-SL robustness.

Power dispatch problem in smart grids scenarios
Currently, with the challenges of energy decentralization and the automation of systems, proposing new solutions for operating smart grid systems has become an emerging economic development and research area. Moreover, note that sustainable operation of electrical power systems is affected by the high stochastic nature of renewable generation terms. Thus, new solutions to promote the inclusion of renewable generation in smart grids are necessary. In this framework, electric dispatch problems involved in scheduling power generation need keeping in mind the probabilistic models, nonlinear systems, and a large number of mixed-integer decision variables. This work addresses the optimal active-reactive power dispatch (OARPD) problem with security-constrained optimal power flow (SCOPF) approach. As a case study, the well-known IEEE 57 Bus-System is investigated, includ-ing an adaptation for taking into account renewable sources integrated in the network system, simulating a smart grid paradigm. Table 1 shows a summary of the system information.

Power dispatch problem: mathematical modeling
In order to describe the objective function, this work addresses the optimal active-reactive power dispatch problem, with the goal of minimizing the total costs of production (see Carvalho et al. 2018;Awada et al. 2019)). The function corresponds to a quadratic equation of the bus voltage magnitudes and of the cosine of the difference between bus voltage angles. Equation (1) represents the power production costs in ($/h). Note that the control variables in this problem are related to active and reactive power generation, in which C is the total fuel cost of the system. The term P gi is the power output of the i-th unit. N G indicates the number of generators. The terms a ($/h), b ($/MWh) and c ($/MWh 2 ) are the cost coefficients associated with each generation unit. The problem must also satisfy the following constraints: (3) Equations (2) and (4) are related to the active and reactive power balance constraints, in which P i refers to the active power injected and Q i to the reactive power. Pl (MW) is the active power load. The constraint (6) represented by term U i (kV) means the voltage magnitude and θ i to the voltage angle. Constraints (7) and (8) mean the S i j (MVA) term that is the apparent power flow injection at the sending end of the transmission circuit connecting bus (i) to bus ( j), and the S ji (MVA) is the apparent power flow injection at the receiving end of the same circuit. In constraints (9) and (10), Pg i (MW) is the active power generation and the reactive power generation is represented by Qg i (MVar), respectively. The transformer tap constraint (11) indicates that the variable (t) is the tap setting position of the OLTC (On-Load Tap Changer). Constraint (12) explains the capacitor/reactor balance where q is a binary variable that represents the state of the capacitor/reactor banks. This notation has some variables that mean: Y = G + j B is the bus admittance matrix, N G is the number of generators, N B is the number of buses, N C is the number of circuits in the network, N O LT C is the number of O LT C transformers, N S HU N T is the number of capacitor/reactor banks, and N S is the number of scenarios that represent the expected operation scenario and contingency states.
The constraints that have been modeled as a penalty to the objective function, presented in Equation (1), represent the active power energy (in the REF bus), the voltage magnitude (PQ busses), the apparent power flow through branches, and the reactive power generation (situated in the REF and PV busses). Therefore, the fitness function (λ) is described in Equation (13) as: in which ϕ is the objective function of the problem. The term (ρ) is a penalty factor that is set to a value of 1E + 7. The total number of constraints is represented by (k), and (vk i ) means the violated constraints.

Power dispatch problem: smart grid definition
In general, the goal in the OARPD is to minimize the total fuel cost respecting the constraints imposed (generator reactive power capability, maximum active power output of slack generator, nodal balance of power, nodal voltages, and allowable branch power flows) for non-contingencies related and selected N-1 conditions of SCOPF. Keeping that in mind, this work addresses the minimization of total costs to traditional generators (based on diesel) plus the expect uncertainty costs of renewable generators (wind turbines, photo-voltaic (PV) panels, and small-hydro generators, including operational cost due to variability of primary energy resources). Following this, each renewable generation source is considered to be a dispatchable generator. These conditions and the mathematical modeling can be viewed in (Reddy et al. 2017). Figure 1 shows the diagram of the IEEE 57 Bus system. As we can see in Fig. 1, the IEEE 57 Bus system has 7 generators (buses 1, 2, 3, 6, 8, 9, and 12). In a smart grid context, three of these generators have been defined as renewable energy generator (PV panels, wind turbine, and small hydro generator) and are located at buses 2, 6, and 9. The systems have 42 loads, in which four of them are controllable ones.
In this context, this study aims to minimize the total costs of traditional generators in the IEEE 57 Bus-System (buses: 1, 3, 8, and 12), added to the expected uncertainty cost for renewable energy generators (buses: 2, 6, and 9) and the compensation cost for controllable loads (buses: 8, 12, 18, and 47). The optimization problem has 35 variables, comprising 13 continuous (generators power outputs), 15 discrete variables (adjustable on-load transformers' tap positions), 3 binary variables (shunt compensation devices), and 4 controllable loads. In this problem, 179 fixed contingencies (N-1 conditions) and outages at branches 8 and 50 are considered (see Rueda et al. (2018)). We address three case studies, with different combinations of renewable energy sources as follows: 1. System with wind generators and controllable loads; 2. System with wind/solar generators and controllable loads; 3. System with wind/solar/small hydro generators and controllable loads; To include the renewable sources in the electrical dispatch modeling, each renewable generator is considered to be a dispatchable generator with the expected uncertainty cost of renewable energy generator. However, that is dependent of the available real power, considering an underestimated or overestimated condition according to Readdy et al. (2015). In the underestimated renewable energy generation, the scheduled power (Ps i ) from renewable energy generator (i) is less than the available real power (Pa i ), occurring an underestimated cost (C u = c u (Pa i − Ps i )) to the renewable generator. On the other hand, in the overestimated renewable energy generation situation, Ps i is greater than the Pa i from such a system. The overestimated cost (C o = c o (Ps i − Pa i )) in this work is treated as a penalty term in the objective function (see, Readdy et al. (2015)). We use Monte Carlo Simulation to obtain the probability distribution of the available power from the known primary data of energy source probability. From the underestimated and overestimated situations, the related cost can be obtained as a probabilistic function given the uncertainty in renewable energy sources using this approach. The Monte Carlo simulation follows the steps: 1. Generate a random primary energy source value for each renewable generator (from the probability distribution of River flow, wind or solar radiation) in the corresponding scenario ( j); 2. Compute the available real power for scenario ( j) when renewable energy generator (i) is used (Pa i j ) by using the relationship between the primary energy source and Pa i j ; 3. Verify of Psi < Pai j (underestimated) or Ps i > Pai j (overestimated) conditions in scenario ( j). Ps i corresponds to the decision variable describing renewable energy generator (i); 4. Compute the uncertainty cost for scenario (j), according to: Repeat the steps (1) to (4) for N = 2000 times; 6. Construct the histogram of the uncertainty cost for N ; 7. Compute the expected uncertainty cost for renewable energy generator (i) considering Monte Carlo simulation.

Proposed metaheuristic approach (CE+CRO-SL)
In this section, the main features of the proposed approach, Cross-Entropy Boosted Coral Reefs Optimization with Substrate Layers algorithm (CE+CRO-SL), are briefly described.
In the proposed approach, the Cross-Entropy method is employed as a first depth search operator to assist the Coral Reef Optimization with Substrate Layers algorithm, which will obtain the final solution to the problem.

Cross-Entropy method
The technique based on the Monte Carlo method called Cross-Entropy (CE) is a general method to efficiently obtain solutions to optimization problems (Rubinstein and Kroese 2004). In CE, a deterministic optimization problem is translated into an associated stochastic optimization problem that can be applied to both combinatorial and continuous problems, with either a static or noisy objective functions (Kroese et al. 2006). In this work, we propose to use the CE method as a deep global search operator in order to find a promising basin of attraction for the problem in hand. After that, a bio-inspired stochastic algorithm will be used to refine the solutions from the CE. For solving the objective function, in our case the power production costs described by Equation (13), CE needs to find the minimum value (λ * ) according to Equation (14) λ in which S is the minimization of the performance function over all elements/states x * in some set χ . In CE, it is necessary to identify an associated stochastic problem (ASP). For that, a family of probability distribution functions (pdfs, { f (·; )v, v ∈ V}) on the set χ is defined, associating Equation (14) with an estimation following in which X is a random vector with pdf f (·; u, u ∈ V). The expectation operator is represented by the term (E u ), and an indicator function of event is indicated by (I {·} ) (Kroese et al. 2006;Carvalho et al. 2018). In this case, from a mean vector (μ) and a variance vector (σ 2 ), the Gaussian distribution v = [¯, oe 2 ] can provide a density function f (·; v). According to Kroese et al. (2006), the ASP ( ) is a sporadic event and for that P u (S(X) ≥ λ) and can be obtained from a multi-level Cross-Entropy algorithm. To solve the problem, a multi-level CE will conduct a sequence of pdf, as: Kroese et al. 2006). Equation (16) obtains the optimal ref- According to De Boer et al. (2005), v * can be estimated from in which X 1 ,…, X N is approximately f (·; u). In this step, a multilevel approach to generate sequences of {v t , t ≥ 0} parameters and iterated {λ t , t ≤ 1} levels and v t is needed, so that the value v t is close to v * . Thus, v t can be used in the importance sampling density f (·; v t ) to estimate , starting with v 0 = v u in which the initializing short quantity term = 10 −2 (Kroese et al. 2006). These steps must be repeated in the subsequent iterations in two update phases: (1) adaptive update of λ t and (2) adaptive update of v t .
(1) Let λ t be a (1 − )-quantile of S(X) under v t−1 for a fixed v t−1 to satisfy in which X ∼ f (·; v t ). Here, it is necessary to generate a random sample X 1 , . . . , (2) A smoothed equation to update the parameter v has been addressed by Kroese et al. (2006), according to in which α is the smoothing parameter, different from 1 to avoid occurrences of zeros and ones in vector v (Kroese et al. 2006;Carvalho et al. 2018).
The generic CE method for optimization presented in Algorithm 1 can be summarized as follows (Kroese et al. 2006;De Boer et al. 2005): (1) Choose some v 0 . Set t = 1.
(2) Generate a sample X 1 , . . . , X N from the density f (·; v t−1 ) and compute the sample (1 − )-quantile of λ t of the performances. (3) Use the same sample X 1 , . . . , X N and solve the stochastic program. Denote the solution by v t . (4) Realize the smoothing procedures out the vector v t . (5) Repeat steps 2-4 until a pre-specified stopping criterion is met.

The Coral Reefs Optimization algorithm
The Coral Reefs Optimization algorithm (CRO) is a type of evolutionary technique proposed in Salcedo-Sanz et al.  (Li et al. 2015;Agrawal et al. 2018;Emami et al. 2021;Ficco et al. 2018), including management problems in micro-grids (Roy et al. 2020) and optimal scheduling for hydro-power plants (Marcelino et al. 2021b). This metaheuristic is based on a n × m grid (reef) in which each hole is defined by Λ(i, j), where (i, j) are the coordinates in the grid. Each hole may contain a candidate solution of the problem x or remain empty. The CRO algorithm can be described in four steps, as follows: (1) Initialization. The initial population is usually randomly generated. The initial number of filled holes is previously set in the algorithm configuration. The positions on which the initial solutions are placed are also randomly chosen. Thus, those whose are not chosen keep being empty. The goodness of each solution is evaluated through the fitness function f (x).
(2) Reef construction. The CRO is executed over N rep repetitions. For each one, different operators (which are described below) are used to generate coral's reproduction in the reef. The candidate solutions try to be placed on the reef. The criteria to determine if the proposed solution is set or not on the reef are: 1) if the hole is empty, then it is filled by the proposed solution, 2) if it is not but the fitness of the proposed solution is lower than the current solution at this place, the proposed solution is then placed there. Each proposed solutions tries to find a place where to be placed n jumps times. After that, if the candidate has not been placed, it is discarded. (3) Predation. From new corals, a predation phase starts with probability P ψ . In case of predation, a percentage of the reef is lost. It leaves holes for newest solutions (with bad health functions) from other basins of attraction, to enter the reef, as a way to escape local minimums. (4) Stop if halting criteria are satisfied; otherwise go to step (2) for the next cycle. The best individual in the reef is considered as the final solution to the problem.
Recently, a new approach to improve the CRO has been proposed. The central idea is to implement a set of different search mechanisms during the reef's formation, in order to obtain new aspirant solutions from different exploration methods. Thus, the new version has been named as Coral Reefs with Substrate Layers (CRO-SL) (Salcedo-Sanz et al. 2016b). The CRO-SL is a multi-method ensemble based on the standard CRO algorithm, yet with a structure that promotes competitive co-evolution using the layers (different search operators) deployed. This modified CRO version has been successfully used to several different hard optimization problems, covering a wide range of fields, such as in vehicle routing (Lin et al. 2019), data clustering (Tsai et al. 2019b), climate data field reconstruction Jaume-Santero et al. 2020), image processing (Bermejo et al. 2018;Chen et al. 2021), and also for optimal battery scheduling in microgrids (Salcedo-Sanz et al. 2016a;Jiménez-Fernández et al. 2019). In addition, it has been used to provide optimal structural designs (Perez-Aracil et al. 2020;Pérez-Aracil et al. 2021a, b), and in vibrations cancellation problems in structures (Pérez-Aracil et al. 2021c).
In this paper, we consider de CRO-SL as second phase optimization approach after the CE. As previously mentioned, each layer in the CRO-SL implements an exploration operator, but the algorithm's structure and dynamics are the same as that described for the standard CRO. In this paper, the operators selected as search procedures in the CRO-SL are the following: -2Px: Classical 2-point crossover by (Eiben and Smith 2015). It consists of coupling to individuals at random, choosing two points for the crossover, and interchanging the solution information in-between both points. In the CRO-SL, one individual to be crossed is from the 2Px substrate, whereas the couple can be chosen from any part of the reef. -MPx: Multi-points crossover. In this case, we use a number k point to realize the crossover, and a binary template decides whether parts of the individuals are interchanged. -Differential Evolution mutation (DE): based on the differential mutation operator from the Differential Evolution algorithm (Storn and Proce 1997). Particularly, the variant "best/2" has been used (Guohua et al. 2018). In each iteration, the current best solution has been chosen; then, the larva is generated by: -Harmony Search mutation (HS): Inspired from Harmony Search algorithm (Geem et al. 2001). In this operation, an aspirant solution is obtained as: using the same values of the component from other reefs' coral, with a harmony memory considering rate equal to ∈ [0, 1]; or performing slight modifications to the aspirant solution, with a pitch adjusting rate ∈ [0, 1] interval; -Simulated Binary Crossover (SBX): this operator is based on the offspring distribution of the binary-coded one point crossover (Deb and Bhushan 1995). Two offspring are generated by ; the value of β is calculated, for each iteration, as follows: otherwise in which η is the distribution index, such that η > 0. For large values of η, there is greater probability of creating a solution close to the parents. -Blend Crossover (BLX-α): this operator was firstly introduced by Eshelman and Schaffer (1993). The offspring x i is generated from a uniform distribution within the inter- The parameter α is a constant, which has been chosen to be 0.3 in this work. Figure 2 illustrates the experimental design of the CRO-SL mechanisms and Algorithm 2 shows the proposed CE+CRO-SL coupled metaheuristic. Note that in line 11, CE is executed to perform an initial deep exploration aiming at finding a good basin of attraction. A full code version, for greater reproducibility of our proposal, is available at: https://es. mathworks.com/matlabcentral/fileexchange/119263-ce-crosl.

Computational complexity
Let the population size, number of decision variables (dimension), number of fitness evaluations, time complexity of fitness function be N P, D, N f , and O( f itness), respectively. The time complexity of the algorithm (see Algorithm 2) is divided in two parts: (1) CE complexity and (2) CRO-SL complexity. To provide a clearer notation, let N rep = N f /N P denote the number of iterations the algorithm runs and O(operator) denote the worst time complexity among the selected operators. According to (Rubinstein and Kroese 2004), the CE time complexity is of order O(N P 3 ). The CRO-SL time complexity is of order O(D · N rep · [N P · O(operator) · O( f itness) · n jumps + O(N P · log(N P))], in which the term O(N P · log(N P)) arises from the sorting operation. Thus, CE+CRO-SL time complexity is polynomial in N P and D.

Experiments and results
In this section, we evaluate the performance of the CRO-SL coupled with the Cross-Entropy method (CE+CRO-SL), for solving the electric power dispatch considering five different scenarios. The experimental setup is divided into the following studies: 1. To assess the CE+CRO-SL performance to solve the electric dispatch problem in smart grid systems, we perform 12 runs in each scenario based on IEEE 57 Bus-System. The proposed metaheuristic is compared with the other techniques: CE, EPSO, and CMAES. The algorithms have been constructed taking into account of equality of means using a statistical inference test to compare the results obtained by CRO-SL versus the others using the same methodology (boosted to Cross-Entropy). 3. Analyze the results found by CE+CRO-SL for solving the electrical dispatch problem, highlighting the positive impact of using CRO-SL as a power production control system.
For assessing the performance of CRO-SL, EPSO, and CMAES using the Cross-Entropy method as an initial deep search operator when applied to the OARPD problem, the initialization parameters used for all algorithms are: population size (NP) equal to 100 individuals, and the total number of fitness evaluations 3 × 10 4 (MaxIt -stop criteria). Specifically for Cross-Entropy, all algorithms use 1.5 × 10 4 fitness evaluations. The CRO algorithm uses as a probability of death (PD) a value equal to 0.1, the number of jumps (NJ) is equal to 3, and the number of depleted corals (NDC) is equal to 10% of the population. The EPSO uses as mutation (Mut), and communication (Com) weights the values equal to 0.8 and 0.8 rates. CMA-ES uses a value of 0.3 for coordinatewise standard deviation (CW) and stops if fitness equals to 1 × 10 −10 . All parameters have been defined empirically, as shown in Table 2. We perform the computational simulation using an Intel(R) Core(TM) i9-10900X CPU@3.70GHz and 64 GB RAM, with Windows 10 Pro. The CRO-SL with Cross-Entropy code is implemented in MATLAB R2020b.

Benchmarck test cases to validate the proposed metaheuristics
To verify the behavior of CE+CRO-SL in comparison with other metaheuristics including the standard PSO, we carried out a experimental design using three well-known benchmark functions. For this experimentation, the same parameters described in Table 2 are used, except for the maximum number of function evaluations (FEs) that have been determined here as 100.000 FEs. For greater testing power, we check each algorithm by function in dimensions 10, 30, and 50.
Equations (21), (22) and (23) show the benchmark functions: -Schwefel function -Multimodal-Goal = 0, Algorithm 2 CE+CRO-SL Require: population size (N P), # of reef rows (n), # of reef columns (m), # of filled holes in reef (n f ), predation probability (P ψ ), # of substrates (N sub ), # of jumps (n jumps ), reproduction probability (P b ), dimension (D), list of operators for each substrate (L ops ), number of CE calls (N C E ), lower bounds (X lb ) and upper bounds (X ub ) 1: Assert that n · m == N P 2: Set the generation number t = 0 3: Initialize empty reef with size n × m 4: Assign n f /N sub random positions in the reef for each substrate 5: Initialize the n f individuals in the population at random according to U (X lb , X ub ) 6: Place each individual in an empty position of the reef select at random 7: Evaluate the current population 8: Update the global best x gb 9: while stopping criterion is not satisfied do 10: if t < N C E then 11: Run CE (optional) 12: else 13: for i ∈ [0, n) do 14: for j ∈ [0, m) do 15: if position Λ(i, j) is empty then 16: Continue to next position 17: end if 18: Retrieve the operator o i j associated with the position Λ(i, j) 19: of the individual x i j in the reef 20: if U (0, 1) < P b then 21: Generate offspring x o i j using the operator o i j 22: else 23: Generate offspring x o i j at random according to U (X lb , X ub ) 24: end if 25: Evaluate offspring x o i j

26:
for jumps ∈ [0, n jumps ) do 27: Select a random individual x i j associated with position Λ  Table 3 summarizes the results of the simulations performed. The results statistically show that the standard version of PSO, located in the middle of the table, presented a performance very distant from the other metaheuristics with the highest values found for the solution of the benchmark functions. This fact corroborates the improvement in techniques always aiming to find more efficient minimum points. In this context, the EPSO and CE-ESPO techniques, based on PSO, show that although the mean results obtained are better than the standard PSO, the Cross-Entropy (CE) technique as an initial depth search operation very subtly benefits the EPSO algorithm in the medium and high dimensions (30 and 50) of the Rosenbrock and Schwefel functions. When evaluating the CE+ESPO and CRO-SL standard results, we can see that the PSO-based version (CE+EPSO) outperforms the average CRO-SL results. However, when the Cross-Entropy operation is coupled to the CRO-SL (generating the version proposed here, CE+CRO-SL), we notice that the depth-first search not only improves the behavior of the algorithm, but also makes it capable of outperforming all versions of metaheuristics to which it has been compared. Taking into account that for dimensions 30 and 50, the results of CE+CRO-SL are robust for these test functions that have a difficult optimization nature; we understand that the proposed algorithm works well in solving problems not only of low dimension, but also of medium and high dimensions.

System with wind generators and controllable loads
This work considers the IEEE 57 Bus-System as a base case of electrical dispatch problem. The optimization problem, described in detail in Sect.
(2), has 35 variables for optimization (dimension = 35). In addition, Fig. 3 represents the detailed flowchart corresponding to OPF problem state solved by using the metaheuristics addressed in this work. Considering wind energy in this system, three winds turbines as renewable energy sources are used. Figure 4 shows one example of the Weibull probabilistic distribution (Arslan et al. 2014) generated by Monte Carlo Simulation, meaning the calculated power for the randomly generates samples of wind speed. The uncertainty of power generation for the three wind turbines at bus 2, bus 6, and bus 9 is shown in Fig. 5. Figure 6 shows the mean convergence line of CRO-SL, EPSO, and CMA-ES and the respective versions with Cross-Entropy method. Observing Fig. 6, note that both CRO-SL versions are shown to be competitive when compared with the other algorithms. The magnified area shows the mean value of each algorithm obtained in a specific range of function evaluation counter. Although CE, CRO-SL, and CE+CRO-SL show to converge first, note that the CRO-SL with Cross-Entropy version obtains the lowest average power generation cost in the case study. In this case, CE+CRO-SL has a cost  of 82512,50 $/h to produce power energy in the system with wind generators and controllable loads. Note that the EPSO metaheuristic refines the search in the solution space by continuing from CE, as so does the CRO-SL algorithm. The CMA-ES algorithm does not show convergence improvements even with the use of CE method.

System with wind/solar generators and controllable loads
To consider wind and solar energy generators and controllable loads, we consider three renewable energy generators (2 wind and 1 solar PV). According to (Reddy et al. 2017), solar radiance follows a lognormal distribution. Thus, it is possible to derive the energy produced from the solar photovoltaic system using a probability distribution model. We use Monte Carlo Simulations to obtain a distribution of solar radiance into uncertain power generation. Figure 7 shows the solar radiance histograms with corresponding power to be produced from solar panel system. The uncertainty of power generation of renewable generator (wind and PV panels) is shown in Fig. 8. Figure 9 shows the mean convergence line of the algorithms in the electrical dispatch problem considering wind and solar resources. As in the case of the network that only considers wind generators, the solutions obtained by the tested algorithms maintain the same convergence behavior when a wind generator is replaced by solar panels. Note that in this test scenario, the result of CE+CMA-ES is visibly better than the standard version of the algorithm. The CE algorithm is visually more efficient than the canonical versions of EPSO and CMA-ES, in addition to converging faster than the coupled version of CE+CMA-ES. The CE+EPSO coupled algorithm has its final value closest to the solution value found by CRO-SL in its classic form. Finally, the coupled version of CE+CRO-SL shows a faster convergence result than the others and presents the best result compared to the others.

System with wind/solar/small hydro generators and controllable loads
We adopt as a final case test a grid with three renewable sources: a wind generator (bus 2), a solar panel solar (bus 6), and a small-hydro generator (bus 9). Here, the uncertainty in wind speed and solar radiation follows the same approaches explained before. To generate a distribution to the hydropower production, the Gumbel probabilistic distribution is used (Mujere 2011). The distributions of wind speed, solar radiation, and river flow have been simulated through the Monte Carlo method, considering the uncertainty characteristic of each renewable source. Figure 10 shows one example of the frequencies generated by the simulation carried out. Figure 11 presents the uncertainty of power generation in each renewable source used in the experiment. Figure 12 shows the mean convergence line for the systems considering wind/solar/small hydro generators and controllable loads. We can see that CE+CRO-SL keeps obtaining the best convergence result compared to the others metaheuristics analyzed. We emphasize here that, as in the previous systems, the classic version of CRO-SL maintains a visual result superior to the EPSO and CMA-ES algorithms, even in its boosted versions with the CE method. The CE method has more efficient average results than the EPSO and CMA-ES algorithms. This Mean convergence line for the IEEE 57 bus system/OARDP: System with Wind/Solar generators and controllable loads. The x-axis represents the function evaluations (FEs) and the y-axis the mean value of the fitness function over the 12 runs feature indicates that CE is a good starting method for finding optimal solutions with alternative metaheuristics such as the CRO-SL algorithm.

Discussion of results with statistical inference
In our experimental design, for all test cases described in Sects. (4.2), (4.3), and (4.4), each algorithm has been executed 12 times. We choose to analyze and discuss the results of the four algorithms that showed the best convergence robustness. For that, the first step evaluates the sample dispersion of the solutions of each algorithm using boxplot graphs. Boxplots are not only useful for analyzing the range and distribution of the data, but also they can provide information about the true difference among the means. If the notches in the boxplots do not overlap, it can be concluded, with 95% confidence, that the true means do differ (Marcelino et al. 2021b). Figure 13 presents, for each described system  We can see that the Cross-Entropy method improves the results of CRO-SL since there is a statistical difference between both versions favoring the CE+CRO-SL. Consid-ering the CE+CRO-SL, it is important to notice that, in all test cases, there are a smaller variability and smaller outliers when compared to the other approaches. The algorithm showing the greatest variability and largest outliers is the CE+EPSO. This behavior can be seen in all test cases.
Since the notches in the boxplots for CE, CRO-SL, and CE+EPSO do overlap in all test cases, to verify whether the true mean differs or not it is necessary to perform a hypothesis test. Since the normality assumption of all algorithm samples has been validated, the Analyses of Variance (ANOVA) test is applied to compare the algorithms throughout the 12 runs. Following Marcelino et al. (2021c), if ANOVA states there is a statistical difference between the means of the algorithms, a Tukey test is applied to simultaneously assess all pairwise comparisons and to identify any difference between two means that are greater than the expected standard error.
Using a level of significance equals to 5%, a p-value below 0.05 is found indicating that there is a difference among the means. Thus, a Tukey test is carried out to identify where the differences between the samples are. Table 4 shows the results of optimal settings of control variables for each case test, according: (1) System with wind generators and controllable loads, (2) System with wind/solar generators and controllable loads, and (3) System with wind/solar/small hydro generators and controllable loads. Table 4 also informs the optimized result from the algorithms of each case system using the median solution found of 12 runs and visualized on boxplots. We are making available a summary of statistical metrics in Table 4 to address the performance analysis of the CE, CE+CRO-SL, CE+EPSO, and CRO-SL algorithms.
Observing the general metrics of Fuel Costs in $/h (best, median, wor st, mean and std) in Table 4, we can see that CE+CRO-SL obtains the best results in all grid systems tested. Although these metric values are preliminary measures, in many cases they are not sufficient for a more effective analysis of the results. The ANOVA test performed on the three test cases refutes the hypothesis of equality of means from a p-value less than 0.05. Table 5 shows the algorithm classification results. The statistical inference carried out proves that the CE+CRO-SL algorithm is the most robust approach for solving the electrical dispatch problem in a renewable generation environment, in the three tested energy systems.
It is important to say that the canonical version of CRO-SL remains tied with the CE-boosted version, in cases 1 and 2 in first place. This information corroborates the efficiency of the CRO-SL method for solving the problem addressed here. In the analysis, the CE algorithm has the highest mean value and the lowest standard deviation. This justifies the fact that this algorithm remains statistically similar to the CE+EPSO algorithm in the results obtained in the cases 1 and 2. In general, the average result obtained by each algorithm for solving the electrical dispatch problem in the network containing three wind generators has a total cost in ($/h) equivalent to: 99432.94 (CE), 82512.53 (CE+CRO-SL), 86481.9 (CRO-SL) and 94954.90 (CE+EPSO). We can noticed that CE+CRO-SL when compared to other methods can save, per hour, the amount of $16.920,41 (comparing whit CE), $3.969,37 (comparing with CRO-SL), and $12.442,37 (comparing whit CE+EPSO). As discussed, CE-CRO-SL has the same classification as standard CRO-SL. However, we can note that the use of the CE method as a starting operator to find a promising region in the search space guarantees an energy generation cost savings when the grid uses three wind generators.
Analyzing the network with two wind generators and a solar generator (case 2), we see that the algorithms find, on average, the fitness values in ($/h) according to: 82657.52 (CE), 69111.2 (CE-CRO-SL), 75674.8 (CRO-SL), 77211.41 (CE+EPSO). Here the savings addressed to CE+CRO-SL is $13.546,32 (comparing with CE), $6.563,6 (comparing with CRO-SL), and $8.100,21 (comparing with CE+EPSO). In this case-the System with wind/solar generators and controllable loads -the statistical inference concluded there are no statistical differences that corroborate for equality of means among the CE+CRO-SL algorithm and the others method tested. Table 4 informs the statistical metrics of system with wind/solar/small hydro generators and controllable loads scenario and Table 5 the Tukey test classification. We can see that CE+CRO-SL and CRO-SL show no statistical difference in term of mean results. In terms of average value, the algorithms finished the search process achieving the respective results in $/h: 66493.38 (CE), 56852.39 (CE+CRO-SL), 60040.47 (CRO-SL), and 66241.29 (CE-EPSO). In this test scenario, three thermoelectric generators have been replaced by renewable source generators, namely wind, solar, and hydraulic. It is possible to notice that the total cost of generation is lower in this scenario, since hydroelectric generation has a low cost when compared to the others. In general, the use of CE+CRL-SL when compared to other techniques saves the average amount of $9.640,96 (comparing whit CE), $3.188,08 (comparing with CRO-SL), and $9.388,9 (comparing whit CE+EPSO) per hour of generation.

Discussion about the savings achieved
To verify effectiveness of the proposed method, the largescale IEEE 57-bus system is considered for study purpose in three distinct smart grid approaches. In general, performance of CE+CRO-SL is found to be superior for higher number of variables in constrained optimization problems. Hence, CE+CRO-SL algorithm is applied to the system to minimize fuel cost independently. A total of 3 × 10 4 function evaluations have been performed for each test case for all approaches used. CE+CRO-SL has found the best set of average solutions, and as reported in Table 4, the mean solution presented for each test scenario meets the constraint of the electrical dispatch problem. Furthermore, CE-CRO-SL stands out for presenting differences in the average of results when compared to CE and CE+EPSO algorithms.
Despite not presenting statistical differences regarding the classic version of CRO-SL, the difference in the mean results of the fitness function is high. Table 6 shows a monthly projection of savings to be achieved using CE+CRO-SL compared to the other algorithms. It is noticeable that the results of the CMA-ES (with or without CE) are extremely higher than the others, so we can exclude these results from the analysis. Monthly CE+CRO-SL can save millions of dollars when compared to other algorithms, CE, CRO-SL, and CE+EPSO.    Table 6 indicates that when inserting three wind generators into the IEEE 57 Bus-System, the projected difference between CE+CRO-SL and CE is $12 million each, followed by $8.9 million compared to CE+EPSO and $2.8 million with regard to CRO-SL. Similar quantities are informed for cases where there is insertion of solar and hydraulic generators. We emphasize that the least difference pointed out is in relation to the standard CRO-SL. This fact corroborates the robustness of the method, since it presents a better solution for electrical dispatch control than the CE, CE+EPSO, and CE+CMA-ES methods. Thus, by coupling the CE method as a starter to CRO-SL, it is possible to generate an efficient and economical control solution for smart grid networks. Therefore, the main advantages of using a method such as CE coupled with a metaheuristic that works on population substrates, such as CRO-SL, are: -We build an exploration first phase based on the Cross-Entropy mechanism. This causes the population to have a deep descent behavior previous to the CRO-SL application. Thus, a plowing basin can be reached more quickly and efficiently. -CRO-SL is a modern metaheuristic capable of executing several search operations, such as mutation coming from the differential evolution algorithm, harmonic mutation, and several recombination operations. Thus, the exploitation phase works in a more exploratory way, which aims to ensure a greater scan of the local neighborhood in search of minimum points of the function to be optimized. -The coupling of these techniques solved an NP-Hard, non-convex, nonlinear and high-dimensional problem, the OPF with security constraints. It is possible to notice that the boxes presented by this algorithm have little dispersion in the three scenarios studied. Thus, it was shown that when applying CE+CRO-SL inference tests, it was statistically more robust when compared to the others. -The economic projection analysis showed that CE+CRO-SL can monetarily reach millions of dollars, guaranteeing the security of the system and dealing with the uncertainty coming from renewable sources when applied to the grid.

Conclusions
In this paper, we have approached the Optimal Power Flow (OPF) problem in a smart grid facility. We have proposed a novel boosted algorithm for mono-objective optimization, the CE+CRO-SL, that uses the Cross-Entropy (CE) method as a previous step, with the consistent Coral Reef's with Substrate Layers (CRO-SL) algorithms as a final metaheuristic procedure. The CE+CRO-SL has the advantage of producing a hard exploitation process, due to its operation of working with substrates, i.e., merging the best opera-  tors coming from different modern heuristics. In addition, by adding a previous CE operation, the final algorithm is capable of finding promising solutions more quickly than the CRO-SL on its own. Thus, the proposed technique differs from classical methods which can be computationally expensive to solve large-scale and complex problems. The simulation results have been carried out in the IEEE 57 Bus-System, with the objective function of minimizing generator costs. We incorporate in this grid renewable generators generating three different scenarios: (1) System with wind generators and controllable loads; (2) System with wind/solar generators and controllable loads; and (3) System with wind/solar/small-hydro generators and controllable loads. For all the testing systems, CE+CRO-SL reached better solutions and faster convergence than CE, CRO-SL, EPSO, CMA-ES, CE+EPSO, and CE+CMA-ES in all cases studied. In thorough statistical inference, the CE+CRO-SL outperformed most of the methods used for performance comparison. The simulation results also showed that CE+CRO-SL can be a competitive solver for dealing with large-scale security constrained OPF problems considering the uncertainty of power generation in each renewable source used. The CE+CRO-SL solution was able to generate a profit of millions dollars monthly, according to a first economic forecast study carried out. We believe that, as a future work, a technique for performing the parameters fine-tuning of the algorithm, in real time, can be adopted to improve the performance of this approach in smart-grid systems optimization problems.