Fast Optimal Network Reconfiguration With Guided Initialization Based on a Simplified Network Approach

Optimal Network Reconfiguration (NR) is a well-accepted approach to minimize power loss and enhance voltage profile in the Electrical Distribution Networks (EDN). Since the NR problem contains huge combinational search space, most researchers consider the meta-heuristic techniques to attain NR solution. However, these meta-heuristic techniques do not guarantee to obtain the optimal solution besides they require large processing time to converge. This is mainly due to (1) random initialization and updating of population and (2) the continuous verification of population during the search process. With the aim of reducing the computational time and improving the consistency in obtaining the optimal solution as well as minimizing power loss and enhancing the voltage profile of the EDN, this work proposes a new method based on two-stage optimizations. The proposed method introduces an approach to simplify the network into simplified network graph. Then, this approach is utilized for guided initializations and generations of the population and for the proper population’s codification. The proposed method is implemented using the firefly algorithm and verified on 33-bus and 118-bus test systems. The results show the ability of the proposed method to obtain the optimal solution within fast computational time and with superior consistency compared to the conventional methods.


I. INTRODUCTION
With the deregulation of the electricity sector, power utilities are required to ensure that customers receive reliable power supply.At the same time, power utilities also need to run their operation at optimum cost.One of the problems that would increase the operation cost is power loss.It was estimated that power loss in transmission and distribution systems is the largest individual consumers for any power systems [1].Thus, it is very crucial to find an effective method to minimize such losses.One of the well-known approaches to achieve this goal in Electrical Distribution Networks (EDNs) is through Network Reconfiguration (NR).NR is the process of The associate editor coordinating the review of this manuscript and approving it for publication was Juan Liu .changing some of the EDN's switches from open to close and vice versa, to improve the EDN performance in minimizing power loss [2], improving voltage profile [3], load balancing [4] and system restoration [5].Obtaining the optimal NR in short computational time is getting more attention recently due to the advancement in the controlling technology of the EDN by the system operators that allows faster switches' changes for better adaption with the load changes.However, finding the NR solution is still challenging due to the large combinational search space and the onerous duty of maintaining the radial structure during the EDN's operation.
In general, methods to solve the NR problem can be categorized into heuristic and meta-heuristic techniques [6].Heuristic methods depend on approximation to find the NR solution.The sequential switch opening method was used in [7] to solve the NR problem during the planning and operation of the EDN.The branch exchange method was presented in [8] to find the configuration which minimizes the power loss and improves system load balancing.Recently, the authors of [9] solved the problem of the dynamic reconfiguration depending on Lagrange relaxation approach.The heuristic methods suffer from a lack of accuracy due to the usage of relaxation to find the solution.Therefore, although heuristic methods might require a shorter time to obtain the solution, it traps at local optimal.
To overcome the shortcomings of heuristic methods, meta-heuristic methods have been explored extensively to solve NR.Binary Particle Swarm Optimization (BPSO) was used in [10] to minimize the power loss and enhance the reliability of the EDN by finding the NR.Cuckoo search algorithm was presented in [11] to find the configuration that minimizes the power loss and improve the voltage profile.In [12], the artificial bee colony was used to solve the problem of optimal NR and wind turbine placement.A combination of the Selective Firefly Algorithm (SFA) along with a heuristic technique, that depends on a power flow analysis creation, was proposed in [13] to solve the NR problem.The authors of [14] used the decimal encoding of the solution and the direct load flow calculation approach to accelerate finding the NR solution in the EDN.The previous two elements were implemented using Particle Swarm Optimization (PSO).A hybrid optimization method was proposed in [15] to integrate the fuzzy pareto concept with the customized shuffled frog leaping technique for finding the solution of the NR problem.This hybrid method reduces the computational time by considering only the feasible solutions in the search space.In addition, some previous works proposed two-stage methods to solve the NR problem [16], [17].A hierarchical decentralized method (HDM) was proposed in [16] to reduce the power losses in the EDN by finding the NR solution.The EDN is broken down into smaller subsystems, where an agent is allocated to each subsystem.Then, a two-stage method is defined to regulate the reconfiguration of these subsystems.The first stage aims to find the reconfiguration of each subsystem, whereas the second stage coordinates the results of each subsystem to reach a satisfactory configuration.In [17], the first stage intends to find the configuration that minimizes the reactive power loss by a heuristic method.Then, the second stage uses the Improved Harmony Search Algorithm (IHSA) to enhance the system loadability.
It worth to mention that many studies utilized the Fundamental Loops (FL) approach to accelerate finding the NR solution by changing the population's creation process from the classical approaches.FL approach was introduced in [18] and proves its efficiency in eliminating a considerable number of the configurations that do not fulfill the EDN's operation constraints.FL is defined as the loop created in the EDN when a normally open switch is closed.Therefore, the number of FLs is always equivalent to the number of normally open switches in the EDN.To form the candidate population, only one switch is selected from each FL.In [18], GA was integrated with FLs concept to generate feasible population and develop new genetic operators.This method succeeded in reducing the computational time, but it did not ensure the system radiality because the interior nodes might be isolated.In [19], a similar approach of [18] was employed but with artificial immune network algorithms.The authors of [20] improved the work in [18] by eliminating the non-radiality cases.This was accomplished by introducing new rules that prevent isolation of the internal nodes.To prove the efficiency of the approach, a multi objectives function combining GA and fuzzy logic methods was presented.In [21], the rules of [20] were integrated with discrete PSO and an external archive was used to store non-dominated solutions.
The prior review shows that meta-heuristic methods were frequently used to solve the NR problem.In general, all meta-heuristic techniques rely on creating a random initial population and keep updating this population until it converges to the same solution or the maximum number of iterations is reached.For the NR problem, the number of solutions in the search space is exponentially related to the number of switches in the system.However, the majority of these solutions do not maintain the radiality structure of the system.Hence, these solutions are not feasible and need to be modified which will consequently slow down the search process.Therefore, conventional meta-heuristic techniques require large computational time.Moreover, in general, meta-heuristic methods that start the search process without a proper initial population have less possibility of finding the optimal solution and the search process takes longer time [22], [23].Therefore, most of the previous methods failed in obtaining the optimal NR solution with good consistency.
Considering the needs of reducing computational time and improving the consistency of finding the optimal solution, this paper proposes a new two-stage method to solve the NR problem.The proposed method introduces a new approach to simplify the network into the Simplified Network Graph (SNG).In addition, this work introduces an enhanced codification to create only feasible solutions.The proposed method is implemented using the Firefly Algorithm (FA) and tested on 33-bus and 118-bus IEEE test systems.In addition, the conventional Evolutionary Programming (EP), the conventional PSO and the conventional FA were implemented and examined on the same test systems.The results of the proposed method are compared to the results obtained by these conventional meta-heuristic techniques as well as to various recent published works.The contributions of this work are outlined as follows: • The major contribution of this work is introducing the simplified network approach to construct the SNG of the EDN.In the first stage, the SNG is employed to find the initial population of the meta-heuristic technique that is used in the second stage.In addition, the SNG assists in the population's codification process which maintains the radiality of the population.
• An enhanced population's codification is proposed to maintain the radiality of all populations during their initialization and updating.This codification utilized the FL principle and the SNG to generate only radial solutions.Consequently, the search process will carry on without any radiality check interruptions or population readjustment.

