Distribution Network Reconﬁguration Applied to Multiple Faulty Branches Based on Spanning Tree and Genetic Algorithms

: The distribution network is the most exposed part of the electrical power system relative to different abnormal events; therefore, it reports the highest occurrence rates in terms of electrical and mechanical failures. The present project describes a strategy for restoring faulty areas after the occurrence of an abnormal event causing an outage; consequently, the proposed algorithm is not only focused on the maximization of the connected loads but also deals with the minimization of the switching operations by considering technical operational constraints. The remarked study has two stages: The ﬁrst one ﬁnds an initial set of tie-line candidates using the spanning tree technique, while the second stage applies a genetic algorithm to determine the optimal solution considering all the constraints. Three cases studies have been used to test the proposed algorithm, then the simulation and results of IEEE 13, 37 and 94 node feeders depict the effectiveness of the restoration strategy.


Introduction
The distribution network is considered the last part of the electrical power systems because it distributes the energy to the end users, and the distribution network usually operates in radial topology in order to reduce costs and to simplify the system operation as is presented on Figure 1. Nevertheless, the occurrence of a failure on this single path will result on a complete loss of supply, affecting the customers directly [1]. Consequently, distribution systems are planned and constructed by considering tie switches in the open position, which are located in predefined points on the network, to transfer interrupted customers onto another feeder [2]. Although distribution systems are designed to have the minimum outages, the irregular nature of abnormal events such as lighting discharges, natural disasters and human errors could cause a service interruption. For example, the state of Texas had power outages for 14 days because of hurricane Harvey [3] during the hurricane season of U.S. in 2017. In fact, 80% of power outages on the power system are present in the distribution network [1]. Consequently, new strategies have been developed to improve the quality of power supply and to guarantee service to customers.
Set in this context, network reconfiguration is a common strategy not only used to restore an out of service area after an outage but also used to achieve different objectives, such as load balancing on primary feeders and power losses reduction [4]. The network reconfiguration is focused in the modification of the network topology by the change of the state of tie-points maintaining the radiality of the network. Consequently, this objective is achieved only if the distribution networks have additional tie-lines; thus, network operators could isolate the faulty line and redirect power flow to the healthy grid, re-establishing the service [5]. Traditional network contemplates experienced crews in order to develop a network reconfiguration; however, the process is not optimum and is also deficient. The development of smart grids and the integration of advanced communication systems offer the possibility of operating the switches remotely. This feature allows the automation of network reconfiguration processes in order to produce a rapid and optimal solution. As a result, the distribution network will have a self-healing capacity and will become more reliable and resilient [6,7]. Network reconfiguration methodologies have been studied by considering the different aspects as shown in Table 1. Several authors have defined the reconfiguration network as a combinatorial and nonlinear problem of optimization with different constraints such as the operational limits of voltage, current and power; subsequently, researchers have performed several strategies relative to this nonlinear problem with different approaches. Kavacki et al. proposed a loss minimization problem solved with mathematical optimization methods [4]. A similar solution is proposed in [8] by considering the time-varying demand over a period of time. Rider et al. [9] included reliability index constraints, and Poudel et al. [10] researched service restoration by considering operational constraints based on a graph-theoretic framework. These research studies use variations of mixed integer linear programming to solve the optimization problem. Mathematical programming permits obtaining an optimal solution; however, a feasible disadvantage is observed due to the complexity involved in restoring large systems. The aforementioned aspect is the reason why several studies have been developed by considering other flexible techniques.
Heuristic methods are utilized to find an approximation to the optimal solution by using learning and intelligence strategies [8]. Techniques based on graph theory are developed in [11], and the authors used spanning trees to maximize the load restored after an outage. Similar strategies are used in [12], where a black-start capacity was considered by using the distribution system. Dimitrijevic et al. in [13] included the operational cost of switch operations. Another type of heuristics methodology based on natural process has been studied in [14]. Additionally, the research proposed the use of genetic algorithms for solving active loss reduction through network reconfiguration [15], while in [16] the solution of a similar problem was achieved by using the Harmony Search methodology. In addition, algorithms based on artificial intelligence were performed in [17].  [11] Maximization of load Minimum Spanning Tree (MST) Operational limits restored [12] Maximization of load Graph Theory Operational limits restored Black-start capacity [13] Minimization of the Minimum Spanning Tree (MST) Operational limits the undelivered load [15] Maximization of system Genetic Algorithms (GA) ANAIS, ENSS reliability SAIDI, SAIFI [16] Minimization of the Harmony Search Algorithm Operational limits total cost of the grid [17] Minimization of power Fuzzy Firefly Algorithm Operational limits losses Balancing index This paper is organized as follows. Section 2 depicts concepts, methodologies and techniques, whilst the distribution restoration algorithm is provided in Section 3. Section 4 shows the simulation and results of the proposed algorithm and the communication that occurs peer to peer between MATLAB and PowerFactory. Finally, the conclusions are stated in Section 5.

