Hybrid Energy Routing Approach for Energy Internet

: The Energy Internet (EI) has been proposed as an evolution of the power system in order to improve its efﬁciency in terms of energy generation, transmission and consumption. It aims to make the use of renewable energy effective. Herein, the energy router has been considered the crucial element that builds the net structure between the different EI components by connecting and controlling the bidirectional power and data ﬂow. The increased use of renewable energy sources in EI has contributed to the creation of a new competitive energy trading market known as peer-to-peer energy trading, which enables each component to be part of the trading process. As a consequence, the concept of energy routing is increasingly relevant. In fact, there are three issues that need to be taken into account during the energy routing process: the subscriber matching, the energy-efﬁcient path and the transmission scheduling. In this work, we ﬁrst proposed a peer-to-peer energy trading scheme to ensure a controllable and reliable EI. Then, we introduced a new energy routing approach to address the three routing issues. A subscriber matching mechanism is designed to determine which producer/producers should be assigned for each consumer by optimizing the energy cost and transmission losses. This mechanism provides a solution for both mono and multi-source consumers. An improved ant colony optimization-based energy routing protocol was developed to determine a non-congestion minimum loss path. For the multi-source consumer case, an energy particle swarm optimization algorithm was proposed to choose a set of producers and to decide the amount of energy that should be collected from each producer to satisfy the consumer request. Finally, the performance of the proposed protocol, in terms of power losses, cost and computation time was compared to the best existing algorithms in the literature. Simulation results show the effectiveness of the proposed approach.


Introduction
Due to the increase in energy demand and price, the environmental pollution resulting from conventional energy production techniques based on fossil fuel (coil, crud oil and natural gas), the development of environmentally friendly energy known as renewable energy, such as solar, wind and tide, has become necessary and attracted a lot of attention.The integration of renewable energy in the energy system reduces the CO 2 emissions, the transmission costs of energy and the load placed on the main grid by supplying a percentage of the demand through local energy production and consumption.Transforming energy production from conventional techniques to fully rely on renewable energy sources in the energy network cannot completely guarantee energy self-balancing due to its dispersion, discontinuity and volatility properties.The generation of energy, by these renewable sources, depends on weather conditions.Thus, renewable energy sources must be connected with the utility grid and controlled using sensing capabilities with information and communication technologies which creates smart grids [1].According to National Institute of Standards and Technology (NIST), USA, the smart grid (SG) is: "A modernized grid that enables bidirectional flows of energy and uses two-way communication and control capabilities that will lead to an array of new functionalities and applications".While SG uses an intelligent and digitized network, some restrictions still remain.In the aim of developing and completing the issues of smart grids, the EI was proposed [2,3].The concept of EI, also called the Internet of energy and future smart grid, was proposed for the first time by the American economist Jeremy Rifkin in his book "The Third Industrial Revolution: How Lateral Power Is Transforming Energy, the Economy, and the World" [4], to solve the problems of existing energy systems.Jeremy Rifkin defined the EI as an energy system combined with the Internet technology in the aim of making an effective use of renewable energy, increasing the energy efficiency and the reliability of the electrical power system.EI is a complex energy system in which different energy networks are connected, such as: power grids, cooling/heating systems, natural gas networks, distributed energy generation, storage systems and loads [3].The principle of EI is based on the integration of Internet technology, renewable energy, advanced technologies such as smart monitoring, intelligent management and large data processing with the existing energy systems [5,6].The main objective of EI is to create a sustainable energy system with high energy efficiency, significant cost saving, minimum power losses and the high improvement of the use of distributed renewable energy sources (DREs).
As we mentioned before, the EI supports several forms of energy.In this paper, the energy flow is stored and distributed in the form of electrical energy.
In the conventional electrical power system, the power flow is unidirectional, generated by large scale power plant, transmitted to substations via high-voltage transmission lines and distributed to end users through low-voltage distribution lines.Accordingly, the power market is often structured in a unidirectional form, where generation companies generally sell huge amounts of electric energy to wholesale retailers, while retailers sell the electric energy to end users in smaller amounts [7,8].With the concept of feedin-tariffs (FiTs) in SG, consumers equipped with distributed renewable energy sources (DREs) referred to as prosumers-they can generate and consume electricity-are able to directly contribute in the power market by selling their excess energy to the utility grid (company) [9].Many studies have been proposed in this regard to insure the supplydemand balance in the SG and to maximize the profit of the power market.Authors in [10] proposed a Stackelberg game-theoretic approach between the utility company and various prosumers, in which the utility company acts as a leader and announces an energy price, while the prosumers act as followers and adjust their electricity consumption according to the announced price.However, the authors in [11] proposed a contract-theoritic demand response management approach that aims to maximize the profit of both utility grid and prosumers in the SG.Unfortunately, the benefit of the involved prosumers in the FiT systems has been limited, prompting researchers to determine other trading schemes to encourage prosumers to become involved in power trading [12].In contrast, EI is a peer-to-peer energy sharing system with a bidirectional flow of power and communication.The emergence of P2P distributed energy trading (sharing) in EI provides a new public energy market with new features in the power system.It enables prosumers to trade and share their excess energy (power) with each other directly in peer-to-peer mode without the interaction of a central entity such as a utility company [13].This peer-to-peer mode of energy exchange gives energy producers and consumers the opportunity to create some financial benefits by selling the excess energy (generally with a lower cost than the cost of a utility company) instead of storing it for future use, which creates some power losses.Additionally, it decreases the consumer's electricity bills and the reliance on the main grid (utility company).As far as we know, due to its complex technologies and infrastructures, there is no standardized architectural model for P2P electrical energy trading and various types of P2P distributed energy trading architectures have been designed by various studies [14][15][16][17].
The expansion of the use of DREs in power generation with their volatility, the transformation of the generation and the injection of power from centralized to distributed manner, the peer-to-peer energy sharing and the power losses during the energy transmission process make the distribution of energy and the balancing of energy supply/demand in EI more difficult.All of these variables gave rise to the key issue of the Energy Internet, which is the energy routing issue.It is known that there is some power losses during energy transmission process between producers and consumers.In order to minimize the power losses and to create efficient energy delivery over the EI, energy routing has been suggested which was inspired by data routing on the Internet.Energy routing is the process that facilitates the transmission of energy between prosumers and consumers situated in different geographic locations with the minimum power transmission losses.
The key element of EI and energy routing is the energy router (ER), which is used to route both information and energy flow [18,19].Current energy systems do not have this capability.However, energy routing in distributed energy systems is more complicated due to integration problems; because power conversion from one type to another may be needed.Energy routing has received considerable attention from the research community in recent years.Current research on this issue includes designing energy routing devices and energy routing algorithms.A number of researchers considered energy routing as data routing and therefore suggested devices and protocols for energy routing.Nonetheless, energy routing criteria are distinct from data routing (see Table 1).The waste packet can be resent in the Internet, which is not possible in EI.In addition, energy routing is demand-driven and the source of the energy is not defined [13].Furthermore, an energy overflow may cause system devices or even the whole system to crash.Therefore, energy routing has more requirements on safety and reliability than data routing.For that, energy routing protocols are the main field of research for working on EI.These energy routing algorithms need to solve three main problems: the subscriber matching problem by determining the best producer for each consumer; the efficient energy routing problem by selecting the best path with the minimum power loss between these producer-consumer pairs; and finally, scheduling these energy transmissions to prevent congestion or overflow problems.