II. PROBLEM FORMULATION
The NR problem can be formulated mathematically as an optimization problem.The optimization algorithm aims to find the combination of open switches that minimize the power losses and improve the overall voltage profile in the EDN while fulfilling system constraints.Therefore, the objective function F can be expressed as follows: where, P R loss is the net power loss.IVD is the index of the voltage deviation.
Since the objective function F is twofold with different units, the net power loss P R loss is taken as the ratio between the total active power loss of the system after reconfiguration P rec loss and the power loss before reconfiguration P 0 loss .
The power loss P loss in the distribution systems is given by the following equation: where, nbr is the total number of the branches excluding the open branches, I t is the current at line t, R t is the resistance of the line t, and l t is the topology status of the line t(1 = close, 0 = open).The Index of Voltage Deviation (IVD) penalizes the highest voltage deviation from the nominal voltage.The smaller the value of the index, the better the performance of the system.IVD is given by the following equation: where; nbus is the total number of buses in the system, V i is the voltage at bus i. V 1 the nominal voltage of the system.Subjected to the following constraints: a-Power balance: In all distribution networks, the power supply must equal to the sum of the load demand and power loss.
P substation = P load + P loss (5) where, P substation is the total power supply, P load is the total load demand.
b-Voltage constraint: The voltage magnitude V bus at each bus should stay within specific limits during the operation of the system.
V min < V bus < V max (6) where, V min and V max are the minimum and maximum allowed voltage in the system, respectively.V bus is any bus voltage.c-The radiality constraint: The distribution systems must stay radial during it is operation.In this paper, the radiality is maintained all the time as it will be explained in section V.