Electrical Networks and Conceptualization
Not only transmission grids but also distribution networks have evolved from conventional networks constituted mainly of radial to loop and mesh grids. Consequently, novel equipment and electrical devices have been implemented in modern grids to meet technical requirements such as quality of supply, reliability and safety.

Electrical Distribution Network
Electrical distribution networks are designed and constructed with radial, loop or mesh topology based on fundamental aspects such as type of load, level priority of the customers (hospital, military institutions and government buildings) and reserve capability. The majority of power distribution networks in North and South America are based on radial topology where it is only one path to connect customers to the main grid. The predominance of this kind of network is not only related with its simplicity during planning, design and operation stages, but it is also associated with its low planing expenditure and low investment cost. Figure 1 shows a radial system, which presents a simplicity of analysis because electrical parameters such as voltage, currents and loading can be determined based on straightforward calculations while minimizing computer resources [18,19]. On the other hand, a failure on this single path will result in a complete loss of supply; for this reason, radial systems are planned and constructed by considering tie switches in the open position, which are located in a predefined point on the network, to transfer interrupted customers onto another feeder while maintaining the radiality of the network.
A loop network is specially designed and constructed by European utilities; the electric network can be operated in both operating conditions, radial or closed loop, due to the fact that the rating of the equipment is selected to be able to take the total load without overloading. Figure 2 depicts a loop system, which is installed in distribution and transmission networks due its reliability. As a result, electricity can be transported from two sides towards the middle point; subsequently, control and protection tasks are slightly more sophisticated than radial networks. A faulty segment of a network can be isolated by circuit breakers or disconnectors by reducing the interrupted area [2,18,19]. In contrast to radial networks, loop systems not only are more expensive but are also more complex in terms of design because electrical components are selected by considering higher capacities than compared to a more reliable, high quality and secure network that can be constructed to provide electricity to end users.  A more complex and well designed topology on distribution systems is a mesh network; aspects such as security, high quality and reliability are met due to the fact that if any event or fault occurs in one segment of the network, the network is capable in providing continuity of service based on multiple paths in order to transport electricity to end customers. Figure 3 highlights a grid mesh on georeferenced distribution networks [18,20].
Populated areas and financial districts are characterized by higher load density, where maintenance and repair tasks are difficult to develop due to congestion and traffic. Hence, underground and meshed networks are needed in order to connect service transformers to the main grid. Under these considerations, meshed networks present more advantages than other kinds of networks because they keep a stable voltage profile, which means a minimal difference between the voltage at distribution substation and voltage at distribution transformers, which are known as service transformers as well. Furthermore, an increased level of flexibility during contingencies due to its control and protection systems permits operating circuit breakers to isolate faults. On the other hand, a meshed network implies a heavy investment and also a much more complicated and complex network to assess due to the fact that power flow, fault analysis and protection coordination should be performed using specialized software.

