Flexible job shop scheduling method based on improved particle swarm genetic hybrid algorithm
By improving the particle swarm optimization and genetic algorithm hybrid algorithm, combining particle swarm optimization and genetic algorithm, and adding variable neighborhood search, the scheduling of flexible job workshops is optimized, which solves the problems of population diversity and poor convergence, and improves scheduling efficiency and accuracy.
Patent Information
- Application Number
- CN202210137830.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-02-15
AI Technical Summary
Existing particle swarm genetic algorithms suffer from poor population diversity, poor convergence, and insufficient local search capabilities in the flexible job shop scheduling problem, resulting in low scheduling efficiency.
An improved hybrid particle swarm optimization and genetic algorithm is adopted, which combines particle swarm optimization and genetic algorithm, and incorporates a variable neighborhood search algorithm. The population is optimized through double-layer encoding, elite solution preservation and roulette wheel selection strategy, similar individual elimination and chromosome fitness search strategy, and dynamic linking strategy to improve local search capability.
It improves the efficiency and performance of flexible workshop scheduling, enhances the convergence speed and accuracy of the algorithm, makes up for the shortcomings of particle swarm optimization and genetic algorithms, and obtains better scheduling results.
Smart Images

Figure CN114493337B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of job shop scheduling, in particular to a flexible job shop scheduling method based on an improved particle swarm genetic hybrid algorithm. BACKGROUND
[0002] The flexible job shop scheduling problem (FJSP) is an extension of the traditional job shop scheduling problem (JSP), which only considers the case that the workpiece has a unique determined processing route. In the FJSP, each operation can be processed on multiple machines, and the workpiece has a selectable processing route, and the time required for processing on different machines is different, so its research not only has great practical significance, but also has far-reaching theoretical significance. The FJSP reduces the machine constraint, expands the search range of feasible solutions, and increases the complexity of the problem, which is a non-deterministic polynomial (NP) difficult problem.
[0003] The existing research methods for FJSP are mainly divided into accurate algorithms, heuristic rules and meta-heuristic algorithms such as simulated annealing, genetic algorithm, etc. Some intelligent algorithms such as genetic algorithm (GA), particle swarm optimization (PSO) and the like are widely applied to the FJSP problem due to their simple and efficient characteristics, but there are still many problems. The GA method has dependence on the selection of the initial population, poor convergence, and the PSO method has problems of poor population diversity, low accuracy and poor local search ability. SUMMARY
[0004] The purpose of the present application is to provide a flexible job shop scheduling method based on an improved particle swarm genetic hybrid algorithm to solve the problems in the prior art, to be able to compensate for each other's shortcomings and to increase the ability of local search.
[0005] The present application provides a flexible job shop scheduling method based on an improved particle swarm genetic hybrid algorithm, which comprises the following steps:
[0006] Step S1, initializing parameters, taking the minimum longest completion time of the operation as the objective function, and establishing a flexible job shop scheduling model;
[0007] Step S2, initializing the population p(g), generating particles of the population size, performing double-layer coding, and assigning the generated population to the chromosomes of the genetic algorithm;
[0008] Step S3, solving the fitness value of the initialized population, and recording the optimal position and optimal chromosome of the individual and population;
[0009] Step S4, updating the velocity and position of the particle according to the optimal value of the last generation population, calculating the fitness value of the updated particle swarm, retaining the optimal value, and replacing the corresponding genetic chromosome if a better individual is generated in the particle swarm;
[0010] Step S5, using a composite selection strategy based on elite solution retention and roulette wheel selection to perform selection operation of genetic algorithm;
[0011] Step S6, using similar individual elimination strategy and chromosome fitness search strategy to perform selection operation, crossover operation and mutation operation on the genetic population, and replacing the corresponding individual and updating the individual optimal fitness value or global optimal value if a better individual is evolved;
[0012] Step S7, using variable neighborhood search algorithm to search the genetic population, calculating the fitness value, and replacing the corresponding individual and updating the individual optimal fitness value or global optimal value if a better individual is evolved, to generate the next generation p(g+1);
[0013] Step S8, according to the set maximum search neighborhood number G max , judging whether to terminate the iterative search, if the iteration is terminated, executing step S9, if the iteration is not terminated, executing step S7;
[0014] Step S9, according to the maximum iteration number G end , judging whether the iteration termination condition is met, if the condition is met, outputting the final result, if not, returning to step S4.
[0015] The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, wherein preferably, the step S1, initializing parameters, taking the minimum longest completion time of the process as the objective function, establishing a flexible job shop scheduling model, specifically including:
[0016] Mathematically representing the flexible job shop scheduling problem;
[0017] Initializing parameters, setting the number of population individuals as P_SIZE, the maximum iteration number as G max , the end condition as G end , the velocity range of the particle as v, the inertia weight as w, the first learning factor as c1, the second learning factor as c2, the mutation probability value as Pc, and the crossover probability value as P m ;
[0018] Determining the optimization index of the flexible job shop scheduling problem.
[0019] The flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, preferably, the flexible job-shop scheduling problem is mathematically represented, specifically comprising:
[0020] Suppose that n workpieces are processed on m machines, and each workpiece has at most h processes, then the workpiece set is O = {O1, O2, …, O n}, the process set is J = {J1, J2, …, J n}, wherein, J i = {j i1 ,j i2 ,...,j ik ,...,j ih}, i = 1, 2, …, n, k = 1, 2, …, h, j ik represents the kth process of the ith workpiece; the machine set is M = {M1, M2, …, M m}, wherein, M i = {m i1 ,m i2 ,…,m ik ,…,m ih}, i = 1, 2, …, n, k = 1, 2, …, h, m ik represents the machine for processing the kth process of the ith workpiece; the set of process processing time of each workpiece is T = {T1, T2, …, T n}, wherein, T i = {t i1 ,t i2 ,…,t ik ,…,t im}, i = 1, 2, …, n, k = 1, 2, …, m, t represents the time required for processing the kth process of the ith workpiece.
[0021] The flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, preferably, the optimization index of the flexible job-shop scheduling problem is determined, specifically comprising:
[0022] The maximum completion time is used as the optimization index, and the flexible job-shop scheduling constraint condition is set,
[0023] the maximum completion time of all processes of all workpieces under the appropriate processing technology is the minimum, wherein the flexible job-shop scheduling constraint condition is:
[0024] T ijk ≤ S i(j-1)k , which means that a process can only start after the previous process is completed,
[0025] T ijk -S ijk =F ijk , indicates that the processing of a process must be carried out until the end,
[0026] Ti jk ≤T i′j′k′ , indicates that each device cannot process two processes at the same time,
[0027] wherein F i indicates the completion time of workpiece i, T ijk indicates the completion time of the jth process of workpiece i on machine k, S ijk indicates the start time of the jth process of workpiece i on machine k.
[0028] The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, wherein preferably, the step S2, initializing the population p(g), generating a population size of particles, carrying out double-layer coding, and assigning the generated population to the chromosome of the genetic algorithm, specifically comprising:
[0029] A double-layer coding method is used to initialize the population p(g) to generate a population size of particles, wherein the first half is coded based on the process, composed of the process number of the workpiece, to determine the processing order of the process; the second half is coded based on the machine, composed of the process number of the corresponding machine of the workpiece, to determine the selected machine of the process, and the generated population is assigned to the chromosome of the genetic algorithm, and the decoding process is the inverse process of coding.
[0030] The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, wherein preferably, the step S3, solving the fitness value of the initialized population, and recording the optimal position and optimal chromosome of the individual and population, specifically comprising:
[0031] According to the workpiece completion time, the fitness value F i of the initialized population p(g) is calculated by the following formula:
[0032] wherein F i indicates the fitness value, and f(x) indicates the workpiece completion time;
[0033] The optimal position and optimal chromosome of the individual and population are recorded.
[0034] The flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, preferably, the step S4, the speed and position of the particle are updated according to the optimal value of the last generation population, the fitness value of the updated particle swarm is calculated, the optimal value is reserved, if a better individual is generated in the particle swarm, it is replaced into the corresponding genetic chromosome, and specifically comprises:
[0035] The speed v and position l of the particle are updated according to the optimal value of the last generation population, the fitness value F of the updated particle swarm is calculated i , the optimal value is reserved, if a better individual is generated in the particle swarm, it is replaced into the corresponding genetic chromosome, the particle updating speed is calculated by the following formula:
[0036] v = w * v + c1 * r1 (l best -n present ) + c2 * r2 * (p best -n present )
[0037] Wherein, v represents the speed of the particle, w represents the inertia weight, c1 represents the first learning factor, c2 represents the second learning factor, r1 and r2 represent random numbers, l best represents the best position of the current individual, n present represents the current position,
[0038] The particle updating position is calculated by the following formula:
[0039] n′ present = n present +v
[0040] n′ present represents the next position of n present .
[0041] The flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, preferably, the step S5, the selection operation of the genetic algorithm is performed by adopting the compound selection strategy based on the elite solution reservation and roulette,
[0042] The top 10% of the elite individuals in the population at each iteration are directly evolved to the next generation by adopting the compound selection strategy of the elite solution reservation and roulette,
[0043] Wherein, the probability P of the individual i being selected is calculated by the following formula,
[0044]
[0045] The cumulative probability Q of the individual i is calculated by the following formula,
[0046]
[0047] The flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, wherein preferably, the step S6 adopts a similar individual elimination strategy and a chromosome fitness search strategy to perform selection operation, crossover operation and mutation operation on the genetic population, if a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated, and specifically comprising:
[0048] After selection by roulette wheel method, crossover and mutation operations are performed, wherein,
[0049] The crossover probability is calculated by the following formula,
[0050]
[0051] Wherein, P c represents the crossover probability, g max represents the maximum fitness value of the individuals in each generation population, g avg represents the average fitness value of each generation population, g' represents the larger fitness value of the two individuals selected for crossover, g represents the fitness value of the individual selected for mutation, and k1, k2 ∈ (0, 1)
[0052] The mutation probability is calculated by the following formula,
[0053]
[0054] Wherein, P m represents the mutation probability, k3, k4 ∈ (0, 1)
[0055] By adjusting k1, k2, k3, k4 to take values in the interval (0, 1), the crossover probability P c and the mutation probability P m can be adaptively adjusted.
[0056] If a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated.
[0057] After the genetic operation, similar individual elimination strategy is used to eliminate similar individuals in the population.
[0058] Before the selection operation, the chromosome fitness search strategy is used to make the obtained solution appear in different forms and improve the quality of the solution.
[0059] The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm as described above, preferably, the step S7 adopts a variable neighborhood search algorithm to search the genetic population, calculates the fitness value, if the evolution reaches a better individual, the corresponding individual is replaced, and the individual optimal fitness value or the global optimal value is updated, and the next offspring p(g+1) is generated, and specifically comprises the following steps:
[0060] The variable neighborhood search algorithm is adopted to search the genetic population after the genetic algorithm, wherein the variable neighborhood search algorithm comprises at least one of an insert operator, an inverse operator, a swap operator and a pairwise operator, and specifically comprises the following steps:
[0061] The neighborhood search is performed on the genetic population, and the count t=1.
[0062] The fitness value of the neighborhood solution is calculated, the best solution in the fitness value is compared with the historical optimal solution and the individual optimal solution, and the better solution is used to cover the chromosome in the population, and t=t+1.
[0063] The present application provides a flexible job shop scheduling method based on an improved particle swarm genetic hybrid algorithm, which combines a particle swarm optimization (PSO) algorithm with an improved genetic algorithm (GA) and adds a variable neighborhood search algorithm (VNS). A dynamic link strategy is adopted to initialize parameters, then initialize the population, and then calculate the fitness value of the initialized population and record the optimal position and optimal chromosome of the individual and the population. The particle swarm optimization algorithm is executed, the speed and position are updated, and then the optimized genetic algorithm is executed to perform field search on the genetic population, and finally the optimal solution is obtained. By adopting the dynamic link strategy for the improved genetic algorithm and the particle swarm optimization algorithm and adding the variable neighborhood search algorithm to strengthen the local search, the convergence speed and performance of the algorithm are improved, and the optimal solution is obtained. The improved particle swarm genetic hybrid algorithm compensates for the poor population diversity and early maturation of the PSO, compensates for the slow convergence speed of the GA, adds the VNS to compensate for the poor local optimization ability, enhances the performance and practicability of the algorithm, and improves the flexible job shop scheduling efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0064] To make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described below with reference to the drawings, in which:
[0065] Figure 1 The flowchart of the embodiment of the flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm provided by the present application is shown in the figure.
[0066] Figure 2 The algorithm logic diagram of the embodiment of the flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0067] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The description of the exemplary embodiments is merely illustrative in nature and is in no way intended to limit the disclosure, its application or uses. The disclosure can be implemented in numerous different forms, not just the embodiments described herein. These embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the disclosure to those skilled in the art. It should be noted that the relative arrangement of the components and steps set forth in these embodiments, the components of the compositions, the numerical expressions and numerical values set forth in these embodiments are to be interpreted as merely exemplary, rather than a limitation.
[0068] The terms "first", "second", and similar terms used in the present disclosure do not denote any order, quantity, or importance, but are used to distinguish different parts. The terms "include" or "contain" and similar terms mean that the elements before the terms encompass the elements listed after the terms, and do not exclude the possibility of also encompassing other elements. "Up", "down", and the like are used only to indicate relative positional relationships, and when the absolute position of the described object changes, the relative positional relationship can also change accordingly.
[0069] In the present disclosure, when it is described that a specific component is located between a first component and a second component, there can be an intervening component between the specific component and the first component or the second component, or there can be no intervening component. When it is described that a specific component is connected to other components, the specific component can be directly connected to the other components without an intervening component, or can not be directly connected to the other components with an intervening component.
[0070] All terms used in the present disclosure, including technical terms or scientific terms, have the same meanings as those understood by a person of ordinary skill in the art to which the present disclosure belongs, unless otherwise specifically defined. It should also be understood that terms defined in general dictionaries should be interpreted to have meanings consistent with their meanings in the context of the relevant art, and should not be interpreted in an idealized or extremely formalized sense, unless otherwise explicitly defined herein.
[0071] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered as part of the specification where appropriate.
[0072] As shown in Figure 1 and Figure 2 The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm provided by the embodiment specifically includes the following steps in actual execution process:
[0073] Step S1: Initialize parameters, take the minimum of the longest completion time of each process as the objective function, and establish a flexible job shop scheduling model.
[0074] In an implementation of the flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm of the present invention, the step S1 may specifically include:
[0075] Step S11: Mathematically represent the flexible job shop scheduling problem.
[0076] For the flexible job shop scheduling problem, given the processing times of each process, determine the processing order and processing times of all workpieces on the machines. First, for the flexible job shop scheduling problem with the minimum makespan of the processes, a model is established. The process of establishing the model is as follows: Suppose there are n workpieces to be processed on m machines, and each workpiece goes through at most h processes. Then the workpiece set is O = {O1, O2, …, O n}, the process set is J = {J n}, where, J i = {j i1 , j i2 , …, j ik , …, j ih}, i = 1, 2, …, n, k = 1, 2, …, h, j ik represents the k-th process of the i-th workpiece. When the number of processes of a workpiece is less than h, for example, a certain workpiece o e has only f processes, e = 1, 2, …, n, f < h, then the values of j ef+1 , j ef+2 ,..., j eh are set to 0;
[0077] The machine set is M = {M1, M2,..., M m}, where, M i = {m i1 , m i2 ,..., m ik ,..., m ih}, i = 1, 2, …, n, k = 1, 2, …, h, m ik represents the machine on which the k-th process of the i-th workpiece is processed. When the number of processes of a workpiece is less than h, for example, a certain workpiece o e has only f processes, e = 1, 2, …, n, f < h, then the values of m ef+1 , m ef+2 ,..., m eh are set to 0;
[0078] The processing time set of each process of the workpiece is T = {T1, T2,..., T n}, where, Ti = {t i1 , t i2 ,...,t ik ,...,t im}, i = 1, 2,..., n, k = 1, 2,..., m, t represents the time required for the i-th workpiece to be processed in the k-th process, when the number of processes of a workpiece is less than h, for example, a certain workpiece o e only f processes, e = 1, 2,..., n, f < h, then t ef+1 , t ef+2 ,...,t eh is set to 0.
[0079] Step S12, initialize parameters, set the number of population individuals to P_SIZE, the maximum number of iterations to G max , the end condition to G end , the velocity range of the particle to v, the inertia weight to w, the first learning factor to c1, the second learning factor to c2, the mutation probability value to Pc, and the crossover probability value to P m .
[0080] Step S13, determine the optimization index of the flexible job shop scheduling problem.
[0081] Specifically, the maximum completion time is used as the optimization index, and the flexible job shop scheduling constraint condition is set,
[0082] the maximum completion time of all processes of all workpieces under the appropriate processing technology is minimized, wherein the flexible job shop scheduling constraint condition is:
[0083] T ijk ≤ S i(j-1)k , which means that a certain process can only start after the previous process is completed,
[0084] T ijk - S ijk = F ijk , which means that a process must be processed until it is completed,
[0085] T jk ≤ T i′j′k′ , which means that each device cannot process two processes at the same time,
[0086] wherein F i represents the completion time of workpiece i, T ijk represents the completion time of the j-th process of workpiece i on machine k, and S ijk represents the start time of the j-th process of workpiece i on machine k.
[0087] Step S2, initialize the population p(g), generate a particle of population size, double-layer coding is carried out, and the generated population is assigned to the chromosome of genetic algorithm.
[0088] Specifically, the double-layer coding method is adopted to initialize the population p(g) to generate a particle of population size, wherein the first half is coded based on the process and composed of process numbers of workpieces to determine the processing order of the process; the second half is coded based on the machine and composed of process numbers of corresponding processing machines of workpieces to determine the selected machine of the process, and the generated population is assigned to the chromosome of genetic algorithm, and the decoding process is the inverse process of coding.
[0089] The coding method shown in Table 1 is that if the process J 11 , J 12 , J 13 , J 21 , J 22 , J 23 , J 31 , J 32 , J 33 Corresponding processing machines are M4, M5, M1, M2, M1, M3, M1, M2, M3, respectively, and the corresponding machine coding part is 4 5 1 2 1 3 1 2 3. If the processing order of the process is J 13 , J 22 , J 33 , J 21 , J 11 , J 32 , J 31 , J 12 , J 23 , the process coding part is 1 2 3 2 1 3 3 12. In specific implementation, reasonable coding can be performed according to the processing scheme, and decoding is regarded as the inverse process of coding.
[0090] Table 1 coding method table
[0091]
[0092] Step S3, solve the fitness value of the initialized population, and record the optimal position and optimal chromosome of the individual and population.
[0093] Specifically, the fitness value F of the initialized population p(g) is calculated according to the workpiece completion time through the following formula i , Wherein, F i represents the fitness value, and f(x) represents the workpiece completion time; and the optimal position and optimal chromosome of the individual and population are recorded
[0094] Step S4, updating the speed and position of the particle according to the optimal value of the last generation population, calculating the fitness value of the updated particle swarm, retaining the optimal value, and replacing the corresponding genetic chromosome with a better individual in the particle swarm.
[0095] In an embodiment of the flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm, the step S4 can specifically include:
[0096] Step S41, updating the speed v and position l of the particle according to the optimal value of the last generation population, calculating the fitness value F of the updated particle swarm, retaining the optimal value, and replacing the corresponding genetic chromosome with a better individual in the particle swarm. i , and calculating the particle updating speed by the following formula:
[0097] v = w * v + c1 * r1 (l best -n present ) + c2 * r2 * (p best -n present )
[0098] wherein v represents the speed of the particle, w represents the inertia weight, c1 represents the first learning factor, c2 represents the second learning factor, r1 and r2 represent random numbers, l best represents the best position of the current individual, and n present represents the current position.
[0099] Step S42, calculating the particle updating position by the following formula:
[0100] n' present = n present + v
[0101] n' present represents the next position of n present .
[0102] Step S5, performing the selection operation of the genetic algorithm by using the compound selection strategy based on the elite solution reservation and roulette.
[0103] Specifically, the compound selection strategy of the elite solution reservation and roulette is used to select the top 10% of the elite individuals with the optimal fitness in the population at each iteration, which are directly evolved to the next generation, and the rest of the individuals are obtained by the selection method of roulette,
[0104] wherein the selection probability P of the individual i is calculated by the following formula,
[0105] the cumulative probability Q of the individual i is calculated by the following formula,
[0106] Step S6, the selection operation, the crossover operation and the mutation operation are performed on the genetic population by using the Elimination of the Similar Individuals (ESI) strategy and the Fitness Exploration of Chromosome (FEC) strategy, and if a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated.
[0107] In an embodiment of the flexible job-shop scheduling method based on the improved particle swarm genetic hybrid algorithm, the step S6 can specifically include:
[0108] Step S61, the crossover and mutation operations are performed after the selection by using the roulette method, wherein,
[0109] The crossover probability is calculated by the following formula,
[0110]
[0111] Wherein, P c represents the crossover probability, g max represents the maximum fitness value of the individuals in each generation population, g avg represents the average fitness value of each generation population, g' represents the larger fitness value of the two individuals selected for crossover, g represents the fitness value of the individual selected for mutation, and k1, k2 ∈ (0, 1)
[0112] The mutation probability is calculated by the following formula,
[0113]
[0114] Wherein, P m represents the mutation probability, and k3, k4 ∈ (0, 1)
[0115] By adjusting k1, k2, k3, k4 to take values in the interval (0, 1), the crossover probability P c and the mutation probability P m can be adaptively adjusted.
[0116] The crossover probability and the mutation probability are important factors affecting the search ability and the convergence speed. The present application proposes the adaptive crossover probability P c and the mutation probability P m .
[0117] Step S62, if a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated.
[0118] Step S63, similar individuals in the population are eliminated by a similar individual elimination (ESI) strategy after genetic operation.
[0119] By the ESI strategy, individuals with higher fitness can be retained, thus improving the search efficiency of the algorithm.
[0120] Step S64, before the selection operation, a chromosome fitness search strategy is used to make the obtained solution appear in different forms and improve the quality of the solution.
[0121] By the FEC strategy, the obtained solution can be made to appear in different forms to some extent, and the quality of the solution can be improved.
[0122] Step S7, a variable neighborhood search algorithm is used to search the genetic population, the fitness value is calculated, if a better individual is evolved, the corresponding individual is replaced, and the individual optimal fitness value or global optimal value is updated, to generate the next offspring p(g+1).
[0123] Specifically, in the present application, a variable neighborhood search algorithm is used to search the genetic population after the genetic algorithm, wherein the variable neighborhood search algorithm includes at least one of the insert operator, the inverse operator, the swap operator and the pairwise operator, and specifically includes:
[0124] The neighborhood of the genetic population is searched, and t=1 is counted.
[0125] The fitness value of the neighborhood solution is calculated, the best solution in fitness is compared with the historical optimal solution and the individual optimal solution, and the chromosome in the population is covered with the better solution, t=t+1.
[0126] By adding the four search operators of the variable neighborhood search to the hybrid algorithm, the neighborhood solution of the chromosome can be expanded, thus the local optimization ability of the particle swarm genetic algorithm can be effectively improved, thus the local search range can be expanded and the local search ability can be enhanced. The four search operators will be introduced respectively.
[0127] The insert operator, for example, positions 2, 6, inserts the gene at position 6 into the position after the gene at position 2, and the original genes 3-5 are sequentially extended backward.
[0128] The inverse operator randomly selects two positions and reverses the genes between the positions.
[0129] The swap operator performs a two-point exchange operation, randomly selects two positions, and exchanges the genes between the positions.
[0130] Pairwis operator, which exchanges the positions of two adjacent pairs of genes, i.e., the first and second genes are exchanged, the third and fourth genes are exchanged, and so on.
[0131] Step S8, according to the maximum search neighborhood number G max , whether to terminate the iteration search, if the iteration is terminated, then perform step S9, if the iteration is not terminated, then perform step S7.
[0132] Step S9, according to the maximum iteration number G end , whether to meet the iteration termination condition, if the condition is met, then output the final result, if not, then return to step S4.
[0133] The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm provided by the embodiment of the application, the hybrid algorithm combines the particle swarm algorithm (PSO) and the improved genetic algorithm (GA), and adds the variable neighborhood search algorithm (VNS), adopts a dynamic link strategy, initializes parameters first, then initializes the population, and then calculates the fitness value of the initialized population and records the optimal position and optimal chromosome of the individual and the population, executes the particle swarm algorithm, updates the speed and position, and then executes the optimized genetic algorithm, performs field search on the genetic population, and finally obtains the optimal solution; the improved genetic algorithm and the particle swarm optimization algorithm are adopted by the dynamic link strategy, and the variable neighborhood search algorithm is added to strengthen the local search, so that the convergence speed and performance of the algorithm are improved, so that the optimal solution is obtained; the improved particle swarm genetic hybrid algorithm compensates for the shortcomings of the PSO population, such as poor diversity and easy to be premature, compensates for the shortcomings of the GA, such as slow convergence speed, and adds the VNS to compensate for the shortcomings of poor local optimization ability, enhances the performance and practicability of the algorithm, and improves the flexible job shop scheduling efficiency.
[0134] So far, the embodiments of the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Those skilled in the art can fully understand how to implement the technical solutions disclosed herein according to the above description.
[0135] Although some specific embodiments of the present disclosure have been described in detail through examples, those skilled in the art should understand that the above examples are only for illustration, but not for limiting the scope of the present disclosure. Those skilled in the art should understand that the above embodiments can be modified or some technical features can be replaced equivalently without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A flexible job shop scheduling method based on an improved particle swarm genetic hybrid algorithm, characterized in that, It comprises the following steps: Step S1, initializing parameters, taking the minimum longest completion time of the process as the objective function, and establishing a flexible job shop scheduling model; Step S2, initializing the population p(g), generating a particle of the population size, and performing double-layer coding, while assigning the generated population to the chromosome of the genetic algorithm; Step S3, solving the fitness value of the initialized population, and recording the optimal position and optimal chromosome of the individual and population; Step S4, updating the speed and position of the particle according to the optimal value of the last generation population, calculating the fitness value of the updated particle swarm, retaining the optimal value, and replacing the corresponding genetic chromosome if a better individual is generated in the particle swarm; Step S5, performing selection operation of the genetic algorithm by using a composite selection strategy based on elite solution reservation and roulette; Step S6, performing selection operation, crossover operation and mutation operation on the genetic population by using similar individual elimination strategy and chromosome fitness search strategy, and replacing the corresponding individual and updating the individual optimal fitness value or global optimal value if a better individual is evolved; Step S7, searching the genetic population by using variable neighborhood search algorithm, calculating the fitness value, replacing the corresponding individual and updating the individual optimal fitness value or global optimal value if a better individual is evolved, and generating the next generation p(g+1); Step S8, judging whether the maximum search neighborhood number G is set max , judging whether the iteration search is terminated, if the iteration is terminated, executing step S9, if the iteration is not terminated, executing step S7; Step S9, judging whether the maximum iteration number G is reached or not end , judging whether the iteration termination condition is met or not, if the condition is met, outputting the final result, otherwise, returning to step S4, The step S1, initializing parameters, taking the minimum longest completion time of the process as the objective function, and establishing a flexible job shop scheduling model, specifically comprises: Mathematical representation of flexible job shop scheduling problem, including: n workpieces are processed on m machines, each workpiece has at most h processes, then the workpiece set is O={O1, O2,..., O n}, the process set is J={J1, J2,..., J n}, wherein, J i ={j i1 ,j i2 ,...,j ik ,...,j ih}, i=1, 2,..., n, k=1, 2,..., h, j ik represents the kth process of the ith workpiece; the machine set is M={M1, M2,..., M m}, wherein, M i ={m i1 ,m i2 ,...,m ik ,...,m ih}, i=1, 2,..., n, k=1, 2,..., h, m ik represents the machine for processing the kth process of the ith workpiece; the process processing time set of the workpiece is T={T1, T2,..., T n}, wherein, T i ={t i1 ,t i2 ,...,t ik ,...,t im}, i=1, 2,..., n, k=1, 2,..., m, t represents the time required for processing the kth process of the ith workpiece; Initialize parameters, set the population size as P_SIZE, the maximum iteration number as G max , the end condition as G end , the velocity range of particles as v, the inertia weight as w, the first learning factor as c1, the second learning factor as c2, the mutation probability value as Pc, and the crossover probability value as P m ; determining the optimization index of the flexible job shop scheduling problem, The determination of the optimization index of the flexible job shop scheduling problem specifically comprises: taking the maximum completion time as the optimization index, and setting the flexible job shop scheduling constraint condition, Maximum makespan The minimum maximum makespan of all jobs under the appropriate processing technology, where the flexible job-shop scheduling constraints are: T ijk ≤S i(j-1)k , indicates that a certain process can only start after the previous one has been completed, T ijk -S ijk = F ijk , indicates that the processing of one process must be carried out until the end, Ti jk ≤T i′j′k′ , which means that each machine cannot process two processes at the same time, where F i denotes the completion time of workpiece i, T ijk denotes the completion time of the jth process of workpiece i on machine k, S ijk denotes the start time of the jth process of workpiece i on machine k.
2. The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm according to claim 1, characterized in that, The step S2, initializing the population p(g), generating a particle of the population size, and performing double-layer coding, while assigning the generated population to the chromosome of the genetic algorithm, specifically comprises: using double-layer coding method to initialize the population p(g) and generate a particle of the population size, wherein the first half is coded based on the process and composed of the process number of the workpiece to determine the processing order of the process; the second half is coded based on the machine and composed of the sequence number of the corresponding processing machine of the workpiece process to determine the selected machine of the process, and the generated population is assigned to the chromosome of the genetic algorithm, and the decoding process is the inverse process of coding.
3. The flexible job shop scheduling method based on the improved particle swarm genetic hybrid algorithm according to claim 1, characterized in that, The step S3, solving the fitness value of the initialized population, and recording the optimal position and optimal chromosome of the individual and population, specifically comprises: According to the workpiece finishing time, the fitness value F of the initialized population p(g) is calculated by the following formula i , where F i represents the fitness value, f(x) represents the workpiece completion time; recording the optimal position and optimal chromosome of the individual and population.
4. The method of claim 1, wherein the improved genetic hybrid algorithm based flexible job shop scheduling method is characterized by, The step S4, updating the speed and position of the particle according to the optimal value of the last generation population, calculating the fitness value of the updated particle swarm, retaining the optimal value, and replacing the corresponding genetic chromosome if a better individual is generated in the particle swarm, specifically comprises: The velocity v and the position l of the particle are updated according to the optimal value of the last generation population, and the fitness value F of the updated particle swarm is calculated i The optimal value is reserved, and if a better individual is generated in the particle swarm, it is replaced into the corresponding genetic chromosome. The particle updating velocity is calculated by the following formula: v = w * v + c1 * r1 (l best -n present ) + c2 * r2 (p best -n present ) where v represents the velocity of the particle, w represents the inertia weight, cl represents the first learning factor, c2 represents the second learning factor, rl and r2 represent random numbers, and l best represents the best position of the current individual, n present represents the current position, The particle update position is calculated by the following formula: n' present = n present + v n' present represents n present the next position.
5. The method of claim 1, wherein the improved genetic hybrid algorithm based flexible job shop scheduling method is characterized by, The step S5, performing selection operation of the genetic algorithm by using a composite selection strategy based on elite solution reservation and roulette, specifically comprises: The elite solution reservation and roulette wheel selection strategy are combined to select the top 10% of the population in each iteration, and the selected individuals are directly evolved to the next generation, The probability P of selecting the individual i is calculated by the following formula, The cumulative probability Q of the individual i is calculated by the following formula, 6. The method of claim 1, wherein the improved genetic hybrid algorithm based flexible job shop scheduling method is characterized by, The step S6 includes the following steps: After the roulette wheel selection, the crossover and mutation operations are performed, and if a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated, specifically including: The crossover probability is calculated by the following formula, where P c represents the crossover probability, g max represents the maximum fitness value of individuals in each generation population, g avg represents the average fitness value of each generation population, g' represents the larger fitness value of the two individuals selected for crossover, g represents the fitness value of the individual selected for mutation, and k1, k2 ∈ (0, 1) The mutation probability is calculated by the following formula, where P m denotes the probability of variation, k3, k4∈(0,1) By adjusting k1, k2, k3, k4 to take values in the interval (0, 1), the crossover probability P can be adaptively adjusted c and the mutation probability P m ; If a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated; After the genetic operation, the similar individual elimination strategy is used to eliminate similar individuals in the population; Before the selection operation, the chromosome fitness search strategy is used to make the obtained solution appear in different forms and improve the quality of the solution.
7. The method of claim 1, wherein the improved genetic hybrid algorithm based flexible job shop scheduling method is characterized by, The step S7 includes the following steps: After the genetic algorithm, the variable neighborhood search algorithm is used to search the genetic population, calculate the fitness value, and if a better individual is evolved, the corresponding individual is replaced and the individual optimal fitness value or the global optimal value is updated to generate the next generation p(g+1), specifically including: The variable neighborhood search algorithm includes at least one of the insert operator, the inverse operator, the swap operator and the pairwise operator, specifically including: The neighborhood search is performed on the genetic population, and the count t is 1; The fitness value of the neighborhood solution is calculated, the best solution is compared with the historical optimal solution and the individual optimal solution, and the better solution is used to cover the chromosome in the population, and t=t+1.
Citation Information
Patent Citations
Hybrid particle swarm optimization algorithm in combination with genetic algorithm
CN108399451A
Vehicle engine body machining process path optimization method based on improved genetic algorithm
CN111259506A
Method for solving flexible job shop scheduling by improved genetic algorithm based on catastrophe mechanism
CN111325443A