III. FIREFLY ALGORITHM
Firefly Algorithm (FA) is a meta-heuristic technique that was recently introduced in [24] and it proved its efficiency to solve different optimization problems [25] including the discrete and combinational optimization problems [26], [27].
FA was inspired by the flashing behavior of the fireflies in nature.This behavior is essentially used by the fireflies to communicate among each other.When the firefly produces light with an I intensity, it attracts other fireflies, that have less intensity, in different attractiveness β based on the distance r between the two fireflies.The longer the distance between two fireflies, the less the attractiveness.In this algorithm, each population is represented by a firefly location, whereas the objective function is defined as the intensity of each firefly.
The attractiveness between two fireflies β(r) is given by: where; β 0 is the attractiveness at zero distance.γ is the light absorption coefficient.r is the Cartesian distance between two fireflies.The Cartesian distance between any two fireflies h l and h j is r lj and it is given by: where; d is the problem dimension.r lj is the Cartesian distance between two fireflies h l and h j .h l,k and h j,k are the k th element of the firefly h l and h j , respectively.For all fireflies, if h j is brighter (has higher light intensity) than h l , then h l is attracted to h j and h l is updated by the following equation: where; α is the randomized parameter.rand is a uniformly distributed random number between 0 and 1.

IV. THE ARCHITECTURE OF THE SIMPLIFIED NETWORK GRAPH (SNG)
In this section, the SNG's design is explained followed by an illustrative example.It is well known that the EDN consists of several buses, which have various loads levels, joint together by lines.The flow of current from the source to the load buses through lines is determined by the switches located along the lines.When the switch is closed, current flow in the line.The steps for finding the SNG are: 1) Close all switches in the system and find the Undirected Incidence Matrix (UIM) for the EDN graph.
The columns of the UIM represent the edges, i.e. the switches, whereas the rows represent the nodes, i.e. the buses.If node n 1 and node n 2 are connected by edge e 12 , then UIM (n 1 ,e 12 ) = 1 and UIM (n 2 ,e 12 ) = 1.Otherwise, UIM (n 1 ,e 12 ) = 0 and UIM (n 2 ,e 12 ) = 0. 2) Sum up all the elements for each row to get the degrees of the nodes and store the results in a vector named Node Degree Vector (NDV) where its dimensions are: (1 × number of nodes).3) Delete the nodes with degree equal to 1 and all their corresponding edges.4) Repeat steps 2 and 3 until all nodes' degrees are equal to or greater than two.The resulted graph is the initial graph without nodes with a single connected switch or the switches connected to the feeder because the prior switches must remain closed all the time.5) If the node's degree is greater than two, add it to a vector named: Fundamental Nodes Vector (FNV).together through the paths.The load of the fundamental node n is given by: where; P n + jQ n is the fundamental node loads, P n + jQ n is the initial load of the fundamental node n. i m i=i 1 (P i + jQ i ) is the sum of the load of all nodes that are connected to the feeder through only one fundamental node n. k u k=k 1 (P k + jQ k ) is the sum of the load of all non-fundamental nodes that belongs to the paths connected to the fundamental node n.The impedance of path c that connects two fundamental nodes n 1 and n 2 is given by: Flowchart of the approach of finding the SNG.