Graph Theory
An abnormal event such as a short circuit or open circuit fault causes protection devices to trigger and the disconnection of lines to occur. Therefore, a sequence of switching operations for generating a new topology and for restoring energy supply is needed. For the present work, a combination of two strategies is used: The first one is carried out using spanning tree search. Thus, the graph theory method is employed to find a set of topologies. On the other hand, the second strategy is implemented with genetic algorithms to reach the optimal solution based on the set of topologies generated in the first stage, such as the initial population.
Distribution systems can be represented as a connected graph G(V, E) such that buses are a set of vertex V, lines are a set of edges E and the primary substation is the root node. The topology of the system is a spanning tree T in which all vertices are connected, and there does not exist any loop to maintain radiality [21]. A spanning tree can be formed by the following: where T 0 is the parent tree; S e (T 0 ) is the fundamental cutset; e i is an edge of the graph G(V, E); e k is an edge of the fundamental cutset S e (T 0 ).
It is possible to build new topologies by using the cycling interchange operator described in [11]. An example for better understanding of this method is presented in Figure 4. For this case, the IEEE 13 node modified test feeder [22] is analyzed by considering an event where a fault occurs between the buses two and seven. The system is represented as a graph G, the original topology without faults is the parent tree T 0 and the fault line corresponds to the edge e 2−7 . The fundamental cutset with respect to the parent tree is obtained by S e (T 0 ) = G − T 0 , which represents the tie lines. By replacing the edge e 2−7 with every element on the fundamental cutset, new spanning trees are generated. However, only the topologies that do not have loops are considered as a possible solution. In this example, the algorithm produced the tree T 1 and T 2 by changing e 2−7 with e 6−12 and e 2−7 with e 3−9 such that the following is the case.  The new topologies derived from the initial spanning tree possibly overpass the operational constraints and did not satisfy the problem's restrictions. In this scenario, the cycling interchange operator permits generating new trees by replacing one edge of the graph with edges of the cutset referred to the new parent tree. However, the number of trees and sub-trees increases in a similar proportion to the size of the distribution system. As a solution of this problem, [11,23] proposed a methodology to simplify the original graph while maintaining the characteristics of the systems by reducing the number of generated sub-trees that have similar operational characteristics. The graph simplification is based on the grade of the vertex, which is the number of edges that are connected. The rules to reduce the graph are as follows: (i) Vertices connected to tie lines and lines in which faults are forbidden to reduce; (ii) Vertices grade three or higher are maintained on the simplified graph; (iii) Vertices grade one that are connected to the feeder or loads are retained for the new graph; (iv) Vertices grade two and one are simplified.

Genetic Algorithms
The second stage is carried out using evolutionary algorithms that are used as an optimization method based on natural behavior. The evolutionary algorithms begin with a population that represents an initial set of variables. The process is executed until it reaches the optimal global solution or the maximum of the objective function [24]. Genetic algorithms are popular methodologies applied to solve optimization problems in several areas. For example, GAs are used in networking to allocate the access points; subsequently, the approach minimizes the number of devices that are permitted to connect the totality of users [25]. Another study is associated with data processing and analysis, where GAs are applied for community detection [26] in social network analysis. On the other hand, GAs have been successfully applied with power systems in order to improve tasks in fault detection and isolation on faulty sections [27]. Another application in power system is related to stability, and Keskes et al. investigated an optimal methodology to tune the parameters of power system stabilizers using GA [28]. GAs are inspired by natural genetic variation; consequently, they used a group of randomly solutions as the initial population. These candidates evolve to new populations into an iterative process until one of the individuals of the population satisfy the objective function [29].
The development of a binary genetic algorithm considers the following steps. The parameters of the problem must be coded through genes to form a chromosome that is usually represented as a binary string. The fitness function decoded the binary string to assign a value to the chromosome. This value is used to evaluate each candidate in the population and determines if the candidate satisfied the objective function. The basic operators used by the algorithm include selection, crossover and mutation. The selection chooses candidates of the population such as the possible parent based on their fitness values, while the crossover combines the binary strings of the parents in order to generate a new population. Finally, the mutation flips the value of one random bit of the string [30].

Problem Formulation
Distribution systems are usually built as a radial network because of its simplicity and cost. In addition, the operation and coordination of protective devices on a radial network are easier than loop and mesh grids [21]. Set in this context, this study focuses on finding topologies that maintain radiality by considering the distribution network reconfiguration as a multi-objective optimization problem with constraints in which the objective functions are as follows.
The are subject to the following: where S i is the apparent power consumed by load i; st sw i is the operation status of line j; V k is the voltage at bus k; V min k is the minimum voltage at bus k; V max k is the maximum voltage at bus k; I j is the current flows through line j; I min j is the minimum current flows through line j; I max j is the maximum current flows through line j; P i is the active power consumed by load i; P max f is the limit of active power at the feeder; Q i is the reactive power consumed by load i; Q max f is the limit of reactive power at the feeder; Ψ is the number of system loops; B a is the set of active buses; LT a is the set of active lines; LD a is the set of active loads.
The objective function shown in Equation (4) maximizes the load restored, and Equation (5) minimizes the number or switching operations where st sw i is a binary status that takes a value of one only if the line operates to change the topology of the system. In addition, to secure the properly operation of the distribution system, the optimization algorithm must respect the operational constraints. The constraint in Equation (6) is the voltage limit at the system buses, the constraint in Equation (7) is the limit of current that flows through the lines, the constraint in Equation (8) limits the total load to be lower than the feeder capacity and the constraint in Equation (9) indicates that the topology of the system remains radial [11,31,32].

