Skip to main content
. 2025 Sep 14;10(9):618. doi: 10.3390/biomimetics10090618
Algorithm 1: Power Restoration Strategy Optimization
1: Procedure: solve power restoration strategy(initial grid data, params) // where ‘initial grid data’ is collected from PMUs.
2:  // Section 1: Initialization and Topological Analysis via BFS
3:   Grid Model ← Initialize Grid Model (Initial grid data)
4:
5:   // Construct a Minimum Spanning Tree (MST) using Breadth-First Search
6:   Start Node ← Find Main Power Source Node(Grid Model)
7:   Queue Q ← [Start Node]
8:   Set Visited Nodes V ← {Start Node}
9:   Tree MST ←
10:    while Q is not empty do
11:    u ← Dequeue(Q)
12:    for each Branch S connected to u do
13:     v ← Get other end of S
14:     if v V then
15:      Add v to V; Enqueue(Q, v); Add S to MST
16:     end if
17:    end for
18:    end while
19:
20:    // Identify Chords and Form Fundamental Loops to Define the Search Space
21:    Chords ← Calculate Set Difference(Grid Model.All Branches, MST)
22:    Loop List ←
23:    for each Chord R in Chords do
24:    Path ← Find Path in Tree(MST, R.Endpoint1, R.Endpoint2)
25:    New Loop ← Path {R}
26:    Add New Loop to Loop List
27:    end for
28:
29:    // Synergy Point: The output of BFS (Loop List) now directly defines the chromosome structure for AMCGA.
30:    // Chromosome Length = size of Loop List. Each gene corresponds to a loop.and gene values use decimal encoding.
31:
32:    // Section 2: Optimization via Adaptive Modified Genetic Algorithm (AMCGA)
33:    Population ← Generate Random Initial Population(Params.Pop Size, Loop List)
34:    for g ← 1 to Imax do
35:    // Evaluate fitness for each individual solution
36:    for each Chromosome in Population do
37:     // Decode gene values into a set of open branches to form a new topology
38:     Open Branches ← Decode Chromosome(Chromosome, Loop List)
39:     Current Topology ← Calculate Set Difference(Grid Model.All Branches, Open Branches)
40:     // Simulate grid operation over the specified duration to evaluate strategy effectiveness.
41:     Total Score ← 0
42:     for time ← 0 to Simulation Hours do
43:      DG Output ← Get DG Output
44:      Restored Loads ← Calculate Restored Loads(Current Topology, DG Output)
45:      Total Score ← Total Score +Calculate Weighted Score(Restored Loads)
46:     end for
47:     Fitness(Chromosome) ← Total Score
48:    end for
49:
50:    // Evolution using Adaptive Multi-Point Crossover & Mutation
51:    Pcross=Pc1+Pc2ImaxIImax
52:    Pmutation=PmImax/ImaxmI
53:
54:    Parents ← Select(Population, Fitness)
55:    Offspring ← Multi Point Crossover(Parents, Pcross)
56:    Offspring ← Mutate(Offspring, Pmutation)
57:    Population ← Update Population(Population, Offspring)
58:    end for
59:
60:    // Section 3: Formulate and Output the Final Strategy
61:    Best Chromosome ← individual with highest Fitness in Population
62:    Final Open Branches ← Decode Chromosome(Best Chromosome, Loop List)
63:    Final Topology ← Calculate Set Difference(Grid Model.All Branches, Final Open Branches)
64:    // The strategy includes the final network structure and could include other operational data.
65:    Optimal Power Restoration Strategy ← Formulate Strategy(Final Topology, Grid Model)
66:    return Optimal Power Restoration Strategy
67:  end Procedure