TABLE 1.
The paths and the switches of the 14-bus system.
where; (R i + jX i ) is the impedance of switch i that belongs to path c. i t is the total number of switches located between node n 1 and node n 2 .After calculating the loads of the fundamental nodes and the impedances of the paths in the SNG, the power loss and the IVD can be computed through the load flow calculation.A meta-heuristic technique is used to find the best combination of paths that minimize the fitness function as it will be explained in section 4. Fig 1 shows the flowchart illustrating the approach to find the SNG.In addition, the architecture of the SNG is illustrated through pseudo-code as presented in Fig. 10.
To describe this concept, 14-bus network shown in Fig. 2 (a) is taken as an example The UIM and NDV matrix for this EDN is given in Fig. 2 (b).From the UIM matrix, it can be concluded that node 12 and switch 12 should be removed since node 12 degree equals 1.The resulted graph is shown in Fig. 2 (c).From the updated NDV, it can be observed that only nodes 1, 4, 8, 13 degrees are 3. Hence, they considered as fundamental nodes.The switches that connect those fundamental nodes together are gathered to form the paths.For example, P 1 contains a switch S 1 .Whereas, P 3 contains switches S 4 , S 11 , S 13 and S 14 .The resulted graph is the SNG of the 14-bus and it is shown in Fig, 2 (d).Table 1 shows the paths of the SNG along with its corresponding EDN's switches.

V. THE PROPOSED CODIFICATION AND MAINTAINING THE RADIALITY
In this section, the approach for finding the FLs of the distribution system is explained.Thereafter, the proposed FIGURE 2. Finding the SNG of the 14-bus system (a) The original 14-bus system.(b) The UIM and NDV matrixes of the 14-bus EDN (c) The 14-bus system after deleting node 12 and switch 12.(d) The Simplified Network Graph of 14-bus system.codification, which accelerates the search process and maintains the system radiality, is illustrated.
As stated in section IV, EDNs consist of switches whereas SNGs are made up of paths.In this work, the procedures of finding the FLs, codifying the population, and maintaining the radiality are similar in both the EDN and SNG.Therefore, to generalize the explanation for both; EDN and SNG, the term branch is used to represent the switch and the path in the description of these procedures.

A. FUNDAMENTAL LOOPS
The distribution system, in its initial status, has a radial structure, i.e. it has no loops and no isolated buses.Starting from the initial topology, when a normally open branch is closed, one unique FL will be created.By repeating this process to all normally open branches, all FLs can be founded.Hence, the total number of the FL is always equal to the number of the normally open branches.For instance, the FLs' matrixes for the SNG and EDN of the 14-bus system, which was described in section III, is given by:

B. THE PROPOSED CODIFICATION
Most of the conventional methods to solve the NR problem used either binary or decimal codifications to encode the populations [14].However, the FL based codification approach is considered more efficient in terms of computational time, since the number of FLs in any distribution network is far fewer than the number of switches.Therefore, in this paper, the FL principle is used to encode the population.In addition, in this study, the number of the population's elements will be equal to the number of FLs in the system where each element refers to the branch index in the corresponding FL matrix.For example, by using the FLs of the 14-bus system shown in (12)(13), when the population is pop = [1, 3,6] in the EDN, then the chosen switches to be open are s1, s7, s9, respectively.Similarly, in the SNG, when pop = [2, 2, 3], then the paths P5, P2, P6 will be open.

C. RADIALITY MAINTENANCE
To maintain the radiality of the system, it is necessary first to define the common branches and the prohibited branches groups.If the branch is involved in more than one FL, it is called a common branch.Otherwise, it is called an uncommon branch.The prohibited branches groups are defined as the groups of branches that are not allowed to be open at the same time to maintain the linkage of all the nodes in the system.For example, if node j is connected to three branches and these branches are part of three different FLs, then it is potential that those three branches will be selected to be open in one population and as a result, node j will be isolated.
The following rules should be applied to ensure the radiality of the system: Rule 1: The dimension of the solution vector equals the number of FLs.
Rule 2: Only one branch from each FL should be selected to be open during one population.
Rule 3: If one common branch is selected to be in the solution vector, this common branch will be deleted from the rest of the FLs.
Rule 4: In the EDN level, when one switch from a path is selected in the solution vector, the remainder switches of that path will be deleted from the following FLs.
Rule 5: All the branches of any prohibited group must not be off in one solution vector.
In [20], the proposed method imposes deleting the population when it violates one of the rules.As a result, this will interrupt the search process and slow down the converge to the same solution.Whereas, in this paper, by following the proposed rules, all the created and updated population are feasible.Consequently, the search process will persist smoothly.Furthermore, the utilization of the SNG assists in accelerating the population's creating and updating.