Distribution Network Reconfiguration Process
The proposed restoration algorithm is composed of two stages: The first one is associated with the population generation; consequently, switching equipment changes its status to generate several possible interconnections. The second stage is related to a genetic algorithm to determine the best option considering the aforementioned constraints.
The optimal solution of the restoration problem is based on the genetic algorithm and MST techniques. The flow chart presented in Figure 5 corresponds to the algorithm based on spanning tree techniques, which is used to obtain the initial population to the genetic algorithm. The MST process follows the next steps: (1) Transform the distribution system to G and T 0 ; (2) Reduce the graph to its simplified form G and T 0 and identified the fault edge e i ; (3) Determine the fundamental cutset Se(To); (4) Obtain the spanning tree T i by replacing e i with one edge e k ∈ Se(To) and eliminating e k from set Se(To); (5) Save the topology T i on the population database if none have loops; (6) Proceed to step 4 and repeat the process until Se(To) is empty or the population database is complete; (7) Eliminate e i from the edge set E and take one topology from database; (8) Take one edge e i from the set E and proceed to step 3.
The second stage determines the topology that restores the out of service loads. If there is more than one solution, the topology with the minimum number of switching operations is taken as the solution. On the other hand, if there is no solution that restores the totality of electric loads; a partial restoration topology is achieved considering the maximum connected load. The genetic algorithm presented in Figure 6 is described in the following lines: (1) Obtain the graph from the distribution system, then use the spanning tree algorithm described in Figure 5 to generate the initial population of size 30 ≤ n ≤ 200 [29]. Through binary encoding, all individuals of the population are characterized with a chromosome as binary strings. Every gene is a bit that represents the state of the lines in which zero represents out of service and one represents operative line. (2) Obtain the power flow of each topology on the population. With these results, the fitness function assigns a value to each string. If the topology satisfied all the constraints, the value is equal to the sum of the apparent power of the system loads.
On the contrary, if the topology does not satisfy the constraints, the value is zero.
(3) Evaluate the fitness value of the strings based on the criteria of f o 1 that maximizes the load restored such that the individuals are ordered from the highest to lowest value of power. (4) Calculate the error between the reference and measured apparent power for the entire population. If any topology has an error >0.01, proceed to step 5. On the other hand, skip to step 9. (5) By using tournament selection with 0.5 ≤ ρ ≤ 1, this operator randomly takes two individuals. It selects the individual with the highest or lowest fitness value based on its probability index ρ. (6) Generate a new population of descendants from the group of parents through crossover with 0.5 ≤ ρ ≤ 1. In this case, a fix length string of genes is combined between the parents to produce new topologies. The new and old populations are joined temporary. (7) Based on mutation with 0.001 ≤ ρ ≤ 0.05, change the state of one random gene of the topologies on the temporary population. The gene that represents the fault line has a restriction to change its state [29].

