Application of the Graph Theory in Managing Power Flows in Future Electric Networks

Electrical power system is one of the largest and most crucial engineering systems which spreads everywhere in countries to supply electricity for hundreds of millions of consumers from hundreds of thousands of producers. In its more than one century history, the development of the power system proceeded through evolutional stages from local isolated networks with small-scale load and generation to large interconnected networks with myriads of consumers vertically fed by centralized generation, such as coal, hydro, or nuclear power plants. System stability and reliability have been continuously improved along this development of the power systems.


Introduction
Electrical power system is one of the largest and most crucial engineering systems which spreads everywhere in countries to supply electricity for hundreds of millions of consumers from hundreds of thousands of producers.In its more than one century history, the development of the power system proceeded through evolutional stages from local isolated networks with small-scale load and generation to large interconnected networks with myriads of consumers vertically fed by centralized generation, such as coal, hydro, or nuclear power plants.System stability and reliability have been continuously improved along this development of the power systems.
Nowadays, the society not only demands a high level of reliability of electricity supply but also concerns with the environmental impacts from the electrical power system.To achieve a reliable and sustainable electricity supply, there is an increasing need to use energy from renewable sources such as wind, solar, or biomass.The development of many intermittent and inverter-connected Renewable Energy Sources (RES) will require having new ways of planning, operating, and managing the entire process.In other words, the power system is moving into a new development era.
Due to the expected large-scale deployment of distributed generation (DG), the electrical power system is changing gradually from a vertically controlled and operated structure to a horizontally one.Fig. 1 illustrates one of the expected changes in the power system with the large penetration of DG.The integration of RES related to both large-scale production (e.g., wind and solar farms) and massively distributed production (e.g., micro combined heat and power plants and photovoltaic systems at residential and tertiary buildings) causes a number of challenges in fluctuating/unpredictable and bidirectional power flows in distribution networks.Future electrical power systems must be able to manage these bidirectional power flows, and has to deal with the uncertainties of renewable power generation.Power flow management will be needed in order to cope with these challenges.In this chapter, applications of the graph theory to handle the function of power flow management will be introduced.Detail descriptions of these methods can be found in (Nguyen et al., 2010(a); Nguyen et al., 2010(b)).

Power flow management
The use of the Optimal Power Flow (OPF) framework is a common practice for managing power flow within the electric transmission network, where the algorithm is centralized and deployed at the economic dispatch stage (Huneault & Galiana, 1991).The mathematical model of the OPF problem can be presented as follows: subject to: where ( , ) is the objective function that can be formulated to represent different operational goals, e.g., minimization of total power production cost or total power loss.The vector of independent variables u represents the state of the system, i.e., the phase angles and voltage magnitudes.The vector of dependent variables x represents the control variables, for example, power generations or tap ratios of On-Load Tap Changer (OLTC) of transformers.The equality constraint represents the power balance between supply and demand while the inequality constraint shows the operational limits of the network components.
The OPF requires a large-scale control overview of the whole network that is difficult to implement in the future situation with high penetrations of DG units.Although some distributed OPF techniques have been proposed, they need complex input information and take relatively long processing times (Kim & Baldick, 2000).Along with OPF, stability constraints and congestion problems can implicitly be investigated (Gan et al., 2000;Bompard et al., 2003).However, those procedures are most suitable for the transmission networks which have a limited number of network components, e.g., generators, transmission lines, and substations.
Since the electric networks of the future are expected to include numerous DGs dispersed over wide areas, other solutions for power flow management must be founded.A pricebased control method, which can also be considered as a distributed OPF solution, has been proposed for systems with high level of DG penetration (Jokic, 2007).By converting the power system parameters into desired market signals, the solution yields nodal prices for generators that help to mitigate the network congestion problem and also contribute to other so called ancillary services.This can be presented in a mathematical model as follows: subject to: where ( , , , ) is the aggregated cost function of an autonoumous network part i; P i and A i are the generated power and the provided ancillary service respectively in the network i, and and present the generation and services coming from outside of the network i; the equality constraint represents for power balance; the upper bound condition denotes requirements of ancillary services while the lower bound condition shows the operational limits of network components.
The method, however, concerns only the supply and demand of the system in which actors can be influenced by price signals.Other controllable devices of the system, e.g., electronicbased power flow controllers, are not considered.In (Dolan et al., 2009), the power flow management is represented as constraint satisfaction.Algorithms in that research determine the level of DG curtailment because of loading constraints in a small test network.Based on a local information network, a distributed two-level control scheme was proposed to adjust power output from clusters of photovoltaic (PV) generators when disturbances occur (Xin et al., 2011).