VI. THE PROPOSED OPTIMAL NR METHOD
In this section, the conventional FA method is demonstrated as well as the proposed two-stage FA method.FA is classified as a swarm-based optimization.Hence, it owns most of swarm-based optimizations features.However, FA has two important superiority over the other optimizations.First, its ability to divide the population into subgroups and then each subgroup will deal with a local optimum.Thereafter, the best global solution will be chosen.Second, this subdivision will allow the population to search in different parts of the search space simultaneously.Thus, the computational time will be reduced comparing to other optimizations [24].Therefore, FA is chosen in this work.

A. CONVENTIONAL FA METHOD
The conventional FA method typically employed the following processes in solving the NR problem: a) Input the EDN data as well as the FA parameters.b) Population in the conventional FA is the combination of the open switches in the EDN, whereas the fitness is given by (1).It starts with generating a random population and then test this combination to check if it fulfills all the system constraints.The population, that do not meet one or more constraints, will be replaced by a new feasible population.This process is repeated until all the populations satisfied the specified constraints.c) Next, the iteration is started by solving the load flow analysis to obtain the power flow in all network lines.Based on the power flow results, the fitness function of each firefly can be determined.d) For each firefly, its attractiveness to the other fireflies in terms of its brightness is checked and their locations are subsequently updated based on (7 to 9).Note that the updated population will be rounded to the closest integer number.Next, the system constraints of the updated population are checked.Again, the population that does not meet the system constraints will be replaced with another random feasible population.e) Ranking of the fireflies will be done next to name the best firefly.f) Iteration is continued by repeating steps (c) to (f) until the maximum iterations number is reached or until the population converged to the same solution.g) The best firefly along with its fitness will be determined and the best configuration of open switches that minimizes the objective function given by ( 1) is found.

B. PROPOSED TWO-STAGE FA METHOD
The following steps describe in detail the implementation of the proposed two-stage FA method to solve the NR problem.In this method, FA is used in the first stage to find the initial population whereas, in the second stage, it will be employed again to find the optimal NR.The flowchart of the proposed two-stage method is shown in Fig. 3 where it consists of Step 1-9 in the first stage and Step 9-15 in the second stage.
Step 1: Read the EDN data and the FA parameters.Then, initialize an Initial (N FF × N FL ) Solution Matrix (ISM).where; N FF is the number of the fireflies population whereas N FL is the number of the FLs of the system (dimension of the problem).Each row of the ISM will contain the configuration of the open paths that minimizes the given fitness function in the SNG.
Step 2: Start the first stage by finding the SNG of the EDN using the approach proposed in section IV and calculate its loads and impedances based on (7)(8).Subsequently, find the FLs of the SNG as in section V.
Step 3: Create an initial population as stated in section V.All the generated population are radial.In this stage, the population's elements are the open paths indexes from the FL SNG matrix.Each row of the fireflies' matrix represents individual firefly as follows: Here, P is the index of the open path for a population.
Step 4: Start the iteration by solving a load flow for the population to obtain power flow in all network lines.Based on the power flow results, the power loss and the IVD for the SNG can be determined and hence the fitness function is calculated using (1).
Step 5: Update the ISM by replacing the population that have the worst fitness with those that have better fitness.
Step 6: For each firefly, check its attractiveness to all other fireflies by comparing their brightness and update the fireflies based on Eq. ( 7)-( 9) and the rules proposed in section V.All fireflies should be rounded to the closest integer value.
Step 7: Rank the population based on their fitness function.
Step 8: Repeat steps 4 to 8 until the maximum number of iterations is reached, or the population converges to the same solution.
Step 9: End the first stage and move to the second stage.The output of this stage is the ISM.The ISM contains the ranked open paths combinations that represent the solutions of the first stage.
Step 10: Generate the initial population based on the ISM determined from the first stage.Each path from the ISM contains one or more switches.However, only one switch is chosen randomly from each path in the ISM.The population in this stage is the index of the switch in the FL SNG FL EDN FL EDN matrix.The initial population's matrix x s is represented by the fireflies and is given by: where; N FL is the problem dimensions and it equals the number of FLs in the EDN.N FF is the number of the fireflies, which is equal the number of populations in the second stage, S is the open switch's index in the FL EDN .
Step 11: Start the iteration by solving the load flow for all population to obtain power flow in all network lines.Based on the power flow results, the power loss and the IVD for the EDN can be determined and accordingly the fitness function using (1).
Step 12: For each firefly, check its attractiveness to all other fireflies (compare their brightness) and update the fireflies based on (7 to 9) and the rules proposed in section V.All fireflies should be rounded to the closest integer value.
Step 13: Rank the population based on their fitness function.
Step 14: Repeat the steps from 11 to 14 until the maximum number of iterations is reached, or the population converges to the same solution.
Step 15: Stop the process and print out the best firefly along with its fitness.The results show the best-found open switches' configuration that minimizes the objective function given by (1).
In this study, Newton-Raphson load flow (NRLF) is used to calculate the power flow for the conventional and proposed methods.However, if the NRLF does not converge, the fitness of the solution is neglected.