Simulation and Results
The proposed algorithm is implemented by using a simulation environment based on MATLAB and PowerFactory. The optimization algorithm is developed in MATLAB, and the implemented program on this tool generates and analyzes different configuration of the network as a possible solution to restore the service after a fault occurrence. In this scenario, PowerFactory performs automated power flow simulations of each topology. After that, MATLAB evaluates these results as part of the fitness function and constraint verification. The communication scheme between both tools is presented on Figure 7, which represents a peer-to-peer communication scheme based on the use of Command Separate Value (CVS) files. By using these shared files, MATLAB send the configuration networks as a stream of bits that represent the open/close status of circuit breakers. This information permits the autonomous configuration of the network modeled in PowerFactory to obtain power flow by sending back the results through shared files. The synchronization between both tools is achieved by using a flag system on the shared files. As a result, total or partial network restoration is determined by considering technical constraints such as voltage and current limits.  The effectiveness of the algorithm is demonstrated in both case studies as 37-node and 94-bus distribution systems. Table 2 shows the simulation results of several scenarios for the IEEE 37 modified test feeder. The optimal solution is a set of commuted on/off operations over the lines to restore service. The evaluation point is the percentage of total load energized by the reconfiguration process after a fault occurrence and the number of switched lines (nSW). For example, on the IEEE 37 node modified test feeder, cases 1 and 2 represent events with n-1 contingencies over different lines. After network reconfiguration is reached, 100% of energized load with one switch operation is achieved. Multiple fault lines are evaluated in cases 3 and 4, obtaining a full restoration solution with 2 and 3 switch operations, respectively. On the other hand, case 5 presents an event with four fault lines in which the algorithm achieved partial restoration solution, connecting 87.65% of the load with five commuted lines. Additionally, Figure 8 shows, in more detail, the out of service areas after and before the network reconfiguration process for this scenario.
The proposed reconfiguration method is applied on the 94-node distribution network [33] shown in Figure 8. The proposed network reconfiguration method is developed to have one root node to generate the initial population of the GA. Consequently, the 11 feeders of the distribution network are bundled as one feeder that represents the root node. However, the constraints of every feeder are analyzed individually. The results of the simulations are presented on Table 2. The effectiveness of the algorithm has increased because there are multiple feeders on the network; subsequently, a full restoration is achieved in scenarios 1-4. However, a partial restoration is reached when the fault appears over the lines with no additional paths. For instance, scenario 5 evaluates the system when faults occurs over line 25-26. In this scenario, the load remains disconnected in the final solution without tie lines associated with this fault line.  The presented algorithm has been developed and executed in a laptop with Intel Xeon processor at 2.80 GHz. Network complexity is not only extremely related with computational resources for re-configuring the distribution network, but it is also the faulty branches and the available tie lines that determine the number of possible cases or topologies. The representation of the state of distribution branches is based on a binary array; consequently, large and complex distribution networks require more computational resources, and it is also not possible to execute a general optimization strategy such as brute search. As it was aforementioned, the number of generated paths affect the resources for executing the algorithm between MATLAB and PowerFactory; the computational complexity of the proposed algorithm can be represented as a big-O notation with an exponential function, O(2 n ), where n is the number of tie and fault lines [34]. Finally, a partial restoration solution is reached when it is not possible reconnect the entire load, and the maximization of load energized is limited by the number of program iterations. Another important computational resource is time; for the present work, the running time obtained in full restoration strategies for IEEE-37 network needs an average of 5 s. On the other hand, the solution for the 94-bus network is obtained around 25 s.
The compliance of operational voltage limits, which represents one of the optimization problem constraints, is depicted in Figure 9 for IEEE 13, 37 and 94 node distribution networks. The blue curve represents the voltage profile obtained after the execution of the network reconfiguration algorithm after a fault. Additionally, scenario 5 of the case study related to IEEE-37 nodes shows full restoration, which produces undervoltages in buses 28, 29, 30, 31, 32 and 33. However, an additional feasible solution considering partial restoration is evaluated, which is produced by the disconnection of the area associated with 37 bus.  Table 3 details a comparison of the restoration strategy's effectiveness obtained with the proposed algorithm and other strategies such as mixed integer liner programing (MILP) [10], mixed integer nonlinear programing (MINLP) [22] and minimum spanning tree [11]. In the first scenario, with a fault located on line 4-5, full restoration solution is determined by all algorithms, commuting line 4-8. The second scenario analyzes a fault line between 28 and 29; the proposed algorithm, References [10,11], re-established the total load, closing lines 25-37. Three switch operations are required to reach a full restoration plan in [22]. Finally, the third case study simulates two faults over lines 4-5 and 5-6. Only the proposed algorithm and [10] achieved the restoration of service in the out of service areas, determining a reconfiguration plan with two and three switch operations, respectively. The results indicate the effectiveness of the proposed algorithm for determining a reconfiguration plan after the occurrence of multiple faults with the minimum number of switch operations.

Conclusions
This paper formulates a network reconfiguration methodology to restore the out of service areas with a genetic algorithm with a non-random initial population generated by a spanning tree. As a result, it is possible to generate an optimal restoration solution with the minimum number of switch operations prioritizing the maximization of the loads restored. Furthermore, the simulation results show that the algorithm handles multiple faults such that it could be used after extreme events in which more than one contingency might present at the same time.
Additionally, the results indicate that networks with multiple feeders and many tie lines are more resilient because it is possible to restore service in the majority of the cases without breaking restrictions. In the case of the systems with one feeder, cases in which certain areas are out of service are presented. This scenario is present when there are no additional paths to reconnect the area or in cases where full restoration strategy breaks the operational limits, and load shedding is necessary.
Future research studies should consider additional constraints such as the prioritisation of critical infrastructure such as hospitals and governmental institutions. Furthermore, research can be focused on algorithms using georeferenced data of real distribution networks by using both Python and PowerFactory platforms. Future research could be aimed at developing Hardware in the Loop (HIL) simulations in order to test the control, the reconfiguration and and to test protection algorithms on distribution networks.