Category of Comparison Internet Energy Internet
transmission lines is large enough.In paper [21], the authors proposed a distributed routing algorithm based on Dijkstra algorithm.This study did not investigate how the prosumerconsumer pairs are created.The authors in [22] proposed a hierarchical energy routing protocol where a master node determines all efficient paths between each pair in the grid, which affects the security and efficiency of the grid, and could cause the one point failure of the system.However, game theory has been widely used in power systems to solve different issues such as the demand response optimization problem including the work in [23] where a Stackelberg game approach was proposed in order to reduce the peak load and balance the supply-demand in the smart grid.The proposed approach determines the efficient consumption scheduling for consumers based on the real-time pricing.The authors in [24] used the reinforcement learning with the game theory and proposed an approach to solve the demand response problem in SG-in which a reinforcement learning mechanism was used to determine the best company for each consumer based on the electricity price and availability, and game theory based-demand response management technique to schedule the consumer consumption.Several game theory based-approaches [25][26][27][28] have been proposed to solve the energy routing problem in the peer-to-peer energy trading market.In these approaches, producers and consumers play a game (such us Stackelberg game, Coalition game . . .etc.) to create the producer/prosumer-consumer pairs with the maximization of their benefits.An energy routing algorithm based on an autonomous system is proposed in [29] where each system entity acts as an agent in the trading process.
Authors in [30] proposed an energy trading platform with a mixed integer programming model for the optimal sharing energy between different houses in the EI in order to create a total profit for all participant houses.This work introduced a decision-making process that allows houses to determine when they should buy or sell energy, but it did not investigate the efficient path and scheduling problems.However, the authors in [31] suggested the use of bio-inspired methods to solve the energy routing problem.They considered the energy routing problem as an optimization problem and proposed the use of Ant Colony Optimization (ACO) to solve it.The proposed protocol calculates the minimum loss path between producers and consumers using the distance with the average cost by mile.
A distributed Bee Colony Optimization (BCO)-based energy routing protocol is proposed in [32] to determine the best producer for each consumer considering the power loss, distance and available power among producers.The authors in [33] proposed an optimized energy routing method using Particle Swarm Optimization (PSO).It determined the energyefficient path between producers and consumers in the SG by considering the links' quality, transmission cost and latency in the selection of the best optimal neighbors.There are other considerations than distance to be included in the estimation of the power loss, which will be addressed in detail in the next section.Based on the previous analysis, we considered in this paper the energy routing problem with its surrounding issues (subscriber matching, efficient path and transmission scheduling) as an optimization problem.To solve this problem, we proposed an improvement of the existing energy routing method in [31].The contributions of this paper are: • A peer-to-peer energy trading architecture based on energy routers; • A subscriber matching mechanism, and an Energy Particle Swarm Optimization Algorithm (EPSOA).The proposed subscriber matching mechanism determines the consumer-producer pairs for both mono and multi-source consumer cases (normal and heavy loads).The EPSOA is used in a heavy load case to determine the amount power to buy from a set of producers to insure minimum power transmission loss and cost; • An Improved energy routing protocol based on ant colony optimization which calculates a non-congestion minimum loss path between each producer/consumer pair in the EI.
The remaining sections of the paper are organized as follows.Section 2 describes the proposed EI based on energy routers.It is modeled as a weighted graph.Section 3 introduces the subscriber matching mechanism, the energy particle swarm optimization method with the centralized peer-to-peer energy trading network.The Improved Ant Colony Optimization (IACO)-based energy routing protocol is detailed in Section 4. The performance of the proposed algorithms is evaluated by various analysis cases.It is also compared to the algorithm described in Section 5 in terms of power losses, costs and computation time.Finally, Section 7 concludes the paper.