VII. RESULTS AND DISCUSSION
To examine the applicability of the proposed two-stage FA method to solve the NR problem in the EDN, 33-bus and 118-bus systems were used as the test system.Results of the proposed method were compared to the conventional FA, EP [28] and PSO [29] algorithms.FA, EP, and PSO have been successfully used to solve many optimization problems [30]- [32].The proposed method in its second stage starts the search for optimal configuration based on the initial population found in the first stage whereas conventional methods start the search process from random population.Furthermore, radiality check has to be done for each population update.The FA parameters are assumed to be β 0 = 1, γ = 0.5, α = 0.2 based on the empirical tests that gave the best performance for each test system.All the tests were carried out by MATLAB using a PC with an Intel Core 2 Duo, 3.06 GHz processor.
Since existing works use different computer specifications, it is not possible to make a fair comparison for computational time.Therefore, comparison with the literature can only be done for voltage profile and the best, average, worst and Standard Deviation (STD) of the power loss.The authors simulate all the configurations found in previous works for fair comparison.Nevertheless, comparison in computation time between the proposed two-stage FA and the conventional FA, EP, and PSO is presented to show the superiority of the proposed method.

A. 33-BUS TEST SYSTEM
The 33-bus IEEE test system [8] consists of 33 buses and 37 switches; switches 1 to 32 are the normally closed switches and 33 to 37 are the normally open switches.The system has a nominal voltage of 12.66 kV with the minimum and maximum allowable voltage magnitudes range between 0.9 p.u. and 1.0 p.u.Initial power loss of the system is 210.98 kW with the minimum bus voltage of 0.9038 p.u.Since there are 5 normally open switches in the system, then FLs number is equal to 5. The 33-bus EDN and its SNG are shown  in Fig. 4. (a) and (b), respectively.The SNG consists of 12 paths and 8 fundamental nodes (i.e.3,6,8,9,12,15,21,29) which is smaller than the original EDN.As a result, the search space for the first stage was reduced to only 429 feasible solutions instead of 4×10 5 solutions in the original EDN.Hence, finding the optimal answer in the first stage is very attainable.
Table 2 shows the results found by the conventional EP, PSO, FA as well as the proposed method.In this work, the simulation was run for 500 times and the best, worst and average power loss were collected for each run, in addition to the minimum voltage.Then, for each method, the STD of the power loss was calculated to determine the consistency in obtaining the solution.The optimal open switches configuration that minimizes the specified objective function under the system constraints.is (s7, s9, s14, s28, s32).The resulted power loss in the EDN after reconfiguration is 139.98 kW with the minimum voltage increment to 0.9413 p.u.This value is comparable to the solution found by the other methods and this verified the accuracy of the proposed method.It is worth highlighting that although all methods produced comparable optimal solutions, the STD of the power loss, as well as the total computational time for the proposed method, were significantly reduced compared to the other existing methods.The two-stage FA has the most consistent performance with STD of only 0.101 and average power loss of 139.99 kW which is very close to the optimal solution.In comparison, the conventional EP, PSO, and FA have STD values of 9.84, 9.78 and 4.19 kW, respectively, with the average power loss for conventional EP, PSO and FA amounted to 148.85kW, 149.2 kW and 143.81 kW, respectively.Hence, the stability of the proposed two-stage FA method in finding the optimal configuration surpassed the other conventional methods due to the proposed guided initializations resulted from the first stage and the proper population's codification that preserve the search process without any interference.In addition, Fig. 5 shows the voltage profile before and after reconfiguration.It is noted that in most buses,  the voltage enhanced after applying the configuration found by the proposed two-stage FA, comparing to the voltage profile in the base case.
In the proposed method, a path's configuration of (P7, P9, P6, P4, P8) was obtained in the first stage for all runs.This configuration contains the optimal switches' configuration, i.e. (s14, s28, s9, s7, s32).Therefore, the optimization search procedure starts from the initial populations that are adjoined to the optimal answer, which subsequently boosts the opportunity of the converge to the optimal solution in significantly small number of iterations.Directly, a small number of iterations reduces the overall computation time.
As tabulated in Table 2, the average number of iterations to converged in the proposed two-stage FA is 3.2, whereas they are 13.4,18.1 and 31.7 for conventional EP, PSO, and FA, respectively.In addition, the average time to converged is 1.7s for the proposed method, significantly faster than the average time needed for the conventional EP, PSO, and FA, which are 96s, 35s and 58s, respectively.Further analysis in regard to the computational time was carried out and summary is presented in Fig. 6 for the case of conventional FA.It can be observed that 77% of the total time is consumed to perform the radiality check where it must be checked for each population during initialization as well as during each iteration whenever the population is updated.This is due to the fact that the radiality cannot be guaranteed if switches combination were chosen randomly.Furthermore, time needed for radiality check increases proportionally to the size of the system.Therefore, for large EDN, the radiality check consumes a considerable time in the NR problem.remaining time allocation for load flow calculations (20%) and optimization process (3%) using conventional FA.
On the other hand, Fig. 7 shows the time consumption for the proposed two-stage FA method.The load flow calculations in the first stage consumed 23% of the total time while 71% of the total time is consumed by the load flow calculations in the second stage.The remaining 6% is passed on to the other processes such as population update and optimization procedure.It can be concluded that the proposed two-stage FA method managed to reduce significant iteration numbers and overall computational time due to the proper initialization process and the proposed population codification.
The proposed method is also compared against the previous works such as Adaptive Weighted Improved Discrete PSO (AWIDPSO) [35], Harmony Search Algorithm (HSA) [33], Firework Algorithm (FWA) [36], two-stage heuristic-IHSA method [17] and the Enhanced PSO (EPSO) [34] as tabulated in Table 3.It has been observed that the proposed two-stage FA produced comparable solution as FWA and heuristic-IHSA but with better STD of system power loss comparing to FWA.In addition, the average power loss of the proposed method is smaller compared to the methods in literature.