Power routing -A new way for power flow management
The function of distributed power routing is to fully exploit the potential of the local resources in managing the power flow.The function deals with transport optimization related to the actual load and generation schedules of the market parties.Price signals yielded by the market clearing conditions can be used as an input for the routing algorithms to achieve certain operational objectives, e.g., relief of network congestion, maximization of the reliability of the network, minimization of losses and if desired minimization of the production cost and maximization of serving high-priority customers.
In this section, the function of distributed power routing is proposed for the future electric network as a new way to manage power flows.Basically, the function of power routing is the same as the optimization of the power flow which can be formulated in a mathematical model as follows: subject to: where The objective function (8) is the total cost for re-routing power when a disturbance occurs in the system.As the power routing function might change power generation at each bus i ( , ), power flow through each network device i-j ( , ), and demand at each bus k ( , ) different from the original market clearing conditions ( , , ), the objective function takes these representative costs into account.Due to the fact that most of the renewable generation can participate only in down regulation (with cost ), integration of storage devices becomes important to give the power routing function flexibility in up regulation (with cost ) of generation.Power flow change on network devices influences the total power losses and reliability of the system.However, the associated transmission costs ( , ) as considered to be low compared to the other costs.Since the demand side becomes more active with mechanisms of Demand Side Management (DSM) and Demand Response (DR), its potential in regulating demand up (with cost ) and down (with cost ) are considered in the objective function.
The power balance condition is represented in the equality constraint (9).The inequality constraints in ( 10) and ( 11) show the generation and consumption boundaries.The transmitted power needs to be within the device's thermal limits in the inequality constraint ( 12).This optimization model assumes that voltage is autonomously controlled and reactive power is not considered in the formulation.

Graph-based algorithms
Graph theory has been utilized in some power system applications, such as wholesale crossborder trading by using a shortest path algorithm (Wei et al., 2001), and achieving maximum power transmission with FACTS devices (Armbruster et al., 2005).This section will focus on solving minimum cost flow problem by using successive shortest path and scaling cost-relabel algorithm.
The power system, firstly, is converted to a graph ( , ), where V represents the set of vertices (buses in the network) and E represents arcs (interconnection lines among buses in the network).The arc length (arc cost) c ij and residual (available) capacity r ij associated with each arc (i, j) are derived from the transmission costs ( , ) and the transmission line capacity . Two additional vertices are then added to trigger algorithms: a virtual source node s and a sink node t.For each bus i with generation, a pair of arcs is connected to the source node s with residual capacities equivalent to generation capacities ( , ) and arc costs equivalent to generation costs ( , ).For each bus k with load demand, a pair of arcs is connected to the sink node t with residual capacities equivalent to the bounds of power demand , and arc costs equivalent to demand costs ( , ).
Fig. 2 shows an example of a 3-bus system and its representative directed graph.It is assumed in this example that there is no difference between costs for up and down power regulation and flow.Values of parameters of the system are given in table 1. Table 1.Data for the 3-bus test network By representing the electric network as a directed graph, the function of power flow management can be considered as a minimum cost flow problem.In this chapter, the Successive Shortest Path (SSP) and the Scaling Push-Relabel (SPR) algorithm are used to solve the minimum cost flow.

Successive Shortest Path algorithm
Successive Shortest Path (SSP) is one of the basic algorithms to deal with the minimum cost flow problem in graph theory.The algorithm starts by searching for the shortest path to augment the flow from the source node s to the sink node t.A node potential, ≥ − ; ∀( , ) ∈ , associated with each node and a reduced cost, = − + , associated with each arc (i, j) are used to find the shortest path.After augmenting the flow and updating the information, the process is repeated until there is no possible path anymore from s to t.
Regarding the above example of the 3-bus network, SSP initially finds the shortest path to be s-2-3-t, as shown in Fig. 3.The flow along this shortest path is augmented until the rated capacity of arc 2-3 (5 MW) is reached.When the information is updated, the algorithm searches again for a new shortest path s-2-1-t.The algorithm includes two main processes: cost scaling and push-relabel.The cost scaling step determines a boundary for the ε-optimal condition in which the scaling factor ε is initially set at the maximum cost of the graph.The boundary will gradually approach the optimal solution by scaling ε ⟵ ε/2 after each iterative loop.Within the procedure of cost scaling, the push-relabel step is used.This step aims to push as much excess flow e as possible from a higher node to a lower node.The height of each node is computed from the node potential π i .Since there is an excess in node i ( > 0) while it is lower than its neighbors, the node will be relabeled ( = + /2) to be higher than at least one neighbor node to push the excess.
In Fig. 4, the push-relabel procedure is illustrated by displaying the first steps of the SPR algorithm in the above example of the 3-bus network.As the source node s is the first active node, it will be relabelled before it pushes flows down to node 1 and 2. When there is no excess at node s anymore, node 2 as the next active node initiates the push-relabel procedure.However, it needs to be relabeled to be higher than at least one neighbor.After relabeling, node 2 can push flow to nodes 1 and 3. A similar step occurs at node 1. Fig. 4. Illustration of the push-relabel procedure for the 3-bus network

