An improved genetic algorithm for solving flexible job shop scheduling

Through cross-improving genetic algorithms through partitioning and governance greed initialization and optimal matching intersecting, the problems of low initial solution quality and slow iteration speed in flexible operation workshop scheduling are solved, and more efficient scheduling optimization is achieved.

CN116205292BActive Publication Date: 2025-08-26ANHUI POLYTECHNIC UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310081103.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-16
Publication Date
2025-08-26
Estimated Expiration
2043-01-16

AI Technical Summary

Technical Problem

Traditional genetic algorithms have low initial solution quality, high POX crossover operator randomness and slow iteration speed in flexible operation workshop scheduling, resulting in non-optimal solutions and affecting scheduling efficiency.

Method used

The genetic algorithm is improved by using the greedy initialization strategy and the optimal matching cross-processing method, and partial chromosomes are generated through the greedy algorithm, and the POX cross-operator is optimized in combination with the minimum completion time of the artifact to improve the initial solution quality and iteration speed.

Benefits of technology

The efficiency of the algorithm scheduling tasks in the flexible work workshop is significantly improved, the algebra for finding the optimal solution is shortened, and the quality of the first generation solution is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116205292B_ABST
    Figure CN116205292B_ABST
Patent Text Reader

Abstract

The present invention discloses an improved genetic algorithm for solving flexible job shop scheduling, comprising the following steps: S1, initializing algorithm parameters; S2, generating an initial generation of chromosomes using a divide-and-conquer greedy initialization strategy; S3, extracting individuals with random numbers less than cp as the parent population for the crossover operator, sequentially extracting two chromosomes from the population as crossover parents chro1 and chro2, and using an improved POX operator to generate crossover children child1 and child2; S4, extracting individuals with random numbers less than mp as the parent population for the mutation operator, and adding the mutated individuals to a child population list childList; S5, merging the chromosomes in the child population childList into a total population list chroList; S6, selecting the parent of the next generation according to a tournament selection method; S7, assigning temp data to the total population list chroList; and outputting a global optimal solution. The present invention has the beneficial effects of initializing the initial generation of individuals using a divide-and-conquer greedy initialization strategy to ensure the generation of a relatively optimal initial solution, and proposing an optimal matching crossover method to improve the traditional POX crossover operator, thereby accelerating the convergence speed of the algorithm and improving the solution-finding efficiency of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of production system optimization, in particular to a flexible job shop scheduling method based on an improved genetic algorithm. Background Art

[0002] With the advancement of science and technology, manufacturing processing models are becoming increasingly diverse, complex, and efficient. Traditional job shop scheduling is gradually failing to meet actual needs. Instead, it has been replaced by the flexible job shop scheduling problem (FJSP). Compared to traditional job shop scheduling, FJSP relaxes the constraints on processing machines and is more in line with real-world production conditions. Each process can now be processed by multiple machines, and each process can be processed by one of these machines. Flexible job shop scheduling is a branch of the scheduling problem, first proposed by Bruker et al. in 1990. From the perspective of the time complexity of the problem model, the FJSP problem is a type of NP problem. This type of problem aims to fully utilize limited production resources, coordinate the needs of production departments, and maximize production benefits.

[0003] Although numerous domestic and international scholars and experts have made numerous breakthroughs in flexible job shop scheduling and have proposed numerous excellent and improved algorithms to address the challenges of flexible job shop scheduling, many algorithms still face some challenges. Therefore, overcoming and resolving the challenges of scheduling optimization algorithms remains one of the most important challenges in the field of flexible job shop scheduling research.

[0004] At present, many experts and scholars at home and abroad are committed to the research of intelligent algorithms for scheduling optimization. Commonly used intelligent optimization algorithms include particle swarm optimization algorithm, hybrid frog leaping algorithm, ant colony optimization algorithm, wolf pack algorithm and genetic algorithm.