B. 118-BUS TEST SYSTEM
The 118-bus EDN is one of the largest-sized test systems typically used for distribution system [37].For this system, switches 1 to 118 are the normally closed switches, whereas switches 119 to 133 are the normally open switches.This EDN has a nominal voltage of 11 kV with the minimum and maximum voltage magnitudes range between 0.9 p.u. and 1.00 p.u., respectively.The power loss of the network before configuration (base case) is 1296.5 kW with the minimum bus voltage of 0.8688 p.u.The 118-bus EDN has 15 FL as it has 15 normally open switches.The SNG of this EDN consists of 41 paths and 27 fundamental nodes which are (1,2,4,8,11,24,25,27,30,31,36,42,45,56,61,65,67,68,76,78,82,89,95,100,105,110,113).Fig. 8 shows the 118-bus EDN and its SNG.The normally open switches are named based on the destination's bus in the base case (e.g. the switch between bus 2 and bus 10 is the switch number 10).The number for the normally open switches is shown in Fig. 8 (a).For the 118-bus system, there are 7×10 18 potential configurations candidates which translates to very huge search space.On the other hand, the number of configurations in the SNG of the 118-bus is around 15×10 3 .Thus, obtaining an initialization that leads to the optimal configuration is more prospective by the proposed method as compared to the conventional methods that generate the initial population randomly.
The optimal open switches configuration obtained by the proposed two-stage FA method is presented in Table 4.The optimal configuration is (s24, s26, s35, s40, s43, s51, s59, s72, s75, s96, s98, s110, s122, s130, s131).This configuration reduced the power loss to 853.58 kW and increased the minimum bus voltage of the system to 0.9323 p.u.A comparison between the voltage profile in the base case and after obtaining the optimal configuration is provided in Fig. 9.In addition, the results demonstrate a precise consistency in the proposed method performance since the STD is only 6.05 with the average power loss of 857.54 kW which is close to the optimal answer.On the other hand, the conventional EP, PSO and FA methods obtained a power loss of 907.34 kW, 896.88 kW, and 872.09 kW, respectively which are distanced away from the actual optimal solution.In addition, the STD for the conventional EP, PSO and FA are 158.43,159.44 and 141.16 kW, respectively, indicating poor performance of the conventional methods.
Table 4 also shows a comparison between the proposed method against conventional methods with regards to the average computational time and the number of iterations.The proposed two-stage method managed to find the optimal answer with an average of 15.1 iterations within an average computational time of 7.4s.On the hand, the conventional EP, PSO, and FA needed an average computational time of 284s, 171s, and 208s, respectively, to find the NR solution.In addition, the number of iterations for conventional EP, PSO, and FA are 115, 753 and 876, respectively.The superiority of the proposed method over the conventional methods in terms of the quality of the solution as well as computational time is mainly due to the proposed guided initializations as well as the proposed codifications and radiality rules.
The proposed method is also compared to existing works in the literature as tabulated in Table 5.The proposed twostage FA found the same optimal solution as FWA [36] and the HSA [33].However, the STD of the proposed method is smaller than the one found by the FWA and the HSA.In addition, the reduction in average power loss using the proposed method is higher than FWA and HSA methods.It should also be highlighted that the proposed two-stage FA produced a better solution compared to the best solution produced by the Modified Tabu Search (MTS) [38], EPSO [34] and HDM [16].Based on the results of the 33-bus and 118-bus, it can be concluded that the proposed two-stage FA method outperformed the single-stage conventional methods in terms of the final voltage profile, computational time, the best, the average, the worst and the overall STD of the system power loss.In addition, the proposed method found the same or better solution than the reported works, that used single-stage or two-stage methods, since it has a smaller STD and better average power loss.

