# Hybrid Energy Routing Approach for Energy Internet
## 5 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 \(eff_{i}\), \(P_{cp}\) represents the conversion efficiency of router \(v_{i}\) and the transmitted power from producer to consumer, respectively:  
\[w_{i}=(1-eff_{i})\times P_{cp} \tag{15}\]  
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:  
\[w_{ij}=\sqrt{P_{activepowerloss}^{2}+Q_{reactivepowerloss}^{2}} \tag{16}\]  
with \(P_{activepowerloss}=3\times R_{ij}\times I^{2}\) and \(Q_{reactivepowerloss}=3\times X_{ij}\times I^{2}\). 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:  
\[w_{ij}=3\times R_{ij}\times I^{2} \tag{17}\]  
Equation (18) describes the relation between the line power loss and the transmitted power:  
\[w_{ij}=\frac{R_{ij}}{V_{ij}^{2}}\times P_{cp}^{2} \tag{18}\]  
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):  
\[w_{ij}=\frac{R_{ij}}{V_{ij}^{2}}\times\left[\left(P_{cp}+P_{ij}\right)^{2}-P_{ ij}^{2}\right] \tag{19}\]Accordingly, the total power loss of a transmission path that connects a consumer-prosumer pair is the sum of power losses of all routers and power lines that construct the path. \[w_{c+p}^{path}=\Sigma_{v_{i}\in path}w_{i}+\Sigma_{e_{ij}\in path}w_{ij} \tag{20}\]  
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)):  
\[w_{c+p}=min\Big{(}\Sigma_{k\in paths}w_{c+p}^{k}\Big{)} \tag{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.  
Figure 5: Improved ACO-based energy routing protocol (IACO-ERP).