# Large-Scale Complex Network Community Detection Combined with Local Search and Genetic Algorithm
## 3 Proposed Method
### Particle Swarm-Genetic Hybrid Algorithm  
(1) Algorithm hybrid strategy  
The mixing of algorithms needs to follow some combination principles so the advantages of the original evolutionary algorithms can be effectively utilized, the convergence speed can be accelerated and the quality of the optimal feasible solution solved by the hybrid algorithm is higher than that of the original algorithm--thus achieving the purpose of improving the algorithm. The combination of particle swarm optimization and genetic hybrid algorithm designed in this paper is designed to share the historical optimal feasible solution searched by each particle in the particle swarm optimization algorithm with the genetic algorithm. The genetic operator searches and evolves based on these feasible solutions. The genetic operator updates these historical optimal feasible solutions according to the specified evolutionary principle, which can not only maintain the good local search performance of the particle swarm algorithm, but also take advantage of the good global search ability of the genetic algorithm.  
(2) Hybrid algorithm flow  
The particle swarm-genetic hybrid algorithm (PSO-GA) flow proposed in this paper is shown in Figure 1. The main steps are as follows:  
(1) Set the parameters of the particle swarm and genetic hybrid algorithm. These parameters mainly include the population size POPSIZE, the iteration number Tmax of the algorithm operation, the self-adjustment range of the adaptive inertia weight factor \(W\), and the variation range of the asynchronous change learning factors C1 and C2.  
(2) Initialize the population: Generate POPSIZE particles according to the parameters set in step 1). The particle swarm algorithm, the genetic algorithm's operation object and the evolution strategy are not the same. Two initial chromosome codes should be copied for subsequent use. Evolutionary calculations that update the current fitness values of the particles.  
(3) Evolutionary strategy: Due to the particularity of the genetic algorithm evolution preservation strategy designed in this paper, both the crossover and the mutation operator will only evolve to better individuals. Therefore, the operation object of the genetic algorithm is the historically optimal individual chromosome code that each particle has found in the iterative search of the particle swarm. The particle swarm algorithm operates another chromosome code. When the corresponding fitness of this chromosome code is higher, the chromosome code covering the operation of the genetic algorithm is updated.  
(4) Perform particle swarm algorithm iteration: update the position vector and velocity vector of the particle. If the fitness corresponding to the new particle is higher than the local historical optimal feasible solution or the global historical optimal feasible solution, then the replacement is performed.  
(5) Crossover operation of genetic algorithm: Using a random matching strategy, the matched two particle individuals cross-evolve the specified chromosomal genes and compare the evolution results with the old individuals to decide whether to replace or discard. If a better individual is evolved, the local best is compared to the current global best individual, and if the individual is better than the current global best feasible solution, the global best feasible solution is replaced, otherwise no action is taken.  
(6) Variation operation of genetic algorithm: Similar to the strategy of step (5), if the fitness corresponding to the new particle is higher than the local historical optimal feasible solution or the global historical optimal feasible solution, then the corresponding replacement is performed.  
(7) Judgment: If the evolution stop condition is satisfied, the execution of the algorithm is stopped, otherwise it is returned to step (4) to repeat the execution.  
(8) Extraction: After the evolution stops, the best feasible solution of the original population is the best feasible solution to the target calculation problem.