Decentralized and self-healing extensions of SPR
This section presents an extension of the SPR algorithm.In particular, we show that it is possible to implement the SPR method in a distributed way by using only local information and coordination (in contrast to the widely used centralized methods).This property of the algorithm has the additional benefit of allowing the grid operation to recover/react autonomously and faster from changes in demand/supply, cost or capacity.Note that the implementation used in the remaining of this chapter has certain centralized characteristics, since it was used for the comparison between SPR and SSP.
The SPR algorithm described above consists of two main phases: an initial phase to calculate feasible flows and a subsequent phase to convert the initial flow into a minimum cost flow (refinements).It is identified in (Goldberg & Tarjan, 1988) a variety of methods (centralized, parallel or distributed) which can be used in these two phases.Specifically for the refinement phase, a completely distributed Goldberg Tarjan (DGT) scheme that uses the concept of blocking flows and travelling atoms has been developed in (Goldberg & Tarjan, 1989).A flow is called blocking when every path from source to destination contains at least one saturated arc, while an atom at some point in time is defined as a maximal quantity of excess that has travelled as a whole up to that point.The DGT refinement scheme starts with an initialization phase, where the arcs leaving the source are saturated with atoms, and pushes atoms forward until no more pushes are possible.
Lemma 1: The DGT refinement scheme converges under the presence of changes in demand/supply of nodes or capacity of arcs, within (n) steps after the last change occurs.
Proof: Changes in the demand/supply of nodes affects the initial saturation of the outgoing arcs of the source and load content of nodes, and as a result more atoms are being created at the source or fewer atoms are being accepted at the destination.In the first case, the new atoms are being propagated forward and the algorithm proceeds normally.In the second case, the nodes at the destination become blocked and some atoms are being returned backwards, again resuming the normal operation of the algorithm.In addition, changes in the capacity of arcs affect their residual capacities.As a result, increased (decreased) residual capacity in an arc may unblock (block) the end-node closer to the source.In both cases, the algorithm resumes its normal course, sending atoms forward or backward accordingly.
Since the normal operation of the DGT algorithm is resumed after the last change, in the worst case it will terminate in the same number of steps, which is (n) for the distributed case.
Using the above refinement scheme along with a distributed maximum flow (DMF) algorithm that can tolerate changes in node demand/supply and arc capacities as proposed in (Ghosh et al., 1995) for the initial phase, it is easy to see that the resulting has certain self-healing properties since it can tolerate these changes.
Theorem 1: Consider a minimum cost flow algorithm that consists of an initial phase of a feasible flow calculation using the DMF algorithm and subsequent refinement phases using the DGT algorithm.This algorithm can be implemented in a completely distributed way and can converge under the presence of changes in demand/supply of nodes or capacity of arcs, within a certain number of steps after the last change occurs.
Note that the initial and refinement phases must be separated in order to tolerate changes, thus some form of synchronization between nodes is required.This is discussed in (Goldberg & Tarjan, 1988) since it is also a challenge for the original algorithm, and the proposed termination conditions there can also be applied here.Note also that the amount of steps needed for the algorithm to converge under the presence of changes depends on the implementation of this synchronization.

Complexity of the algorithms
Though the SSP algorithm is straightforward to be implemented, its computational complexity is ( ) (Ahuja et al., 1993), where n is the number of the network nodes, m is the number of network arcs and B is the upper bound on the largest supply (demand) of any node.In the worst case, each augmentation phase carries a very small amount of flow, resulting in a fairly large number of iterations.A modification of the scaling algorithm can reduce the number of iterations to ( ).
The SPR algorithm can be implemented in a variety of methods (centralized, parallel or distributed) for both the initial and subsequent refinement phases.The scheme followed in this chapter for both phases is distributed with centralized characteristics, i.e., all active nodes are kept in set S, which is passed from node to node and controls the activation sequence.This corresponds to a sequential variant of the algorithm, which yields ( ) convergence time, where C is the maximum cost of an arc (Ahuja et al., 1993).However, other distributed variants are also possible, and the previously mentioned refinement scheme based on blocking flows and travelling atoms achieves ( , ) total convergence time (Goldberg & Tarjan, 1988).

