## 2 Optimization Model for Network Reconfiguration Problem of Ship Power System
### Simulation Experiments and Analysis
An asterisk represents the result of one optimization, and a circle represents the result of one switching operation:  
Figure 7: Flowchart of swarm exchange particle swarm optimization algorithm applied to network reconfiguration of ship power system. Figure 8: Changes in the average fitness value of the main search group. Figure 9: Variation in particles’ best fitness values. Figure 11: Optimal solving load branch switching code. Figure 10: Optimal number of particle switches. In Figure 8, the average fitness value of the main search cluster continues to trend in a favorable direction as the iteration progresses. In Figure 9, when the particles evolve to the sixth generation, the main search swarm history global optimal particle fitness value reaches the maximum and is stable. In Figure 10, the optimal number of particle switches is 7. The load branch switch code for the optimal solution is 102112020211111111111111. (Figure 11). From the simulation image, it can be seen that the average fitness value of the main search group increases with iterations; when the particles evolve to the sixth generation, the main search group's global optimal particle fitness value reaches the maximum and stabilizes; and the optimal number of particle switches is derived to be 7 times. The load branch switching code of the optimal solution is shown as 1021120202111111111111111, the load code values of loads L2, L7, and L9 are set to bit 0 to indicate loss of power, and the loads L3, L6, L8, and L10 are set to bit 2 to indicate that the alternate paths are used for power supply. In order to reflect the advantages of the swarm exchange particle swarm optimization algorithm and verify the ability of this algorithm to deal with the reconstruction problem, this paper is written in MATLAB under the same fault conditions to set up the reconstruction schemes of the chaotic genetic algorithm, particle swarm algorithm, improved particle swarm algorithm, and swarm exchange particle swarm optimization algorithm for side-by-side comparisons, respectively. The parameters of the genetic algorithm are set as follows: crossover rate \(P_{c1}\) = 0.9, \(P_{c2}\) = 0.6, mutation rate \(P_{m1}\) = 0.1, \(P_{m2}\) = 0.005. The parameters of the improved particle swarm algorithm are set as follows: acceleration factor \(c_{1}=c_{2}=2\); inertia weight initial value \(\omega=0.9\). The four algorithms are based on the same power system model, with the same constraints, the fault nodes are in branch 63 and branch 92, each of the four algorithms runs 50 times, and the simulation results and reconstruction schemes are summarized as follows:  
1. Chaotic genetic algorithm (CGA) simulation results are shown in Figure 12:
2. The simulation results of the particle swarm algorithm (PSA) are shown in Figure 13:
3. The results of the improved particle swarm simulation (IPSA) are shown in Figure 3.0
4. The simulation results of the swarm exchange particle swarm optimization algorithm (DSPA) are shown in Figure 3.1  
The simulation results of the three algorithms are shown in Figure 3.2  
From the experimental results and the table, it can be seen that the above four algorithms can achieve the reconstruction of the power grid under the same simulation conditions, but the genetic algorithm and the particle swarm algorithm cannot guarantee that they all converge to the optimum in the reconstruction; the swarm exchange particle