[0005] Genetic algorithms (GAs) mimic the principles of selection and genetics in nature to find optimal solutions. GAs have three basic operators: selection, crossover, and mutation. Compared to other intelligent optimization algorithms, GAs offer advantages such as fast, random search capabilities independent of the problem domain, search inspired by evaluation functions, a simple process, scalability, and ease of integration with other algorithms. However, GAs also have significant drawbacks, such as a certain dependence on the selection of the initial population, the requirement for proper problem encoding, and the selection of parameters for the three operators. To address these issues, the present invention proposes an improved genetic algorithm for solving the flexible job shop scheduling problem. The chromosome encoding scheme utilizes a process sequence and machine sequence encoding scheme. To ensure optimal initial solutions, a combination of greedy and random individual generation mechanisms is used for the process and machine sequences, respectively. Based on this, a divide-and-conquer greedy initialization strategy is proposed. Furthermore, the traditional POX crossover method is improved by incorporating the minimum completion time of each workpiece in the parent chromosome, and an optimal matching crossover method is proposed. Summary of the Invention

[0006] The purpose of the present invention is to provide an improved genetic algorithm for solving flexible job shop scheduling. This method can overcome the shortcomings of traditional genetic algorithms, such as low initial solution quality, completely random POX crossover operator, slow algorithm iteration speed, and non-optimal solutions, thereby improving the efficiency of the algorithm in solving flexible job shop scheduling tasks.

[0007] In the improved genetic algorithm proposed in the present invention, the chromosome encoding method is an encoding scheme based on the process sequence and the machine sequence, such as Figure 1 shown.

[0008] Considering that in traditional genetic algorithms, both process and machine sequences are often randomly generated, the quality of the algorithm's initial solutions is often low. To address this problem, the present invention proposes a divide-and-conquer greedy initialization strategy. That is, when generating an individual chromosome, a portion of the process or machine sequence is randomly generated, while the other portion of the chromosomes is generated using a greedy algorithm. The advantage of this strategy is that the randomly generated chromosome portion ensures the randomness of the solution, while the chromosome portion generated by the greedy algorithm ensures better solution quality. Therefore, the solution generated by the initialization strategy of the present invention will have the combined advantages of high randomness and high fitness.

[0009] When the process part of the chromosome of an individual is randomly generated, let O i,0 ,O i,1 ,O i,2 ,O i,3 ...O i,N , O i,Nis the number of the Nth process in the process sequence of the i-th chromosome, and when the machine part is generated by the greedy algorithm, the nth machine number in the machine sequence is M i,n The selection criteria are as follows:

[0010] F(M i,n )=min(F(M i,k0 ),F(M i,k1 )...F(M i,k* )) (1)

[0011] F(M i,k )=[O i,0 ,O i,1 ...O i,k |M i,0 ,M i,1 ...M i,k-1 ,M i,k ].fitness() (2)

[0012] M i,k0 ,M i,k1 ...M i,k* ∈allowed_machine(3)

[0013] Where, F is the chromosome fitness calculation function, [O i,0 ,O i,1 ...O i,k |M i,0 ,M i,1 ...M i,k-1 ] is the known front part of the chromosome, F(M i,k ) will return the chromosome based on this part and use the machine number parameter M i,k The corresponding fitness is defined as shown in formula (2), where allowed_machine is the processing step O. i,n List of legal machines.

[0014] When the machine part of a chromosome of an individual is randomly generated, let M i,0 ,M i,1 ,M i,2 ,M i,3 ...M i,N , M i,N is the number of the Nth machine in the machine sequence of the i-th chromosome, and when the process part is generated by the greedy algorithm, the nth process O in the process sequence i,n The selection criteria are as follows:

[0015] F'(O i,n )=min(F'(O i,k0 ),F'(O i,k1)...F'(O i,k* )) (4)

[0016] F'(O i,k )=[O i,0 ,O i,1 ...O i,k-1 ,O i,k |M i,0 ,M i,1 ...M i,k ].fitness() (5)

[0017] O i,k0 ,O i,k1 ...O i,k* ∈allowed_procedure(6)

