## 2 Optimization Model for Network Reconfiguration Problem of Ship Power System
### Swarm Exchange Particle Swarm Optimization Algorithm
#### 3.2.1 Swarm Exchange Particle Swarm Optimization Algorithm Exchange Strategy  
The exchange strategy employed in this paper is based on the literature. The golden section is represented by the Greek letter \(\phi\). A review of the literature reveals that the application of the golden section to intelligent optimization algorithms has been extensively studied by numerous scholars. The golden section is utilized to improve the gray wolf algorithm and to balance the local and global search capabilities of particle swarms. Additionally, it is applied to harmonize the relationship between inertia and experience, thereby reducing the likelihood of the algorithm converging to local optima. In the swarm exchange particle swarm optimization algorithm based on the golden section ratio used in this section, the entire algorithm divides the population into the main search swarm and the auxiliary search swarm. In the iterative process, the main swarm is responsible for the global search, while the auxiliary swarm is responsible for the local search. The particles in both swarms are sorted according to their fitness values, and the advantageous particles (those with higher fitness values) in the auxiliary swarm are exchanged with the inferior particles (those with lower fitness values) in the main swarm according to the golden section ratio. This exchange ensures the diversity of the population while removing the disadvantaged particles, thus enhancing the global search performance and convergence speed of the algorithm. The main search cluster adopts a global search strategy, and its particle position formula can be adjusted as follows:  
\[\left\{ \begin{array}{l}v_{id}(t)=\omega v_{id}+c_{1}\times rand()[p_{id}-x_{id}( t)]+c_{2}\times rand()[p_{gd}-x_{id}(t)]\\ x_{id}(t+1)=x_{id}(t)+v_{id}(t)\end{array} \right., \tag{32}\]  
while \(p_{id}\) is the historical optimal position of the current particle; \(p_{gd}\) is the historical optimal position of the population; \(c_{1}\), \(c_{2}\) are acceleration constants set to 2; \(rand()_{1}\), \(rand()_{2}\) are random values in the interval 0 to 1. The particle position formula of the local extreme value search strategy for the auxiliary search group can be adjusted as follows:  
\[\left\{ \begin{array}{l}v_{id}(t)=\omega v_{id}+c_{3}\times rand()[p_{id}-x_{ id}(t)]+c_{4}\times rand()[p_{ld}-x_{id}(t)]\\ x_{id}(t+1)=x_{id}(t)+v_{id}(t)\end{array} \right., \tag{33}\]  
while \(p_{ld}\) is the optimal particle within a portion of the particle swarm as a whole, i.e., the local optimal value. The iterative process uses the golden ratio to determine the number of particles exchanged by the primary and secondary particle swarms, denoted by the Greek letter \(\varphi\). The mathematical expression for the golden rule is  
\[\left(1+\sqrt{5}\right)/2\ \approx\ 1.618033988749895, \tag{34}\]  
The golden section is the division of a length into two parts; the ratio of the long part to the whole is equal to the ratio of the short part to the long part, then the two parts formed by this division point are called the golden section. The formula is as follows:  
\[\frac{x}{l}=\frac{l-x}{x}\Rightarrow x^{2}+l\times x-l^{2}=0\Rightarrow x=0. 618\times l, \tag{35}\]  
After each iteration, the population needs to be sorted in terms of fitness values, and particles with high fitness values in the secondary search population are selected to be exchanged with the same number \((1-0.618)*N=0.382*N\) of inferior particles with low fitness values in the primary search population. 2.2 Swarm Exchange Particle Swarm Optimization Algorithm: Discrete Approach and Chaos Initialization  
Since the algorithm will ultimately serve a multi-objective optimization problem such as the reconfiguration of a ship's power system, the reconfiguration scheme provided is a combination of switch actions, and therefore the particle swarm algorithm, which deals with continuous variables, needs to be discretized to accommodate a 20-dimensional variable consisting of switches.