# Dynamic Reconfiguration of Active Distribution Network Based on Improved Equilibrium Optimizer
## 4 Optimization Algorithms
### Feasible Solution Determination
#### 4.2.2 Feasible Solutions Determination Based on Basic Ring Matrix
Step 2: Calculate the impedance distance \(Z_{ni}\), which is the sum of all branch impedances of the countercurrent path \(L_{i}\), as shown in Equation (31):  
\[Z_{ni}=\sum_{b_{j}\in L_{j}}Z_{b_{j}} \tag{31}\]  
Step 3: Calculate the generalized load \(W_{ni}\), which is the product of the impedance distance \(Z_{ni}\) from the node to the origin and the conjugate of the node load, as shown in Equation (32):  
\[W_{ni}=Z_{ni}\overset{*}{S_{ni}} \tag{32}\]  
Step 4: Calculate the power moment \(T_{i}\) of node \(Ne_{i}\) and set the minimum value to \(T_{i,min}\). The power moment \(T_{i}\) is the real part of the sum of the generalized loads \(W_{ni}\) of all nodes on the countercurrent path \(L_{i}\), as shown in Equation (33):  
\[T_{i}=\text{Re}\Bigg{(}\sum_{n_{i}\in L_{i}}W_{n_{i}}\Bigg{)} \tag{33}\]  
Step 5: According to the power moment calculation, perform branch verification without changing the original branch order and remove duplicate branches. Make the following modifications to the basic loop matrix \(\mathbf{H}\) to generate an ordered loop feasible solution matrix \(\mathbf{JM}\): in the basic loop matrix \(\mathbf{H}\), only the branch \(S_{i}\) is retained in the loop where the minimum power moment is located, while the other branches are reassigned to zero in the basic loop matrix \(\mathbf{H}\), as shown in Equation (34). If there are branches located in different basic loops but with the same loop-breaking effect, only the branches far from the root node are retained, and the other branches are reassigned to zero in the basic loop matrix \(\mathbf{H}\). \[m_{idjd}=\left\{ \begin{array}{llll}U&T_{d}=T_{d^{\prime}}\\ 0&T_{d}\
eq T_{d^{\prime}}\end{array} \right. \tag{34}\]  
Step 6: Repeat steps 1 to 4 until all repeated branch verifications are completed, ending the loop and outputting the adaptive ordered loop feasible solution matrix \(\mathbf{JM}\). \[\mathbf{JM}= \begin{pmatrix}2&3&4&5&6&7&33&20&19&18\\ 34&14&13&12&0&0&0&0&0&0\\ 21&35&11&10&0&8&0&0&0&0\\ 15&16&17&36&32&31&30&29&0&0\\ 25&26&27&28&37&24&23&22&0&0\end{pmatrix}  \tag{35}\]  
Through branch verification, a significant number of inferior solutions that satisfy topological constraints can be filtered out, allowing the optimal solution to be more easily located within the solution space. The feasible solution judgment model \(\mathbf{JR}\), based on the adaptive ordered loop, eliminates many inferior solutions through branch verification, thereby narrowing the range of feasible solutions and further enhancing the overall quality of the solution space. This not only improves the efficiency of the reconfiguration process but also facilitates the algorithm's ability to search for the optimal solution. The detailed steps of the proposed method are presented in Algorithm 1. ```
0: Basic loop matrix \(\mathbf{H}\), branch impedance \(Z\), node equivalent load \(\overset{*}{S}\)
0: Adaptive ordered loop feasible solution matrix \(\boldsymbol{JM}\)
1: for each repeated branch \(S_{i}\) in \(\mathbf{H}\) do
2: Determine the number of repetitions Nr and positions \(H_{l1k1}\), \(H_{l2k2}\), \(\ldots\), \(H_{lNrkNr}\)
3: Construct reverse path \(L_{i}\) from end node \(Ne_{i}\) to source node
4: Compute total impedance on path \(L_{i}\): \(Z_{mi}=\sum(Z_{bj})\), \(\forall b_{j}\in L_{i}\)
5: Compute generalized load: \(W_{mi}=Z_{mi}\overset{*}{S}_{ni}\)
6: Compute power matrix at node \(Ne_{i}\): \(T_{i}=\text{Re}(\sum(W_{mi}))\), \(\forall n_{i}\in L_{i}\)
7: Identify path \(w_{ni}\)th minimum power value \(T_{min}\)
8: for each position of \(S_{i}\) in \(\mathbf{H}\) do
9: if \(T_{d}=T_{min}\) then
10: \(m_{idid}=U\) // Retain branch
11: else
12: \(m_{idid}=0\) // Remove redundant branch
13: end if
14: end for
15: end for
16: Repeat steps 1-15 until all repeated branches are validated
17: Output ordered feasible decoding matrix \(\boldsymbol{JM}\)
```  
**Algorithm 1**Pseudo code of Generate Adaptive Ordered Loop Feasible Solution Matrix \(\boldsymbol{JM}\)