Agent-based implementation
For the power routing function it is important to implement the graph-based algorithms in a distributed environment.This section introduces Multi-Agent System (MAS) as a suitable platform for that because it can facilitate distributed control and perform monitoring functions in the power system.

Multi-agent system technology
Agent-oriented programming is a relatively new technique to implement artificial intelligence into distributed system operation (Ahuja et al., 1993).An agent can be created by a short program (software entity) to operate autonomously with its environment.Moreover, the agent can interact with each other to form a Multi-Agent System.With characteristics of reactivity, proactiveness, and social ability, the MAS technology can offer numerous benefits in distributed power networks.
Actually, a part of the agent's features has been revealed in some applications of the power system before.As an example, an Intelligent Electronic Device (IED) performs various control and protection functions according to changes in their environment, e.g., voltage drop and current increase.Recently, applications of MAS in power systems have been explored in many aspects such as disturbance diagnosis, restoration, protection, and power flow and voltage control.Several research projects have begun to investigate MAS as an approach to manage distributed generation, virtual power plants and micro grids.

Algorithm implementation
To utilize the discussed graph-based algorithms in the power routing function, it is assumed that agents are available representing nodes (buses) of an active distribution network (ADN).Each agent A i can obtain current state variables of bus i from the power network such as power flow in incoming (outgoing) feeders with ∀( , ) ∈ , power generation , and load demand .The limits of power generation, transport, and load demands can be pre-defined or updated during a communication period of .In addition, is provided with information about the costs for adjusting power production ( , ), consumption ( , ) as well as transmission costs , .Besides managing autonomous control actions, can route messages to communicate with same-level agents via the MAS platform.Two additional agents, and , are created to represent the source node and the sink node of the graph ( , ) respectively.By using the MAS platform, the SSP and SPR algorithms can be implemented in a distributed environment.

Implementation of the SSP algorithm
Fig. 5 illustrates a simplified agent sequence diagram for the above example of the 3-bus network using the SSP algorithm.There are three main types of actions, which are defined for each agent as follows:


Update information: Node agents (A 1 , A 2 , and A 3 ) update information from the power network and market conditions.By using Information() messages, they share the information with agents A s and A t .
 Update node potential: After updating information, A s initiates to an update of the node potential.A message of Get_label() is sent to its neighbors (A 1 , A 2 ).When receiving the Get_label() command, a node agent compares the proposal with its node potential to get the cheapest (smallest) one and its predecessor.The shortest path is determined when A t updates its node potential. Augmentation: A t starts augmenting flow along the new shortest path.An Augment_flow() message is sent from node agent to its predecessor which is to track back the shortest path.When A s receives the message, it begins looking for a new shortest path by repeating the above action of updating node potentials.

Implementation of the SPR algorithm
A simplified agent sequence diagram for deploying the SPR algorithm is shown in Fig. 6.Main types of actions for each agent are described as follows:  Update information: The procedure is similar to the case of the SSP algorithm.A slight difference is the information that A s uses for initiating the SPR algorithm.It is the total generated power instead of total load demand, as in the SSP algorithm.


Cost scaling: The scaling factor ε is initial set by the maximum value of the costs updated from the power network.When the function Cost_Scaling() is called, it transformers ε-optimal flow into a 1 2 -optimal flow. Relabel node potential: The relabel phase is called by each agent when it has flow excess and its height is lower than its neighbors.The function adds a value of 1 2 to the height.
 Push flow: When the node agent finds a feasible neighbor in which to push flow, it increases as much as possible the power with respect to its flow excess and the connecting arc's residual capacity.
Fig. 6.A simplified agent sequence diagram for deploying the SPR algorithm

Simulation results and discussions
This section investigates the performance of the power routing function of the two algorithms in the simulation cases.The power network is simulated in MATLAB/Simulink environment while Java Agent Development Framework (JADE) (Telecom Italia S.p.A., 2010) is used for creating a Multi-Agent System (MAS) platform.The protocol for communication between two environments is based on client/server socket communication.

Typical radial distribution network
A simulation example is implemented to investigate the performances of the algorithms on a typical radial medium voltage (MV) network.This test network includes two feeders with 10 buses on each feeder, connected to the same substation.The two ends of the feeders can be connected through a normally open point (NOP).Parameters of the test network are given as follows:  Line section: π-equivalent circuit, line section parameters: = 0.25 + 0.178 Ω; = 1 ; = 10 MW.