Implementation of Energy Internet with Energy Routers
In this section, the structure of ER-based energy Internet and its graph theory representation are introduced.The concept and functions of ER are discussed.

Structure of Energy Internet with Energy Routers:
As illustrated in Figure 1, the proposed energy router-based EI in this paper consists of different passive consumers (e.g., smart homes, industrial users, buildings, EVs), distributed power generation units such as solar and wind power, distributed energy storage units, and active consumers referred to as prosumers.As mentioned earlier, a prosumer is a consumer equipped with DREs (such as solar panels, wind turbines) to generate and consume electricity.In this work, the prosumer is represented by a smart home equipped with solar panels, such as in [34].In the SG, prosumers trade their surplus energy with the utility grid for a small feed-in-tariff rate, which is not the only trading option in the EI.As mentioned earlier, the EI is a peer-to-peer energy sharing system that enables passive consumers equipped with distributed energy sources to trade directly and share energy with each other without the interaction of the utility grid.This creates some benefits for prosumers, consumers and the utility grid.All these elements are connected to a net structure using power lines and energy routers.In our system, we consider that the grid used is a three-phase electrical grid characterized by the composed voltage V = 400 v, and the frequency of 50 Hz.The apparent power requested by the consumer is: where P represents the active power (P = √ 3 × V × I × cos(φ)) and Q is the reactive power (Q = √ 3 × V × I × sin(φ)) with I, cos(φ) represents the line current and the power factor, respectively.In general cos(φ) > 0.95, and as a result, the reactive power becomes negligible, and the apparent power is approximately equal to the active power (S Apparent P).
The producer produces power that is an active power since the energy router (converters) do not inject reactive power into the grid.
In the aim of creating an efficient, scheduled, stable and controlled peer-to-peer energy trading market, we propose a centralized peer-to-peer energy trading architecture that contains a principal actor, named the broker.This broker manages the energy market and adjusts to balance the supply and demand in the energy system by satisfying consumers requests without the need of adding new energy generation units.The broker's role will be discussed in detail in the following section.
Using graph theory, the proposed EI is modeled as a weighted graph G = {V, E, W} as shown in Figure 2.

•
Energy routers are represented by a set of vertices V = {v 1 , v 2 , . . ., v n }; where w e ij is the weight of the edge e ij , which represents the power loss of the power line that connects routers v i and v j .While w v i is the weight of ER v i , which represents its power loss.Both weights of power lines and energy routers are determined by Equations ( 15), ( 18) and ( 19) as shown in Section 5.