[0018] Where, F' is the chromosome fitness calculation function, [O i,0 ,O i,1 ...O i,k-1 |M i,0 ,M i,1 ...M i,k ] is the known front part of the chromosome, F'(O i,k ) will return the chromosome based on this part and use the process number parameter O i,k The corresponding fitness is defined as shown in formula (5), where allowed_procedure is the machine M i,k A list of legal procedures that can be processed. Note that if allowed_procedure is empty, the current machine number needs to be randomly replaced with another machine number and the procedure selection steps need to be repeated.

[0019] In the traditional POX crossover operator, all artifacts are first divided into two categories, set as class1 and class2. Then, the processes of artifacts in class1 are completely inherited from the parent chromosome chro1 to the child child1, and the processes of artifacts in class2 are completely inherited from the parent chromosome chro2 to the child child2. Then, the processes of class2 in chro2 are sequentially filled into the vacant positions in child1, and the processes of class1 in chro1 are sequentially filled into the vacant positions in child2.

[0020] Considering that the purpose of the crossover operator is to produce better individuals as much as possible, and the division operation of the workpieces in the POX operator is random, the present invention incorporates the minimum completion time of each workpiece in the parent chromosome and proposes an optimal matching crossover method to improve the POX operator.

[0021] First, suppose there are N workpieces J1, J2, J3...J N , calculate the minimum completion time of each workpiece in the parent chromosome chro1 and chro2 respectively, set it as and Then any workpiece J n The division rule of (1≤n≤N) is formula (7).

[0022]

[0023] The technical solution adopted by the present invention to solve its technical problem is:

[0024] An improved genetic algorithm for solving flexible job shop scheduling includes the following steps:

[0025] S1. Initialize algorithm parameters, such as the maximum number of iterations T, population size, and the number of jobs. m , Maximum number of processes Pc m 、Number of machines Mc m , crossover probability cp, mutation probability mp, total population list chroList and child population list childList are empty;

[0026] S2. Generate the first generation of chromosomes using the divide-and-conquer greedy initialization strategy according to equations (1) to (6). That is, the generation process of each chromosome includes substeps S2.1 to S2.5:

[0027] S2.1. Generate a random number between 0 and 1. If the random number is less than 0.5, randomly generate a solution sequence for the process part of the chromosome, set i = 1, and execute S2.2. Otherwise, randomly generate a solution sequence for the machine part of the chromosome, set i = 1, and execute S2.4.

[0028] S2.2, select the number of the i-th processing machine according to equations (1) to (3);

[0029] S2.3. Have all processing machines been determined? If so, end the chromosome generation process and return the result; if not, set i = i + 1 and execute S2.2.

[0030] S2.4, select the number of the i-th processing step according to equations (4) to (6);

[0031] S2.5. Have all the processing steps been determined? If so, end the chromosome generation process and add the result to the total population list chroList; if not, set i = i + 1 and execute S2.4;

[0032] S3. Generate a random number for each individual, and take out the individuals whose random numbers are less than cp as the parental population of the crossover operator. Then, take out two chromosomes from this population as the crossover parents chro1 and chro2 in turn, and use the improved POX operator based on the optimal matching crossover method of the present invention to generate the crossover offspring child1 and child2. Each round of the crossover process mainly includes sub-steps S3.1 to S3.6:

[0033] S3.1. Initialize two empty lists class1 and class2 for classification, and set i = 1;

[0034] S3.2. Calculate the minimum completion time of the i-th workpiece in the parental chro1 and chro2 respectively, and denote them as t1 and t2;

[0035] S3.3. Is t1 ≤ t2? If so, add workpiece i to class1; otherwise, add workpiece i to class2;

[0036] S3.4. Is i = the maximum number of workpieces? If not, then i = i + 1 and execute S3.2; otherwise, execute S3.5;

[0037] S3.5. Completely inherit the workpiece processes and the corresponding processing machines in class1 of chro1 to the offspring child1, completely inherit the workpiece processes and the corresponding processing machines in class2 of chro2 to the offspring child2, inherit the workpiece processes and the corresponding processing machines in class by the order of chro2 to the offspring child1, and inherit the workpiece processes and the corresponding processing machines in class1 of chro1 to the offspring child2 in order;