VIII. CONCLUSION
This paper proposes a two-stage methodology to find the optimal NR solution in fast computational time with high consistency.The objective of this study is to minimize the network power loss and improve the voltage profile of the system.The effectiveness of the proposed method was investigated on 33-bus and 118-bus EDNs and the results were compared to the conventional EP, PSO, and FA as well as the other recent works.In the 33-bus, the proposed method managed to find the optimal open switches configuration of (7,9,14,28,32) which leads to power loss reduction by 33.65% and minimum voltage enhancement.In addition, the proposed two-stage FA method has the lowest power loss STD of 0.101, compared to conventional EP, conventional PSO, conventional FA, HSA, and FWA.Moreover, the results show that the proposed method is 56, 21 and 34 fasters than the conventional EP, PSO, and FA, respectively.Similar to the 33-bus case, the proposed method in the 118-bus case outperformed the other conventional methods in obtaining the optimal configuration, maintaining the consistency of the solution and reducing the computational time.The proposed FIGURE 10.Pseudo code of the approach for finding the SNG.VOLUME 8, 2020 two-stage FA is 38, 23 and 28 fasters than the conventional EP, PSO, and FA.The superiority of the proposed method over the conventional ones is due to the proper population's initializations and the codifications through the proposed SNG approach.

6 )
The series of the successive switches that connect two fundamental nodes without passing through any other fundamental node is called a path.The path that contains normally open switch is called normally open path.Only one normally open switch can be found in the normally open path.The other paths are called the normally closed paths.Each fundamental node has at least 3 paths connected to it.The fundamental nodes and the paths form the SNG.7) The SNG consists of the fundamental nodes joint

FIGURE 3 .
FIGURE 3. Flowchart of the proposed method.

FIGURE 4 .
FIGURE 4. Schemes of the 33-bus EDN and SNG.(a) The EDN (b) The SNG.

FIGURE 6 .
FIGURE 6.Time consumption in the conventional FA method.

FIGURE 7 .
FIGURE 7. Time consumption in the two-stage FA method.
Fig 6 summarizes the

TABLE 3 .
Comparison of simulation results of 33-bus.

TABLE 5 .
Comparison of simulation results of 118-bus.