# Parallel Hybrid Particle Swarm Algorithm for Workshop Scheduling Based on Spark
## 1 Introduction
The particle swarm optimization algorithm (PSO) stands out among many intelligent algorithms for its advantages, such as high solution accuracy and fast convergence speed. [PERSON] et al. [19] proposed an improved particle swarm algorithm with decreasing disturbance index on the multi-objective job shop scheduling problem. [PERSON] et al. [20] faced the problem of shop scheduling with congestion constraints and proposed a combination of a local search algorithm based on probabilistic perturbation and a particle swarm algorithm. Experiments show that the improved algorithm can quickly obtain the best solution; [PERSON] et al. [21] proposed a hybrid genetic particle swarm optimization algorithm for flexible job shop scheduling. Experiments show that the proposed algorithm has high solution quality and good practicability. The particle swarm optimization algorithm has a wide range of applications in solving practical problems. Therefore, this paper also uses an improved particle swarm algorithm to solve the problem. Spark [22; 23] is a memory-based distributed computing framework. Comparing the Spark and Hadoop platforms, Hadoop is suitable for offline batch processing of files, but is not suitable for iterative operations. When Spark deals with iterative problems, it does not need to store the results of the iterations to disk, which makes up for the inefficiency of Hadoop Mapreduce that reads operations from the disk every time it deals with iterative problems. When programming Spark in parallel, the input data are decomposed into multiple batch processing fragments, the data are converted into RDD (resilient distributed datasets) and the data are encapsulated in RDD. Through the parallel operation of RDD, the parallel operation of data processing is realized [24]. The basic idea of realizing the parallel particle swarm algorithm is to convert the particle swarm to RDD and initialize it to multiple small populations of the same size. After parallel processing of these small populations, a feasible solution is finally obtained [25; 26]. According to the idea of parallelization, a parallel hybrid particle swarm optimization algorithm is proposed for the mixed-flow hybrid workshop scheduling problem. The existing intelligent algorithm adopts three-stage coding [13; 15] to solve the hybrid mixed-flow workshop scheduling problem, which is only applicable to the case of a small batch. Nowadays, the scale and complexity of workshop scheduling are constantly increasing. In the case of relatively large batches, it is easy to fall into the problem of local optimization using its existing three-stage coding intelligent algorithm. Therefore, in the case of a large batch, three-stage coding is not used in the problem of hybrid mixed-flow workshop scheduling. Each workshop is coded independently for independent scheduling. The independent scheduling optimization of the workshop leads to a too long running time of the algorithm. Therefore, the algorithm is improved by combining Spark to realize the parallelization of the algorithm and reduce the running time of the algorithm. In this paper, a hybrid mixed-flow workshop scheduling model is established. In the case of a large batch, a hybrid particle swarm optimization parallelization algorithm based on Spark is proposed to avoid the algorithm falling into local optimization and the workshop scheduling scheme can be obtained effectively and quickly. It has important theoretical significance and application value to solve the problem of hybrid mixed-flow workshop scheduling.