[0038] S3.6. Add the two crossover offspring child1 and child2 to the offspring population list childLis;

[0039] S4. Generate a random number for each individual, and take out the individuals whose random numbers are less than mp as the parental population of the mutation operator. Then, perform the following operations on each mutated individual in turn:

[0040] Randomly select a process at a position A in the process sequence, and then randomly select a position B, where A ≠ B. If A < B, then move the process sequence between (A, B] forward by one position; otherwise, move the process sequence between [B, A) forward by one position. Then, insert the original position A to a position B. Finally, check the legality of the machine sequence, and randomly replace the illegal machine numbers with legal machine numbers, and add the mutated individual to the offspring population list childList;

[0041] S5, merge the chromosomes in the offspring population childList into the total population list chroList;

[0042] S6. The parent generation of the next generation is selected according to the tournament selection method. The selection operation is repeated population times. Each selection operation is as follows: three chromosome individuals are randomly selected from the total population list chroList, and the chromosome individual with the smallest fitness, i.e., the completion time, is added to the temp list. Temp is initially empty.

[0043] S7, assign temp data to the total population list chroList;

[0044] S8. Has the maximum number of iterations been reached? If not, increment the number of iterations by 1 and execute S3; otherwise, execute S9.

[0045] S9. Output the global optimal solution and exit the program.

[0046] The beneficial effects of the present invention are as follows: first, a divide-and-conquer greedy initialization strategy is proposed to initialize the first-generation individuals to ensure the generation of a better initial solution, thereby providing a good start for subsequent optimization operations; second, the minimum completion time of each workpiece in the parent chromosome is considered, and an optimal matching crossover method is proposed to improve the traditional POX crossover operator, thereby accelerating the convergence speed of the algorithm and improving the solution-finding efficiency of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0048] Figure 1 FJSP chromosome coding scheme;

[0049] Figure 2 The present invention improves the genetic algorithm flow chart;

[0050] Figure 3 Flowchart of the divide-and-conquer greedy initialization strategy;

[0051] Figure 4 Improved POX operator flow chart based on optimal matching crossover method;

[0052] Figure 5 The optimal result obtained by traditional genetic algorithm;

[0053] Figure 6 The present invention improves the optimal result obtained by the genetic algorithm;

[0054] Figure 7 Convergence curves of the two algorithms;

[0055] Figure 8 The present invention improves the scheduling results obtained by the genetic algorithm;

[0056] Figure 9 The present invention improves the genetic algorithm convergence curve diagram. DETAILED DESCRIPTION

[0057] The purpose of the present invention is to provide an improved genetic algorithm for solving flexible job shop scheduling. This method can overcome the shortcomings of traditional genetic algorithms, such as low initial solution quality, completely random POX crossover operator, slow algorithm iteration speed, and non-optimal solutions, thereby improving the efficiency of the algorithm in solving flexible job shop scheduling tasks.

[0058] The technical solution adopted by the present invention to solve its technical problem is:

[0059] An improved genetic algorithm for solving flexible job shop scheduling, see the flowchart of the improved genetic algorithm of the present invention as shown in FIG. Figure 2 、 Figure 3 and Figure 4 As shown, the following steps are included:

[0060] S1. Initialize algorithm parameters, such as the maximum number of iterations T, population size, and the number of jobs. m , Maximum number of processes Pc m 、Number of machines Mc m , crossover probability cp, mutation probability mp, total population list chroList and child population list childList are empty;

[0061] S2. Generate the first generation of chromosomes using the divide-and-conquer greedy initialization strategy according to equations (1) to (6). That is, the generation process of each chromosome includes S2.1 to S2.5:

[0062] S2.1. Generate a random number between 0 and 1. If it is less than 0.5, randomly generate a solution sequence for the process part of the chromosome, set i = 1, and execute S2.2. Otherwise, randomly generate a solution sequence for the machine part of the chromosome, set i = 1, and execute S2.4.

[0063] S2.2, select the number of the i-th processing machine according to equations (1) to (3);

[0064] S2.3. Have all processing machines been determined? If so, end the chromosome generation process and return the result; if not, set i = i + 1 and execute S2.2.