Base load: Each bus has a base load of 1 MW + 0.48 MVAr.


Distributed generation: DG units are available at bus 1, 3, and 5 of feeder 1 and 16, 18, and 20 of feeder 2. The simulation starts with an initial state as shown in table 2. The three DG units of feeder 1 provide more power than the ones connected to feeder 2, but with higher marginal costs.Table 2. Initial state of the radial test network At = 5 , each agent starts collecting and sharing information across the MAS platform.At = 10 , new reference values are set for the DG units.The goal in this case is to minimize generation cost.Fig. 8 shows the behaviour of the DG units before and after receiving new set points from MAS using the SPR algorithm.In this case, P gen2 and P gen3 increases from 3 MW to 4 MW and 10 MW respectively, while the other generators of feeder 2 increases from 2 MW to 3 MW.These controls are implemented to avoid the most expensive generation from bus 1 (P gen1 = 0 MW).
The total saving cost in money-based unit before and after utilizing the power routing function is also shown in Fig. 8.A major part of the total cost (76.97p.u.) is saved from changes of power generation mentioned above while the contribution from the power transmission on the total cost is 4.02 p.u.
The SSP algorithm gives almost the same results as the SPR algorithm.Minor differences are the set points for P gen2 set to 4.3 MW and P gen3 set to 9.7 MW.These come from the fact that SSP is based on the total load demand which is smaller than the total generation capacity used in the SPR algorithm.
(a) (b) Fig. 8. Case of optimal generation dispatch for the radial test network using the SPR algorithm

Case 2 -Load demand increases
After settling at this new optimal operation mode, the simulation is continued by increasing the demand by 2 MW + 0.2 MVAr at bus 2, 4, 17, and 19.Fig. 9 shows the dynamic operations of the test network.At = 1 , the load demand increases 20%.It is assumed that the generator at bus 1 will be responsible for the primary control to compensate initially for the amount of load increase.After receiving information from the power network at = 15 , MAS gives back the new set points at = 30 .Because of the increase in demand, all generators at bus 3, 5, 16, 18, and 20 operate at their maximum capacities while the generator at bus 1 is set to 2 MW.
In this case, the total saving cost is referred to the cost value before applying the power routing function, in period from 25 s to 30 s.Therefore, the prior state of the system with lower load demand has a lower operating cost (with high total saving cost, 120 p.u.).This saving cost starts decreasing when the primary control of the generator at bus 1 imitates.In this case, a contingency is considered where line section 5-6 is taken out of service.To supply power to the rest of feeder 1, the NOP will be closed.The new configuration of the network is shown in Fig. 10.Stand-by storages are enabled at bus 16, 18 and 20 which increases their capacities up to 5 MW, 7 MW and 9 MW respectively.Fig. 10.Representative directed graph for the new configuration of the radial test network Fig. 11 shows the changes of power generation and power flow, as well as the total operating cost in this case.In feeder 2, the power generation at bus 16, 18, and 20 are increased to their new maximum capacity (5 MW, 7 MW, and 9 MW).While is constant, and are decreased to limit the exchanged flow below 10 MW.The total saving cost in this case has relatively equal contributions from the power generation and power transmission, 48.62 p.u. and 48.59 p.u. respectively.

Conclusion
This chapter has presented an application of the graph theory in power systems for the function of power routing.The performance of the power routing function using Successive Shortest Path (SSP) and Scaling Push Relabel (SPR) algorithms are investigated on a simulation of a radial network.Simulation results show that the algorithm has selfstabilizing and self-healing properties in response to changes in the cost and capacity for power demand/supply.Simulations reveal also the ability of the power routing function to deal with issues of network variations and constraints.Moreover, the function can be implemented in an online, real-time environment which is emerging in the development of the future power systems.

References
Fig. 1.Past and future situation of the power system

Fig. 3 .
Fig. 3. Illustration of the successive shortest path algorithm for the 3-bus network 4.2 Scaling Push-Relabel algorithm Scaling Push-Relabel (SPR) belongs to the set of the polynomial-time algorithms to solve the minimum cost flow problem in complex networks.It is different from capacity scaling which is a scaled version of the SSP algorithm.

Fig. 5 .
Fig. 5.A simplified agent sequence diagram for deploying the SSP algorithm

Fig. 7
Fig.7shows a single-line diagram and the representative directed graph of the radial test network.In the representative graph, the square symbols show nodes having DG units which are connected to the virtual source node s.The remaining nodes have only load demand.

Fig. 9 .
Fig. 9. Case of load demand increases for the radial test network using the SPR algorithm 6.1.3Case 3 -Network configuration change