Energy Router Architecture and Functions
ER is regarded as the primary networking unit for the implementation of the EI.It is proposed to achieve a better utilization of renewable energy sources, with an efficient transmission of energy flows.The ER has comprehensive functions such as an energy exchange, communication and energy management [35].The study of ERs is in its preliminary stage at present, and various researchers have suggested different ER designs, such as the works in [20,[35][36][37].The common functionalities between the different suggested designs are: the integration of renewable energy sources; the control of power and communication flows; and the regulation of power quality and voltage/frequency conversion.
The first design of ER was based on solid-state transformers (SSTs) and proposed by The Future Renewable Electric Energy Delivery and Management (FREEDM) [38].As shown in Figure 3, the SST-based ER is composed of an energy management module and power electronic conversion module SST [6,37].First, the energy management modules can realize the communication, power routing and management using power flow, while the power electronic conversion module (SST) can convert multiple energy forms and voltage levels, as well as compensate for reactive power.It has a three-stage topology: the high-voltage AC/DC stage, the middle DC/DC stage and the low-voltage DC/AC inverter stage.The high-voltage AC/DC stage rectifies the power frequency from High Voltage Alternating Current (HVAC) to Medium Voltage Direct Current (MVDC), the bidirectional middle DC/DC stage transforms the the MVDC to a regulated Low Voltage Direct Current (LVDC), while the low-voltage DC/AC inverters generate a LVAC.The SST provides multiple plug-and-play interfaces that allow loads, storage systems, renewable energy, micro-grids (MGs), utility grid and other ERs to be connected.Every interface can connect various energy systems or devices, provided that the total power connected to the interface does not surpass its capacity limits.Using ER controlled by information can improve the efficiency of energy transmission and energy allocation.For an efficient energy management, these ERs need to be equipped with efficient dynamic energy routing protocols to respond to changes in energy information, system topology and the regular connection/disconnection of the system devices.For this, in our proposed network architecture, we assume that every ER broadcasts its energy information, its connections (ERs, devices and power links) with their energy information to all other ERs in the system.Whenever the system topology or energy information change, the connected ER broadcasts this information to all the others.Thus, each ER accumulates all the necessary energy information and topology of power system and stores them in two different energy information tables, as shown in Tables 2 and 3.These tables represent the energy information of the proposed EI in Figure 1 where e f f represents the power conversion efficiency of the corresponding ER converter.

Energy Routing Approach
Due to the structure and characteristics of EI, some features must be considered in the routing approach: • Energy routing is demand-dominated and the source of energy is not specified; • The lost energy cannot be regenerated and may cause an overflow that could lead to the destruction of devices/lines, or even the crash of the whole energy system; • The power transmission loss is not only related to the length of the path but also to the transmitted and pre-existing power.Because of this fact, the ERs should not store the routing paths but the energy information of the whole system; • The dynamic routing algorithm must achieve the supply-demand balance.
Taking into account these features, we considered the energy routing problem as an optimization problem, where the objective function is to minimize the power transmission losses and cost.To solve this issue, we proposed:

•
A centralized peer-to-peer energy trading architecture; • A subscriber matching mechanism for both mono and multi-source consumer cases.This mechanism assigns for each consumer the optimal producer in terms of minimization of both cost and power loss; • In the case of multi-source consumer (heavy load), we proposed an energy particle swarm optimization algorithm, to determine the amount of power for a set of producers to achieve minimum power transmission loss and cost; • An IACO-based energy routing protocol that ensures a non-congestion efficient-energy transmission.

Subscriber Matching Mechanism
The subscriber matching mechanism constructs the producer (seller)-consumer (buyer) pairs based on the proposed peer-to-peer trading architecture.We assume that, here, the broker stores producers/consumers profiles such as: the electricity price, transmission time and the amount (P) of available/needed power, as shown in Table 4.As mentioned in the subscriber-matching mechanism sequence diagram (shown in Figure 4): (1) Each consumer creates an energy request message with the amount of needed energy, then sends it to their connected ER. (2) The ER transfers this energy request to the broker.
(3) The broker treats the energy demands according to their requesting time and determines for each demand a list of all producers/prosumers that can provide the consumer energy demand in the corresponding time.If there is no single producer/prosumer capable of providing the consumer required energy, then the consumer is a heavy load.In this case, the broker constructs a list of all the producers/prosumers available in the consumer transmission time;.(4) The broker sends the constructed list to the consumer energy router.
(5) After receiving the possible producers' list, the consumer ER runs the subscriber matching mechanism as illustrated in Algorithm Fitness ← min(Fitness s ) Case 1: A mono-source consumer Here, one or multiple producers can provide the requested energy.Here, ER uses Equation (3) to calculate the fitness value (Fitness p ) to each producer (p) in the received list.
where cost p and w c↔p represent, respectively, the cost of energy and the power transmission loss of the best path between the consumer and producer generated by IACO-based energy routing protocol (described in detail in Section 5).
As mentioned in Equation (3), it is evident that the objective function combines two opposing objectives to be minimized: cost and power loss.To make the problem simpler, we connected these two objectives together by an α factor reflecting the degree of importance or weight of each objective, based on the preference of the broker.Thus, for instance, if the broker wants to reduce the Cost p by giving 80% of importance to the Cost p , the importance of the power loss w c↔p will be just 20% and α in this case is equal to 0.2.If the broker wants to give the same importance to the two objectives, α took the value 0.5.
The broker decides the value of α according to the system generation capacities.Whenever the number of producers or power generation capacity decreases, the degree of power loss importance increases.(6) The ER selects the producer with the minimum fitness value (Equation ( 5)), informs the broker to do the necessary updates (8) and to inform the selected producer (7), creates the virtual circuit to start the transfer of energy using the selected efficient path, updates the pre-existing power in its power tables and informs the other ERs: Case 2: A multi-source consumer (heavy load) In this case, none of the available prosumers can provide the whole demanded energy, so multiple producers would be chosen by the subscriber matching mechanism to satisfy the consumer demand.The number of selected suppliers for a given consumer (load) should be as limited as possible, to minimize the subscriber matching mechanism complexity, maximize the stability and ensure the security and robustness of the grid [20,21,39].Using the possible producers list (L), first, the ER creates a vector C c n of a set of producers/prosumers. , where the sum of their available power satisfies the consumer's demand (6): Then, for each set S k in C c n , the ER invokes the energy particle swarm optimization algorithm (EPSOA) to determine the required power amount from each producer in set S k to obtain the minimum fitness value (Fitness S k ): Algorithms 2 and 3 represent the proposed energy particle swarm optimization algorithm (EPSOA) with its objective function, respectively.The algorithms' parameters are shown in Table 5.
The EPSOA initially creates k particles.A particle reflects the amount of power to be supplied by each producer in the set S to satisfy the consumer demand (each particle is equivalent to one row in the energy combination matrix).In each particle, if the set contains n producers, the amount of power obtained from producer 1 to producer (n − 1) is randomly within the permissible range, while nth producer completes the consumer demand.The algorithm evaluates the fitness value including cost and power loss (Equation (7)) of each particle using the objective function in Algorithm 3, initializes pbest and chooses the particle with the minimum fitness value as gbest.The algorithm is iterative where in each iteration, the values of X and V are updated using Equations ( 7) and (8).These equations are taken from [33].
The new values of X t+1 must verify the constraints ( 10), ( 11), ( 13) and ( 14) while the values of pbest and gbest are updated as in Algorithm 2.

Algorithm 2: Energy Particle Swarm Optimization
Input: c, P c , S Output: f 0min, gbest Initialize the PSO parameters (k, n, C 1 , C 2 , and w) /* Initialize the random positions of each particle /* Evaluate the fitness function of each particle */ for each particle i do f 0 (i) ← OF(X(i, :), S, c) Update V according to Equation (8) for each particle i do for each producer j in S do Update X according to Equation ( 9) X(i, j) ← X(i, j) + V(i, j) Algorithm 3: EPSOA Objective Function (OF) Input: X, S, c Output: Cost Function OF(X, S, c):

Symbol Description c
The consumer P c The amount of consumer demand energy S Set producers from the C c n S(i) The ith producer of set S k The population size (number of particles) n The number of consumers in set S C 1 , C 2 Positive acceleration constants Inertia factor

X
The position of the particles which represents the amount of energy to took from each producer in the set S, X(i) = [P 1 . . .P m ]

X(i, j) min
The minimum amount of energy that could be provided by producer j in set S i .(in our case 0) X(i, j) max The maximum amount of energy that could be provided by producer j in set S i (P j ) V The velocity The fitness value of the initial X (the energy transmission cost of the corresponding energy in X) f The fitness value of X (the energy transmission cost of the corresponding energy in X) pbest The personal best solution of each particle which represents the best amount of energy to get from each producer in set S to reach the consumer demand with minimum transmission cost gbest The global best solution, which represents the best particle (energy amount) with the minimum fitness maxit The max iterations number

•
The total amount of power in the particle must be equal to the consumer demand: • The amount of power from producer j in particle i must be within the producer's capacity (the available power): 0 < X ij ≤ P p j (11) Finally, after the determination of the required power amount from each producer in each set with the minimum energy transmission cost, the ER selects the best set using Equation ( 12): Fitness min = min k=1...m (Fitness S k ) The ER obtains the best set with all the necessary information (required power, best path to each producer in the best set) and as in case 1, it creates the circuit, does the necessary updates and informs the broker, and then starts the energy transmission from selected producers.
The consumer-prosumer pairs, produced by the subscriber matching, should satisfy the following constraints:

•
If the prosumer/producer is matched with multiple consumers, the total amount of selling electricity (p cp ) should not exceed the existing power of the prosumer (P p ): • If the consumer is matched with multiple prosumers, the total amount of buying electricity (p cp ) should not exceed the demand energy of the consumer (P c ):

Improved ACO-Based Energy Routing Protocol (IACO-ERP)
Each ER connected to a consumer executes an IACO-based energy routing algorithm to determine the energy-efficient path between each producer-consumer pair.
In this work, we selected the energy transmission path depending on its power transmission loss.The power transmission loss of a path is related to two main factors: the power lines losses (w ij ) and ER losses (w i ) that construct the path.w ij and w i represent the weights of ERs and power lines in the EI model shown in Figure 2.
The power loss in ER is dependent on the conversion efficiency of the electronic converters and the power cable transmission losses inside it.Since the latter is neglected and the conversion efficiency is assumed to be constant, the power loss of ER is a linear function of transmitted power (15).Where we have e f f i , P cp represents the conversion efficiency of router v i and the transmitted power from producer to consumer, respectively: On the other hand, the total power loss in a power line between energy routers v i and v j is calculated based on the resistance (R ij ) and reactance (X ij ) of the line.Since a three-phase grid is used, it was noted that the total power loss of the line is divided into active and reactive power losses: with It is known that the reactive power loss is negligible compared to the active power loss and the total power loss in the line becomes: Equation ( 18) describes the relation between the line power loss and the transmitted power: where R ij and V ij are the resistance and voltage of the power line that connect energy routers v i and v j , respectively.However, P cp is the transmitted power of consumer-producer pair.
In fact, Equation ( 18) is not relevant in the case where there is an already existing power (P ij ) in the line.In this case, the power line loss is calculated using Equation ( 19): Accordingly, the total power loss of a transmission path that connects a consumerprosumer pair is the sum of power losses of all routers and power lines that construct the path.
To select the minimum loss path between consumer-prosumer pairs, we proposed an improvement of the protocol in [31].We introduced an improved ACO-based energy routing protocol IACO-ERP, which allows the selection of a non-congestion efficient path, where the objective function is the minimization of the power transmission loss (Equation ( 21)): The flowchart in Figure 5 describes the fundamental concept and implementation of the IACO-based energy routing protocol used to find the non-congestion minimum loss path.The relevant parameters are shown in Table 6.An energy transmission path between the consumer-producer pair determined by an ant k V i The current node where the ant is allocated V j A neighbor of node V i (the next node to producer) A set of one hop neighbors of a node v i The energy minimum loss path should satisfy the following constraints: • The power loss of a path should be less than the transmitted energy: • The transmitted power should not exceed the maximum capacity of the path, which is the minimum between the lowest interface capacity of energy routers and the lowest capacity of the power lines that constructed the path: • The total power transmitted through a power line should not exceed its available capacity: • The total power flows into the same ER interface should not exceed its interface capacity: The energy routing selection method, in Figure 5, consists of ten steps which are carried out for each consumer-producer pair: 1.
First, ERs constructs the network model using the system information (Tables 2 and 3).

2.
Thereafter, receiving the pair information (the amount of transmitted power P cp , identity of the producer/prosumer) and using the constraints ( 23)-( 25), the ER eliminates all edges and nodes(ERs) that cannot transfer the P cp and deducts a sub-graph G2.

3.
The path selection method is based on ACO.Consumers and producers/prosumers represent the ant nest and food source, respectively.Ants are used to determine the best path between them.They use a chemical known as pheromone to communicate and trace the path to the food source.The path with the highest intensity of pheromone is the one widely used by ants.It is usually the shortest path.In nature, some ants depose more pheromones in the case where the food source is big or of higher quality and the path is very good [40].Therefore, the pheromone level of a path is proportional to its power transmission loss.
The amount of deposed pheromone on an edge (power line) e ij by ant k is represented by Equation ( 26): where w path is the power transmission loss of the path where the line e ij belongs to this path.When the line e ij connecting routers v i and v j is chosen by an ant k, the amount of pheromone on this line is updated using Equation ( 27): where n represents the number of ants selected on the line e ij .In this step, the ER initializes the colony parameters: number of iterations, ants, and pheromone level.

4.
Each ant travels from the graph from one node (ER) to another until it arrives to the producer.The selection of the next hop (node) is determined by calculating a probability for each neighbor with the use of the roulette wheel principle.The probability depends on the amount of pheromone and the power loss to the next hop: where F i is the neighboring list of node v i , in the graph G2, while η ij represents the quality of the power line (edge) e ij , α and β are two parameters that control, respectively, the importance of the pheromone intensity and the quality of the power line.

5.
The algorithm runs in iterations, and at each iteration an energy efficient path is selected (set S in Figure 5), and the amount of the pheromone is updated according to Equations ( 26) and ( 27).

6.
The energy efficient path is the path with the minimum power transmission loss in set S (Equation ( 21)).
A virtual circuit, constructed using the selected energy efficient path, is allocated to transfer the power between the producer-consumer pair.The exchange information between routers during the creation of energy transmission circuits and the verification of capacity constraints before the construction of the paths prevent the congestion and overhead problems.

Algorithms Complexity
Algorithm complexity is one of the metrics used to measure the performance of any given algorithm.In our proposed approach, we have used ACO and PSO algorithms to obtain the best optimal solution.ACO is exploited to find the efficient paths between consumers and their producers.PSO is used to determine the best producers for a heavy load consumer.Despite the fact that the ACO algorithm presents limitations in largescale combinatorial problems because they require huge processing time, in our case, it outperformed the greedy search algorithm used in [20] to solve the same problem.In what follows, we computed the used algorithms complexity.
We can compute the subscriber matching's complexity in two cases: heavy loaded network (ComplexHeavy) and light loaded network (ComplexNotHeavy).Since the IACO algorithm is invoked in both cases, let us compute its complexity first.Assume n is the number of ER nodes, m is the number of ants, and the maximum number of iteration is maxit.Then, the time complexity analysis of IACO algorithm is: The time complexity of the light-loaded network is (see Table 7): where np is the number of possible producers.(2) The time complexity of the heavy loaded network is (the worst scenario (see Table 8)): ) is the combination complexity.• comp(EPSOA) is the EPSOA algorithm complexity.TheEPSOA algorithm contains several elementary instructions, two nested loops and three nested loops.Then, its complexity is O(maxit × k × np) (see Table 9): where k is the number of particles.• comp(EPSOA objective function) is the same as the complexity of the light loaded network case, previously computed as:

Simulation and Results
In this section, various study cases, implemented in MATLAB, were conducted to validate the effectiveness of the proposed energy routing approach.Additionally, the comparison to an existing routing algorithm is carried out to evaluate the performance of the proposed approach.The ER-based EI represented in Figure 1 is treated as a simulation case where the energy system parameters are:

Basic Data
Tables 2 and 3 illustrate the parameters of power lines and ERs used in the proposed EI (Figure 1).On the other hand, Table 10 lists the energy profile of producers/consumers in the proposed network, including the cost, power and required transmission time.

Results of the Proposed Energy Routing Approach
Applying the proposed energy routing approach, a source selection (Section 4) with a non-congestion minimum loss path (Section 5) is constructed for each consumer.
Case 1 analysis: mono-source consumer with non overlapping transmission time In this case, according to Table 10, there are two consumers (D7 and D3) with two producers (D2 and D4).The transmission time of the consumers is different, which means it does not have any overlap.Thus, in this case, the pre-existing power through lines is zero and the energy transmission path taken by the first consumer will not affect the second one.Starting with consumer D7, using the proposed energy routing mechanism: 1.
D7 sends energy request to ER 17 .

2.
ER 17 transfers this request to the broker.

3.
The broker creates a list with the available producers that can provide 12 kw in the corresponding time (10.00-12.00)L = {D2, D4}, and sends it to ER 17 .

4.
ER 17 starts the execution of the subscriber matching mechanism (Section 4).As we can see, D7 is a mono-source consumer.Thus, for each producer in L (D2 and D4), the ER 17 calculates the cost and the energy-efficient path to determine the fitness value.The energy-efficient path is given by the execution of IACO-based energy routing protocol (IACO-ERP) described in Section 5.The protocol's first phase allows the ER 17 to construct a new graph from the EI graph (Figure 2) by deleting all the lines and routers that cannot transfer 12 kw as shown in Figure 6.This step with the dynamic routing creates a non-congestion minimum loss path. 5.
As described in Equation ( 3), in our approach, the objective was the minimization of the power loss and cost of energy.For that, the value of α used in the calculation of the fitness value was 0.5.With this value, ER 17 selects the producer D4 with the fitness value for consumer D7.
The same process is repeated for consumer D3 with ER 10 .
The calculation results including costs, efficient paths, power losses and selected sources, transmission power and the max capacity of paths are shown in Table 11 and Figure 6.The selected producers with the efficient paths for consumer D7 and D3 satisfied the energy routing constraints.As illustrated in Figures 7 and 8, the variation of α from 0 to 1 shows that the degree of the importance of the cost and power loss progresses in the opposite direction, which affects the producer selection.There are two special cases when α = 0 or α = 1: • α = 0: The fitness value depends only on the cost of energy, in this case, the producer with the minimum fitness value is producer D4.
The fitness value depends only on the power transmission loss of the best path, in this case, the producer with the minimum fitness value is producer D2.Case 2 analysis: mono-source consumer with overlapping transmission time Consumers D3 and D7 have an overlapping transmission time (case 2 in Table 10).Thus, the pre-existing power over certain power lines may be different from zero.This will lead to major changes of the power loss in those lines, which directly affect the efficient path selection; therefore, affecting the fitness value responsible for the producer selection.
By comparison to case 1, as shown in Table 12 and Figure 9, the selected producer for consumer D7 is D4 with the same energy efficient path, power loss and fitness value since, at the beginning, the pre-existing power in this path is equal to zero.However, across the overlapping time, the energy-efficient transmission paths from D3 to D2 and D4 have changed from the original paths 9 → 1 → 17 → 11 → 10, and 13 → 8 → 9 → 1 → 17 → 11 → 10, to 9 → 1 → 3 → 2 → 10 and 13 → 6 → 7 → 3 → 2 → 10, respectively.Because of the change in the pre-existing power in 13 → 8 → 9 → 1 → 17, from 0 to 12 kw, which results in increasing in the power losses of those power lines, has led to an augmentation in the power loss of the original efficient paths, which have become 5.61296 × 10 −1 kw and 8.0264 × 10 −1 kw, respectively, which influenced the fitness value.
The results of cases 1 and 2 demonstrated that the power loss in the power system was not only affected by the energy transmitted, but also by the pre-existing power.Case 3 analysis: congestion management Energy transmission congestion can occur in energy systems when the transmitted power exceeds the capacity of the transmission paths, known as the overflow problem.This could have serious consequences in the energy system.As illustrated in Table 10, in this simulation case, it is assumed that there is an overlapping transmission time such as in case 2, and the capacity of power lines L 3−7 and L 8−13 are restricted to 12 kw and 6 kw, respectively.
As mentioned before in Section 5, the IACO-based energy routing protocol eliminates all the ERs and lines that cannot support the transmitted power from the network before finding the efficient path to avoid the overflow problem, and to ensure the selection of a non-congestion minimum loss path.Table 13 and Figure 10 summarize the results for this case.By comparison to case 2, we can state that:

•
Consumers D3 and D7 have the same transmission power.

•
For consumer D7, the efficient path from D7 to D2 is the same as in case 2. While, the path toward D4 (13 → 8 → 9 → 1 → 17), cannot be used in this transaction since the transmission power (12 kw) exceeds the capacity of line L 8−13 (6 kw).Therefore, it has been replaced by another path with higher power transmission loss, which causes an increase in the energy transmission cost.

•
For consumer D3, as shown in Figure 10a, D7 selected the producer D4 with the efficient path 13 → 6 → 7 → 3 → 1 → 17.In this situation, the power line L 3−7 reaches its maximum capacity, so it is not available to be shared.Therefore, ER 10 turns from the path in case 2 (13 → 6 → 7 → 3 → 2 → 10) to a new path (Table 13) with a higher loss resulting in a higher fitness value.Since consumer D7 changed the selected path compared with case 2, this creates the opportunity to find a new path with minimal loss between D3 and D2 (see Table 13 and Figure 10b).As a result, D3 turns to consumer D2 with a minimum fitness value.
Table 13.The results of the energy routing approach for case 3 (α = 0.5).Case 4 analysis: multi-source consumer In order to validate the effectiveness of the proposed energy routing approach in multi-source consumer cases, we considered the electric vehicle (EV) as a heavy load with a charging request of 22 kw (according to the European EV charging standard IEC 61851 [41]).As shown in Table 14, we assume that there are three producers and none of them can provide the requested power.In this case, more than one producer should be selected to satisfy the EV demand power (D1).Consumer D1 (EV) requests the required power using ER 4 .In contrast to the previous cases, the broker list in this case contains all the producers that are available in the EV transmission time (L = {D2, D5, D6}).According to the power information of the producers in L, at least two sources are needed to provide the requested amount of power by the consumer.Therefore, after receiving the list (L = {D2, D5, D6}), ER 4 using Equation ( 6) creates a combination set as Table 14.Energy profile of the system producers and consumers in the case of a multi-source consumer.There are two possible sources combination sets (S 1 , S 2 ).According to the Equation (3), the fitness value is calculated using a function that optimizes the cost and power loss.Therefore, for each set S i the ER 4 invokes the EPSOA to define the optimum amount of power that should be collected from each producer in the S i where this amount of power optimizes the fitness value (Fitness S i ) as well as satisfies the consumer demand.
Table 15 shows the simulation results of multi-source consumer case, however,  As shown in Table 15, the fitness value of S 1 is larger than the fitness value of S 2 .Thus, ER 4 chooses the set S 2 with the power and paths allocation shown in Figure 11: Tables [17][18][19] show the variation of α and its affect on the results of EPSOA. Figure 12 shows the convergence of the EPSOA in the two sets.Case 5 analysis: 30 nodes system structure The 30-node (ERs) system was used for further study to validate the efficacy of the proposed energy routing approach on a more complex system, as shown in Figure 13.Tables 20 and 21 show the power lines and ERs parameters used for system in Figure 13.In this system, there are two mono-source consumers, one multi-source consumer and four surplus-energy prosumers.Table 22 displays their energy profile including their cost, power and required transmission time.In case 1 in Table 22, the transmission time of the different consumers does not have an overlapping time.Thus, the different energy transactions will not affect each other during the selection of the minimum energy loss transmission path.
Table 23 illustrates the optimization results of the proposed approach with α = 0.5.The constructed pairs with the transmission paths that all energy routing constraints such as the power loss and capacity constraints.However, in case 2 in Table 22, there is an overlapping time between the transmission time of consumers.Consumer D26 was supplied by producer D30 through the same energy-efficient path as in case 1 (30 → 27 → 25 → 26).In this case, the left capacity in the power line was L 27−25 = 9 kw and it cannot be used to transfer the required energy (see case 1 in Table 23) from prosumer D8 to consumer D24.Thus, another non-congestion energy-efficient path with a different energy amount was constructed using EPSOA and the IACO in set S 1 for consumer D24.Since the new solution for set S 1 has higher fitness function, the selected set for consumer D24 is set S2.For consumer D7, the only prosumer that can provide the demand in the corresponding time is D2.

Results Discussion
In order to validate the performance of our proposed scheme, as well as to show its efficiency in solving problems related to energy routing, namely subscriber matching, efficient routing path and transmission scheduling, we compared the obtained results of different experiments to previous works in the literature.
As illustrated in Table 24, starting with the mono-source consumer case, works in [20,21] have proposed an energy routing protocols based on graph traversal and Dijkstra algorithms, respectively, to determine a non congestion minimum loss path between producer-consumer pairs.First, the two proposed protocols did not examine how pairs were formed.The graph traversal method in [20] finds that all possible paths between the producer and consumer pairs then determines the path with the minimum power loss.This method generates an optimal solution but with a height execution time especially in the case of large-scale networks.IACO-ERP offers the best solution compared to [20] with the same execution time for small-scale networks and a better execution time for large-scale networks as shown in Table 25.In addition, we proposed a subscriber matching mechanism that decides which producer should be chosen for the consumer while reducing the costs and losses of energy.losses compared to the non-overlapping time.In addition, the use of the broker decreases the number of messages exchanged in the network.By comparison to the work in [20], our proposed approach has improved the execution time for both mono-and multi-sources cases in small and large systems by 7 min.The proposed approach can be used to match prosumers in the local energy market, provide alternative transmission paths when the efficient path is disrupted, and manage congestion on distribution links.
In the future, we plan to explore the possibility of applying additional bio-inspired methods, and we aim to explore to apply our solution to real life applications.

Figure 1 .
Figure 1.Example structure of the proposed Energy Internet.

Figure 7 .
Figure 7. Fitness value for D7 based on the variation of α: (a) for producer D2; (b) for producer D4.

Table 1 .
A comparison in routing design between the Internet and Energy Internet.
• Power lines used for connecting energy routers are represented by a set of edges E = {e ij , ...},where e ij is the power line that connects router v i to router v j ; • W describes the adjacency matrix of the network W = (w ij ) n×n , which reflects the network topology with the weights of both ERs and power lines of EI as shown in Equation (2).

Table 2 .
Energy information of ERs.

Table 3 .
Energy information of power lines connecting ERs.

Table 4 .
Producers' and consumers' energy information.

Table 8 .
Heavy loaded network case.

Table 10 .
Energy profile of the system prosumers (P) and consumers (C) in different cases.

Table 11 .
The results of the energy routing approach for case 1 (α = 0.5).

Table 12 .
The results of the energy routing approach for case 2 (α = 0.5).
Table 16 represents the IACO-based energy routing protocol and EPSOA simulation parameters.

Table 17 .
α variation in multi-source consumer case for S 1 .

Table 18 .
α variation in multi-source consumer case for S 2 .

Table 20 .
Energy information of ERs for Figure13.

Table 21 .
Energy information of power lines connecting ERs for Figure13.

Table 22 .
Energy profile of system prosumers (P) and consumers (C) for Figure13.