[0065] S2.4, select the number of the i-th processing step according to equations (4) to (6);

[0066] S2.5. Have all the processing steps been determined? If so, end the chromosome generation process and add the result to the total population list chroList; if not, set i = i + 1 and execute S2.4;

[0067] S3. Generate a random number for each individual, select individuals with random numbers less than cp, and use them as the parent population of the crossover operator. Sequentially select two chromosomes from this population as the crossover parents chro1 and chro2. Use the improved POX operator based on the optimal matching crossover method of the present invention to generate crossover offspring child1 and child2. Each round of crossover process mainly includes S3.1 to S3.6:

[0068] S3.1. Initialize two empty lists class1 and class2 for classification, and set i = 1;

[0069] S3.2. Calculate the minimum completion time of the i-th job in the parent generations chro1 and chro2 respectively, let t1 and t2;

[0070] S3.3. Is t1 ≤ t2? If so, add artifact i to class1; otherwise, add artifact i to class2;

[0071] S3.4, i = maximum number of workpieces? If not, then i = i + 1 and execute S3.2; otherwise, execute S3.5;

[0072] S3.5. Completely inherit the workpiece processes (including the corresponding processing machines) in class1 of chro1 to child child1, completely inherit the workpiece processes (including the corresponding processing machines) in class2 of chro2 to child child2, inherit the workpiece processes (including the corresponding processing machines) in class2 of chro2 to child child1 in sequence, and inherit the workpiece processes (including the corresponding processing machines) in class1 of chro1 to child child2 in sequence;

[0073] S3.6. Add the two crossover offspring, child1 and child2, to the offspring population list, childLis;

[0074] S4. Generate a random number for each individual, and select the individuals with random numbers less than mp as the parental population of the mutation operator. Then, perform the following operations on each mutated individual in turn: randomly select an operation at a position A in the operation sequence, and then randomly select a position B (A ≠ B). If A < B, move the operation sequence between (A, B] one position forward; otherwise, move the operation sequence between [B, A) one position forward. Then, insert the original position A into position B. Finally, check the legality of the machine sequence, randomly replace the illegal machine numbers with legal machine numbers, and add the mutated individual to the child population list childList;

[0075] S5. Incorporate the chromosomes in the child population childList into the total population list chroList;

[0076] S6. Select the parents of the next generation according to the tournament selection method. The selection operation is repeated population times. The specific selection operation each time is: randomly select 3 chromosome individuals from the total population list chroList, and add the chromosome individual with the smallest fitness (completion time) to the temp list (temp is initially empty);

[0077] S7. Assign the temp data to the total population list chroList;

[0078] S8. Has the maximum number of iterations been reached? If not, increment the iteration number by 1 and execute S3; otherwise, execute S9;

[0079] S9. Output the global optimal solution and exit the program.

[0080] The beneficial effects of the present invention are as follows: First, a divide-and-conquer greedy initialization strategy is proposed to initialize the initial individuals to ensure the generation of relatively good initial solutions, thus providing a good start for subsequent optimization operations; Second, the factor of the minimum completion time of each workpiece in the parental chromosomes is considered, and an optimal matching crossover method is proposed to improve the traditional POX crossover operator, thereby accelerating the convergence speed of the algorithm and improving the solution-finding efficiency of the algorithm.

[0081] The effects of the present invention can be further illustrated by the following simulation experiments:

[0082] To verify the correctness and rationality of the present method, programming is carried out using the Python language, and simulations of the traditional genetic algorithm and the improved genetic algorithm of the present invention are respectively performed under the cases shown in Table 1 and Table 2, and the simulation results are statistically analyzed. The main parameter settings are as follows: population size population = 30, maximum number of iterations T = 50, number of workpieces Job m = 6, maximum number of operations Pc m [[ID=m =10, crossover probability cp = 0.8, mutation probability mp = 0.2. The simulation results are shown in Table 1, Table 2, Table 3 and Figure 5 、 Figure 6 and Figure 7 shown.

[0083] Table 1 Processing machine table

[0084]

[0085] Table 2 Processing time

[0086]

[0087] Table 3 Comparison of simulation results

[0088]

[0089] As shown in Table 3, the traditional genetic algorithm found the optimal solution of 48 in the 23rd generation, while the improved genetic algorithm of the present invention found the optimal solution of 46 in just the 4th generation. Furthermore, the average and optimal values ​​of the initial generation solutions of the improved algorithm of the present invention were 63.7 and 50, respectively, which were significantly improved compared to the 72.2 and 55 of the traditional genetic algorithm. Therefore, the improved genetic algorithm of the present invention has a clear advantage over the traditional genetic algorithm in both solution-finding performance and convergence speed.

[0090] In order to further verify the effectiveness of the improved genetic algorithm proposed in the present invention, the performance experiment of the improved algorithm of the present invention is compared with other improved genetic algorithms. Another improved heuristic algorithm is the improved genetic algorithm recorded in the paper "Flexible Workshop Scheduling Optimization Based on Genetic Algorithm" published by Guo Qing et al. in the journal "Science, Technology and Engineering" in 2020. The simulation and comparative analysis of the experimental results are carried out using the method of the present invention under the cases shown in Tables 4 and 5 of the article. Figure 8 、 Figure 9 And shown in Table 4.

[0091] Table 4 Comparison of simulation results

[0092]

[0093] As shown in Table 2, the traditional genetic algorithm and the improved algorithm in the literature achieved the optimal solution of 33 in 91 and 60 generations, respectively, while the improved genetic algorithm of the present invention achieved the optimal solution of 33 in just 5 generations. Furthermore, the optimal solution of the first generation was 36, which is superior to the other two algorithms. Therefore, both the optimization quality and optimization speed of the improved genetic algorithm are superior to those of the traditional genetic algorithm and the other improved genetic algorithms. The above experiments demonstrate the feasibility and practicality of the improved genetic algorithm proposed in this paper for flexible job shop scheduling.

[0094] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Any person skilled in the art can, without departing from the scope of the technical solution of the present invention, utilize the methods and technical contents disclosed above to make many possible changes and modifications to the technical solution of the present invention, or modify it into an equivalent embodiment with equivalent changes. Therefore, any simple modification, equivalent replacement, equivalent change, and modification of the above embodiments made in accordance with the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.

Claims

1. An improved genetic algorithm for solving flexible job shop scheduling, comprising the following steps: S1. Initialize algorithm parameters, such as the maximum number of iterations T, population size, and the number of jobs. m , Maximum number of processes Pc m 、Number of machines Mc m , crossover probability cp, mutation probability mp, total population list chroList and child population list childList are empty; S2, according to formula (1) to (6), use the divide-and-conquer greedy initialization strategy to generate the first generation of chromosomes, F(M i,n )=min(F(M i,k0 ),F(M i,k1 )...F(M i,k* )) (1) F(M i,k )=[O i,0 ,O i,1 ...O i,k |M i,0 ,M i,1 ...M i,k-1 ,M i,k ].fitness() (2) M i,k0 ,M i,k1 ...M i,k* ∈allowed_machine (3) Where, F is the chromosome fitness calculation function, [O i,0 ,O i,1 ...O i,k |M i,0 ,M i,1 ...M i,k-1 ] is the known front part of the chromosome, F(M i,k ) will return the chromosome based on this part and use the machine number parameter M i,k The corresponding fitness is defined as shown in formula (2), where allowed_machine is the processing step O. i,n List of legal machines; When the machine part of a chromosome of an individual is randomly generated, let M i,0 ,M i,1 ,M i,2 ,M i,3 ...M i,N , M i,N is the number of the Nth machine in the machine sequence of the i-th chromosome, and when the process part is generated by the greedy algorithm, the nth process O in the process sequence i,n The selection criteria are as follows: F'(O i,n )=min(F'(O i,k0 ),F'(O i,k1 )...F'(O i,k* )) (4) F'(O i,k )=[O i,0 ,O i,1 ...O i,k-1 ,O i,k |M i,0 ,M i,1 ...M i,k ].fitness() (5) THE i,k0 ,THE i,k1 ...THE i,k* ∈allowed_procedure (6) Where, F' is the chromosome fitness calculation function, [O i,0 ,O i,1 ...O i,k-1 |M i,0 ,M i,1 ...M i,k ] is the known front part of the chromosome, F'(O i,k ) will return the chromosome based on this part and use the process number parameter O i,k The corresponding fitness is defined as shown in formula (5), where allowed_procedure is the machine M i,k A list of legal processes that can be processed. If allowed_procedure is empty, the current machine number needs to be randomly replaced with another machine number and the process selection steps need to be repeated; The generation process of each chromosome includes sub-steps S2.1 to S2.5: S2.

1. Generate a random number between 0 and 1. If the random number is less than 0.5, randomly generate a solution sequence for the process part of the chromosome, set i = 1, and execute S2.

2. Otherwise, randomly generate a solution sequence for the machine part of the chromosome, set i = 1, and execute S2.

4. S2.2, select the number of the i-th processing machine according to equations (1) to (3); S2.

3. Have all processing machines been determined? If so, end the chromosome generation process and return the result; if not, set i = i + 1 and execute S2.

2. S2.4, select the number of the i-th processing step according to equations (4) to (6); S2.

5. Have all the processing steps been determined? If so, end the chromosome generation process and add the result to the total population list chroList; if not, set i = i + 1 and execute S2.4; S3. Generate a random number for each individual, take out individuals with random numbers less than cp, and use them as the parent population of the crossover operator. Sequentially take out two chromosomes from this population as the crossover parents chro1 and chro2, and use the improved POX operator based on the optimal matching crossover method of the present invention to generate the crossover offspring child1 and child2. Each round of crossover process mainly includes substeps S3.1 to S3.6: S3.

1. Initialize two empty lists class1 and class2 for classification, and set i = 1; S3.

2. Calculate the minimum completion time of the i-th job in the parent generations chro1 and chro2 respectively, let t1 and t2; S3.

3. Is t1 ≤ t2? If so, add artifact i to class1; otherwise, add artifact i to class2; S3.

4. Is i = the maximum number of workpieces? If not, then i = i + 1 and execute S3.2; otherwise, execute S3.

5. S3.

5. Completely inherit the workpiece processes and corresponding processing machines in class1 of chro1 to child child1, completely inherit the workpiece processes and corresponding processing machines in class2 of chro2 to child child2, inherit the workpiece processes and corresponding processing machines in class2 of chro2 to child child1 in sequence, and inherit the workpiece processes and corresponding processing machines in class1 of chro1 to child child2 in sequence; S3.

6. Add the two crossover offspring, child1 and child2, to the offspring population list, childLis; S4. Generate a random number for each individual, take out the individuals whose random number is less than mp, and use them as the parent population of the mutation operator. Perform the following operations on each mutated individual in turn: Randomly select an operation at position A from the operation sequence, and then randomly select a position B, where A ≠ B. If A < B, then move the operation sequence between (A, B] forward by one position; Otherwise, move the operation sequence between [B, A) forward by one position, then insert the original position A to position B. Finally, check the legality of the machine sequence, randomly replace the illegal machine numbers with legal machine numbers, and add the mutated individual to the child population list childList; S5. Incorporate the chromosomes in the child population childList into the total population list chroList; S6. Select the parents of the next generation according to the tournament selection method. The selection operation is repeated population times. The specific selection operation each time is: randomly select 3 chromosome individuals from the total population list chroList, and add the chromosome individual with the smallest fitness, that is, the completion time, to the temp list. temp is initially empty; S7. Assign the temp data to the total population list chroList; S8. Has the maximum number of iterations been reached? If not, increment the iteration count by 1 and execute S3; otherwise, execute S9; S9. Output the global optimal solution and exit the program.

Citation Information

Patent Citations

  • Flexible job shop scheduling method and system based on genetic algorithm

    CN113298313A

  • Scheduling method for solving flexible job shop by random greedy initial population genetic algorithm

    CN114266509A