Flexible job shop scheduling optimization method based on hybrid zebra-artificial squirrel algorithm
By hybridizing the zebra-lemming algorithm and combining the Levy flight and sinusoidal candidate step strategies, the local optimal trapping and insufficient search space of the flexible job shop scheduling problem are solved, and efficient scheduling optimization is achieved.
Patent Information
- Application Number
- CN202510879232.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-23
AI Technical Summary
Flexible job shop scheduling problems are prone to falling into local optimal solutions and insufficient search space, making it difficult for existing intelligent optimization algorithms to effectively solve them.
A hybrid zebra-artificial lemmings algorithm is adopted, which combines the exploration phase of the zebra algorithm and the development phase of the artificial lemmings algorithm. The Levy flight strategy and the sinusoidal candidate step strategy are introduced to optimize the scheduling scheme through the continuous-discrete conversion mechanism.
The algorithm has improved its global search and local development capabilities, avoided falling into local optimal solutions, and improved the efficiency and accuracy of solving flexible job shop scheduling problems.
Smart Images

Figure CN120688822A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of production scheduling, and relates to a flexible job shop scheduling optimization method based on a hybrid zebra-artificial lemming intelligent optimization algorithm. Background Art
[0002] Job shop scheduling is an important research area in production planning. The classic job shop scheduling problem requires the processing of multiple workpieces on a set of machines, where each workpiece consists of a series of processes in a fixed order. The flexible job shop scheduling problem, as an important extension of the job shop scheduling problem, is more widely used in actual production. Its characteristic is that each process can be processed on multiple optional machines. The flexible job shop scheduling problem is an NP-Hard combinatorial optimization problem. Because it involves both process sequencing and machine selection, its solution complexity increases significantly.
[0003] In existing research, intelligent optimization algorithms have shown significant advantages in solving such complex optimization problems due to their powerful global search capabilities and adaptability, attracting the attention of many researchers and gradually becoming a powerful tool for solving complex scheduling problems.
[0004] The Zebra Optimization Algorithm (ZOA) is a heuristic optimization algorithm that simulates the behavior of zebra herds. It was proposed by E. Trojovská et al. in 2022. It achieves position updates and optimization by simulating the foraging and defense strategies of zebras. It has strong optimization capabilities and fast convergence. In practical applications, ZOA is used to optimize the initial weights and thresholds of BP neural networks, improving their performance. It is also combined with other techniques for feature extraction and classification, and has demonstrated high accuracy and robustness in areas such as bearing fault identification.
[0005] The Artificial Lemmings Algorithm (AL) is a biomimetic metaheuristic algorithm proposed in 2025. It simulates four typical behaviors of lemmings in nature: migration, burrowing, foraging, and avoiding predators, to achieve a balance between exploration and exploitation during the optimization process. It also introduces an energy-decreasing mechanism to dynamically adjust the ratio of exploration to exploitation, effectively improving the algorithm's ability to escape local optima and converge to global optima. The AL was compared with 17 advanced algorithms on the IEEE CEC2017 and CEC2022 benchmarks. The results showed that the AL achieved the best Friedman mean ranking across multiple dimensions, demonstrating excellent solution accuracy, convergence speed, and stability. Furthermore, the AL has been successfully applied to multiple real-world optimization problems, including constrained engineering design, photovoltaic model parameter identification, and fractional-order PID controller parameter adjustment, fully demonstrating its competitive advantage and application potential in engineering practice. Summary of the Invention
[0006] Aiming at the problem that flexible job shop scheduling problems are prone to falling into local optimal solutions and insufficient search space, the present invention discloses a hybrid zebra-artificial lemming algorithm method for solving flexible job shop scheduling problems, which solves the flexible job shop scheduling problem with the goal of minimizing completion time.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] S1: Establish a mathematical model for the flexible job shop scheduling problem with maximum completion time as the objective function.
[0009] For the flexible job shop scheduling problem, the following constraints need to be met: a. All machines are available at time 0; b. There is no order restriction between the processes of different workpieces; c. Machine interruption is not allowed during the process of machine processing; d. The same machine can only process one process at a time; e. All workpieces have the same priority; f. At any time, only one process can be processed on one machine.
[0010] The description of the above flexible job shop scheduling problem and the constraint modeling are shown in formula (1):
[0011]
[0012] where s pqr is a binary decision variable that is equal to 1 if step q of job p is processed on machine r, and 0 otherwise. represents the start time of workpiece p executing process q on machine r, t r represents the earliest available time of machine r, T represents the end time of workpiece p completing process q on machine r, pqr It represents the processing time of workpiece p performing process q on machine r.
[0013] The objective function of this model is to minimize the maximum completion time, as shown in formula (2):
[0014] f=min{C max} (2)
[0015] Among them C max =max{C1, C2, ... C n}, C1 to C n Respectively represent the time for n workpieces to be completed, C max Indicates the time required to complete all n workpieces.
[0016] S2: A dual sequence is used to represent the feasible solution. The scheduling plan is represented by the process sequence and the machine sequence. The specific representation is as follows:
[0017] The same element in the process sequence represents the same workpiece, the number of times the same workpiece has appeared represents the process of the workpiece, and the value of each element in the machine sequence represents the index of the machine number available for the workpiece process at the corresponding position in the process sequence when arranged from small to large. The lengths of the two sequences are equal. A flexible job shop contains n workpieces and m machines. Workpiece i (i = 1, 2, ..., n-1, n) has J i process, the sequence length of each scheduling plan is
[0018] S3: Initialize the algorithm parameters, set the population size of the hybrid zebra-lemming algorithm, the number of iterations, and the upper and lower limits of the number of candidate steps in the exploration phase.
[0019] S4: Set up a continuous-discrete conversion mechanism to discretize the continuous process sequence and machine sequence after initialization and position update. The specific implementation steps are as follows:
[0020] After the original discrete scheduling plan is updated with the hybrid zebra-lemming algorithm and the population is randomly initialized, a continuous sequence is obtained, at which point the continuous-to-discrete conversion is performed. The continuous process sequence is converted to discrete using the ROV rule. This involves first sorting the continuous process sequence in ascending order of value, then replacing it with the original discrete process sequence in ascending order of value, assigning element numbers (i.e., ROV values), and finally restoring the original continuous process sequence to obtain the updated discrete process sequence. The continuous machine sequence is first rounded up and then subjected to upper and lower bound checks to obtain the updated discrete machine sequence.
[0021] S5: Initialize the population, use random initialization to initialize the population position, calculate the completion time of each individual, and select the individual with the minimum completion time as the global leader. The specific implementation is as follows:
[0022] Each individual's position in the solution space can be represented by a row vector. Each element in this row vector is a sequence element of the scheduling solution. The entire population can be represented by a matrix. During initialization, the positions of individuals in the search space are randomly assigned. The population matrix is shown in Formula (3), the population fitness is shown in Formula (4), and the individual position initialization formula is shown in Formula (5).
[0023]
[0024] x i,j =lb j +r1×(ub j -lb j ) (5)
[0025] Where X represents the entire population, Xi represents individual i, x i,j Indicates the value of the j-dimensional variable of the i-th individual, N is the number of individuals, dim is the number of variables, Y i represents the value of the i-th individual objective function, which is the corresponding completion time, lb j is the lower bound of the j-th dimension variable, ub j is the upper bound of the j-th dimension variable, and r1 represents a random number that satisfies a uniform distribution in (0,1).
[0026] S6: Use the Zebra algorithm exploration phase as the hybrid Zebra-Lemmings algorithm's exploration phase to pre-update all individual positions. Before pre-updating, determine the number of candidate step sizes, use the optimal step size, and add a random perturbation that follows the Levy flight distribution to each individual pre-update. Determine whether the individual's completion time decreases after the update. If so, update the individual's position and further determine whether to update the global leader. Otherwise, do not perform the update. The specific implementation steps are as follows:
[0027] Its position update method is shown in formula (7):
[0028] I=round(1+r2) (6)
[0029]
[0030] If the completion time of the pre-updated scheduling solution is less than the completion time of the pre-updated scheduling solution, the individual position is updated, as shown in formula (8):
[0031]
[0032] in represents the pre-updated solution of individual i in the exploration phase of the hybrid zebra-lemming algorithm, Indicates the corresponding completion time, LeadX indicates the global leader position, r2 indicates a random number that satisfies uniform distribution in (0,1), and round(1+r2) is the value after rounding 1+r2. represents the selected optimal step size, and Levy(β) represents a random perturbation that obeys the Levy flight distribution.
[0033] The random perturbation Levy(β) that obeys the Levy flight distribution is generated using a normal distribution. The specific formula is as follows:
[0034]
[0035] Among them, u obeys the normal distribution, that is, u~N(0,σ 2 ), υ obeys the standard normal distribution, that is, υ~N(0,1), and the value of σ is as follows:
[0036]
[0037] The value of β is 1.5.
[0038] Optimal step length The selection mechanism is as follows:
[0039] An integer is randomly selected within the upper and lower limits of the number of candidate sine step lengths as the candidate step length number, and then the integer is evenly distributed on the unit period sine function to obtain multiple candidate step lengths, as shown in formula (12):
[0040] h=round[hmin+r7×(hmax-hmin)] (11)
[0041]
[0042] Where hmax and hmin are the upper and lower limits of the number of candidate step sizes, respectively. h is the number of candidate step sizes, which is a random integer in the interval [hmin, hmax]. Finally, a total of h candidate step sizes are obtained. r7 represents a random number that satisfies a uniform distribution in (0,1).
[0043] The minimum step length among the h completion times is selected as the pre-update step length:
[0044]
[0045]
[0046]
[0047] in is the scheduling scheme corresponding to the kth candidate step length when the i-th individual is pre-updated in the exploration phase of the hybrid zebra-lemming algorithm, The corresponding completion time is This is the optimal step size selected.
[0048] S7: Use the artificial lemming algorithm development phase as the hybrid zebra-artificial lemming algorithm development phase to pre-update all individual positions. During each individual pre-update, add a random perturbation that follows the Levy flight distribution. Determine whether the individual's completion time decreases after the update. If so, update the individual's position and further determine whether to update the global leader. Otherwise, do not perform the update. The specific implementation steps are as follows:
[0049] In one iteration, the selection criteria for lemmings' foraging behavior and predator avoidance behavior in the development phase are shown in formula (16), where r3 represents a random number that satisfies a uniform distribution in (0,1):
[0050]
[0051] In view of the foraging behavior of lemmings, the artificial lemming algorithm uses the spiral winding mechanism to mathematically model this behavior. Its position update formula is shown in formula (17):
[0052]
[0053] spiral i =radius i ×[sin(2π×r6)+cos(2π×r6)] (19)
[0054]
[0055] in represents the pre-update solution of individual i in the development phase of the hybrid zebra-lemming algorithm, F represents the control factor of the search direction, spiral i is the spiral factor of individual i, simulating the spiral search path of individual i, radius i represents the Euclidean distance between individual i and the global leader, r4, r5, and r6 all represent random numbers that are uniformly distributed in (0,1).
[0056] The mathematical modeling formula for lemmings' behavior of avoiding natural enemies is shown in (21).
[0057]
[0058] Where t is the current iteration number, T is the maximum iteration number, and Levy(β) represents a random perturbation that obeys the Levy flight distribution.
[0059] The position update judgment formula for lemmings' foraging behavior and predator avoidance behavior is the same. If the completion time corresponding to the pre-update scheduling plan is less than the completion time corresponding to the pre-update scheduling plan, the individual's position is updated. As shown in formula (23):
[0060]
[0061] in represents the undetermined solution for individual i in the development phase of the hybrid zebra-lemming algorithm, Indicates the corresponding function value.
[0062] S8: Determine whether the set number of iterations has been reached. If not, repeat S6 and S7. Otherwise, output the optimal scheduling plan and maximum completion time, and draw a Gantt chart.
[0063] Due to the adoption of the above technical solution, the technical advancements achieved by the present invention are:
[0064] 1. The present invention combines the exploration phase of the zebra algorithm and the development phase of the artificial lemming algorithm, retaining the global search capability of the zebra algorithm and the local development capability of the artificial lemming algorithm.
[0065] 2. The present invention introduces the Levy flight strategy into the position update formula. Its heavy-tail characteristic enables the algorithm to make large-scale jumps in the search space, thereby avoiding falling into the local optimal solution.
[0066] 3. In the exploration phase of the zebra algorithm, the present invention introduces a sinusoidal candidate step strategy, introduces randomness and uncertainty by randomly selecting the number of steps, and introduces nonlinearity through the sinusoidal function, thereby effectively improving the search capability of the zebra-lemming algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0068] Figure 1 The flowchart of a flexible job shop scheduling optimization method based on a hybrid zebra-artificial lemming algorithm in an example of the present invention.
[0069] Figure 2 This is a schematic diagram of an example of a flexible job shop scheduling problem with three workpieces and three machines in an example of the present invention.
[0070] Figure 3 Schematic diagram of double sequence encoding in an example of the present invention.
[0071] Figure 4 Schematic diagram of continuous-discrete conversion of process sequence in an example of the present invention.
[0072] Figure 5 This is a flow chart of the sinusoidal candidate step strategy for a single individual in a single iteration in an example of the present invention.
[0073] Figure 6 This is a Gantt chart of the solution results for the flexible job shop scheduling problem with 3 workpieces and 3 machines in the example of the present invention. DETAILED DESCRIPTION
[0074] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0075] The embodiment of the present invention discloses a method for solving the flexible job shop scheduling problem based on a hybrid zebra-lemming algorithm. The content of the present invention is described in detail below with reference to specific embodiments:
[0076] like Figure 1 FIG2 is a flow chart of a flexible job shop scheduling optimization method based on an improved hybrid zebra-artificial lemming optimization algorithm in an embodiment of the present invention. The flexible job shop scheduling optimization method based on the improved hybrid zebra-artificial lemming optimization algorithm includes but is not limited to steps S1 to S8.
[0077] S1: Establish a mathematical model for the flexible job shop scheduling problem.
[0078] S1.1 Problem Description
[0079] In a flexible job shop, there are m machines that need to process n workpieces. To complete workpiece i, several process steps are required. ij represents the jth process of workpiece i, M pq The machine with machine number p is located at position q among all available machines for the corresponding process, sorted in ascending order by machine number. Each process can be performed on at least one machine, and its processing time depends on the capacity of the selected machine.
[0080] Take a simple flexible job shop with three workpieces and three machines as an example: Workpiece 1 has three processes, process 1 can only be processed by machine 3, and the processing time is 4 minutes, process 2 can only be processed by machine 2, and the processing time is 2 minutes, and process 3 can only be processed by machine 1, and the processing time is 3 minutes; Workpiece 2 has two processes, process 1 can only be processed by machine 2, and the processing time is 5 minutes, process 2 can be processed by machine 1 and machine 2, and the processing time is 6 minutes and 3 minutes respectively; Workpiece 3 has two processes, process 1 can be processed by machine 1 and machine 3, and the processing time is 1 minute and 2 minutes respectively, and process 2 can only be processed by machine 3, and the processing time is 7 minutes. Figure 2 As shown in FIG, the processes included in each workpiece in the flexible job shop instance, the machines that can process these workpieces, and the corresponding processing time are given.
[0081] S1.2 Mathematical model
[0082] The production scheduling problem consists of two sub-problems: how to sort all the processes and how to select the processing machine for each process. The ultimate goal is to shorten the total completion time of all workpieces as much as possible.
[0083] The following constraints are typically required for flexible job shop scheduling: 1. All machines are available at time 0. 2. There are no order restrictions between processes for different workpieces. 3. Machine interruptions are not allowed during processing. 4. A machine can only process one process at a time. 5. All workpieces have the same priority. 6. Only one process can be processed on a single machine at any given time.
[0084] Still taking the flexible job shop with three workpieces and three machines as an example, the flexible job shop scheduling problem description and constraint modeling are as follows:
[0085]
[0086] where s pqr is a binary decision variable that is equal to 1 if step q of job p is processed on machine r, and 0 otherwise. represents the start time of workpiece p executing process q on machine r, t r represents the earliest available time of machine r, T represents the end time of workpiece p completing process q on machine r, pqr It represents the processing time of workpiece p performing process q on machine r.
[0087] The objective function of this model is to minimize the maximum completion time, as follows:
[0088] f=min{C max} (25)
[0089] Among them C max = max{C1, C2, C3}, where C1, C2, and C3 represent the completion times of workpiece 1, workpiece 2, and workpiece 3, respectively. max Indicates the completion time of these three workpieces.
[0090] S2: Use dual sequences to represent the scheduling scheme.
[0091] In this paper, the processes and machines in the flexible job shop scheduling problem are encoded into sequences to determine the process sequence (OS) and the corresponding machine sequence (MS). The lengths of the two sequences are equal. Assume that a flexible job shop contains n workpieces and m machines, and job i (i = 1, 2, ... n) has J i operations, then the sequence length of each scheduling scheme is
[0092] Taking the flexible job shop scheduling problem of 3 workpieces and 3 machines as an example, we can get the total number of processes is 7, and the sequence length of the scheduling scheme is 2 times the total number of processes, that is, 14. One of the scheduling schemes is as follows: [1213132; 1112112], and the schematic diagram of the scheduling scheme is shown in the figure below. Figure 3 As shown. Its OS sequence represents the workpiece processing order, and each element of the MS sequence is the position index of the selected machine in the sorted sequence after sorting the machines in ascending order in the set of all available machines corresponding to the process in the OS sequence. The OS sequence is 1213132, which means that its workpiece processing order is: workpiece 1 process 1, workpiece 2 process 1, workpiece 1 process 2, workpiece 3 process 1, workpiece 1 process 3, workpiece 3 process 2, workpiece 2 process 2 (O 11 , O 21 , O 12 , O 31 , O 13 , O 32 , O 22 The MS sequence is 1112112, indicating that the machines used in the corresponding process are: machine 3, machine 2, machine 2, machine 3, machine 1, machine 3, machine 2 (M 31 、M 21 、M 21 、M 32 、M 11 、M 31 、M 21 ).
[0093] S3: Initialize algorithm hyperparameters
[0094] The hybrid zebra-lemming algorithm proposed in this paper is a population-based optimization algorithm. It treats each set of candidate solutions as an individual, the entire solution space as the individual's range of motion, and the function value obtained for a set of candidate solutions as the individual's environmental fitness. The hybrid zebra-lemming algorithm uses a population size of 10 individuals, 100 iterations, and a candidate step size range of [1, 10] in the exploration phase.
[0095] S4: Designing a continuous-discrete conversion mechanism
[0096] Because traditional intelligent optimization algorithms are often used to solve continuous problems, flexible job shop scheduling is a discrete problem. Therefore, the continuous process sequence and machine sequence after initialization and position update need to be discretized. Taking the scheduling solution [1213132; 3221132] for the flexible job shop scheduling problem with three workpieces and three machines described in step S2 as an example, after position update using the improved hybrid zebra-lemming optimization algorithm, the resulting individual position vectors are [1.52.72.20.41.72.40.5; 0.60.81.00.61.10.81.2].
[0097] At this point, continuous-discrete conversion is required. The continuous-discrete conversion diagram of OS sequence using ROV rule is as follows: Figure 4 As shown in the figure. The continuous OS is sorted in ascending order as [0.40.51.51.72.22.42.7]. This is replaced by the discrete OS in ascending order as [1112233]. The ROV value is assigned, and the original continuous OS is restored in ascending order. The updated discrete OS is [1321231]. The continuous MS is rounded up to the integer to obtain the sequence [1111212]. The updated discrete MS sequence is [1111211] after checking the upper and lower limits.
[0098] S5: Initialize the population
[0099] The position of each individual in the solution space can be represented by a row vector. Each element in this row vector is a sequence element of the scheduling solution. The entire population can be represented by a matrix. During initialization, the positions of individuals in the search space are randomly assigned. The population matrix is shown in Equation (26), the population fitness is shown in Equation (27), and the individual position initialization formula is shown in Equation (28).
[0100]
[0101] x i,j =lb j +r1×(ub j -lb j ) (28)
[0102] Where X represents the entire population, X i represents individual i, x i,j Indicates the value of the j-dimensional variable of the i-th individual, N is the number of individuals, dim is the number of variables, Y i represents the value of the i-th individual objective function, which is the corresponding completion time, lb j Represents the lower bound of the j-th dimension variable, ub j Represents the upper bound of the j-th dimension variable, and r1 represents a random number that satisfies a uniform distribution in (0,1).
[0103] S6: Hybrid Zebra-Artificial Lemming Algorithm Exploration Phase
[0104] The exploration phase of the hybrid zebra-lemming algorithm is used as the exploration phase, pre-updating all individual positions. The candidate step sizes are determined before the pre-update, and the optimal step size is used during the pre-update. During each individual pre-update, a random perturbation following the Levy flight distribution is added to determine whether the individual's completion time decreases after the update. If so, the individual's position is updated, and further determination is made whether the global leader should be updated. Otherwise, the update is not performed.
[0105] S6.1 Zebra Algorithm Exploration Phase
[0106] The position update formula of the zebra algorithm exploration phase is shown in formula (30):
[0107] I=round(1+r2) (29)
[0108]
[0109] If the completion time of the pre-updated scheduling solution is less than the completion time of the pre-updated scheduling solution, the individual position is updated, as shown in formula (31):
[0110]
[0111] in represents the pre-updated solution of individual i in the exploration phase of the hybrid zebra-lemming algorithm, Indicates the corresponding completion time, LeadX indicates the global leader position, r2 indicates a random number that satisfies uniform distribution in (0,1), and round(1+r2) is the value after rounding 1+r2. represents the selected optimal step size, and Levy(β) represents a random perturbation that obeys the Levy flight distribution.
[0112] S6.2 Levy Flight Strategy
[0113] A random perturbation term that obeys the Levy flight distribution is added to the position update formula of the hybrid zebra-artificial lemming algorithm in the exploration and development phases. The position update formula after introducing the Levy flight strategy is as follows:
[0114]
[0115] in is the undetermined solution of individual i in the hybrid zebra-lemming algorithm, Levy(β) is a random perturbation that obeys the Levy distribution, and the random number is generated using the normal distribution. The specific formula is as follows:
[0116]
[0117] Among them, u obeys the normal distribution, that is, u~N(0,σ 2 ). υ follows a standard normal distribution, i.e., υ~N(0,1). The values of σ are as follows:
[0118]
[0119] The value of β is 1.5.
[0120] S6.3 Sine Candidate Step Size Strategy
[0121] The sinusoidal candidate step strategy is used in the exploration phase of the hybrid zebra-lemming algorithm. The flow chart of the sinusoidal candidate step strategy is as follows: Figure 5 It introduces multiple candidate step sizes, and the selection mechanism for the best candidate step size is as follows:
[0122] An integer is randomly selected within the upper and lower limits of the number of candidate sine step lengths as the candidate step length number, and then the integer is evenly distributed on the unit period sine function to obtain multiple candidate step lengths, as shown in formula (36):
[0123] h=round[hmin+r7×(hmax-hmin ) ](35)
[0124]
[0125] Where hmax and hmin are the upper limit 10 and lower limit 1 of the candidate step lengths respectively, h is the candidate step length number, which is a random integer in the interval [1, 10]. Finally, a total of h candidate step lengths are obtained, and r7 represents a random number that satisfies uniform distribution in (0, 1).
[0126] The minimum step length among the h completion times is selected as the pre-update step length:
[0127]
[0128]
[0129]
[0130] in is the scheduling scheme corresponding to the kth candidate step length when the i-th individual is pre-updated in the exploration phase of the hybrid zebra-lemming algorithm, The corresponding completion time is This is the optimal step size selected.
[0131] S6.4 Global Leader Update
[0132] If the completion time corresponding to the current individual's scheduling solution is less than the completion time corresponding to the global leader's scheduling solution, the global leader's position is updated, as shown in formula (40):
[0133]
[0134] Among them, LeadY represents the completion time corresponding to the scheduling plan obtained by the global leader.
[0135] S7: Hybrid Zebra-Artificial Lemming Algorithm Development Stage
[0136] The hybrid zebra-artificial lemmings algorithm uses the artificial lemmings algorithm development phase as the development phase to pre-update all individual positions. During each individual pre-update, a random perturbation following the Levy flight distribution is added to determine whether the individual's completion time decreases after the update. If so, the individual's position is updated and further determines whether the global leader should be updated. Otherwise, the update is not performed.
[0137] S7.1 Artificial Lemming Algorithm Development Stage
[0138] The inspiration for the artificial lemming development phase comes from the lemmings' foraging behavior and their avoidance of predators. The formula for selecting the lemmings' foraging behavior and their avoidance of predators during an iterative development phase is as follows:
[0139]
[0140] Where r4 represents a random number that satisfies uniform distribution in (0,1).
[0141] S7.1.1 Foraging behavior
[0142] In view of the foraging behavior of lemmings, the artificial lemming algorithm uses a spiral winding mechanism to mathematically model this behavior. Its position update formula is shown in formula (42):
[0143]
[0144]
[0145] spiral i =radius i ×[sin(2π×r6)+cos(2π×r6)] (44)
[0146]
[0147] in represents the pre-update solution of individual i in the development phase of the hybrid zebra-lemming algorithm, F represents the control factor of the search direction, spiral iis the spiral factor of individual i, simulating the spiral search path of individual i, radius i represents the Euclidean distance between individual i and the global leader, r4, r5, and r6 all represent random numbers that are uniformly distributed in (0,1).
[0148] S7.1.2 Behavior to avoid natural enemies
[0149]
[0150]
[0151] Where t is the current iteration number and T is the maximum iteration number. Levy(β) represents a random perturbation that follows the Levy flight distribution.
[0152] The position update judgment formula for lemmings' foraging behavior and predator avoidance behavior is the same. If the completion time corresponding to the pre-update scheduling plan is less than the completion time corresponding to the pre-update scheduling plan, the individual's position is updated. As shown in formula (48):
[0153]
[0154] in represents the undetermined solution for individual i in the development phase of the hybrid zebra-lemming algorithm, Indicates the corresponding function value.
[0155] S7.2 Levy flight strategy
[0156] The implementation method of the Levy flight strategy in the artificial lemming algorithm is consistent with the implementation method of the Levy flight strategy in the zebra algorithm, as shown in formula (32) in step S6.2.
[0157] S7.3 Global Leader Update
[0158] The global leader update method in the artificial lemming algorithm is consistent with the global leader update method in the zebra algorithm, as shown in formula (40) in step S6.4.
[0159] S8: Optimization end condition judgment
[0160] Determine whether the set number of iterations 100 has been reached. If not, repeat steps S6 and S7. Otherwise, output the optimal scheduling solution and the maximum completion time, and draw a Gantt chart of the optimal scheduling solution. The Gantt chart of the optimal scheduling solution for the flexible job shop example with 3 workpieces and 3 machines is as follows: Figure 6 As shown in the figure, the rectangle represents the process, the vertical axis corresponding to the rectangle is the processing machine used in the process, and the horizontal axis is the processing time of the process.
[0161] The above is a specific description of a relatively simple implementation of the present invention, but the present invention is not limited to the above-mentioned scale implementation. Those skilled in the art can also apply it to implementations of different scales without violating the spirit of the present invention. The application of this patent to implementations of these different scales is included in the scope defined by the claims of the present invention.
Claims
1. A flexible job shop scheduling optimization method based on a hybrid zebra-lemming algorithm, characterized in that: The following steps are involved: S1: Establish a mathematical model for the flexible job shop scheduling problem with maximum completion time as the objective function; S2: A dual sequence is used to represent the feasible solution, and the scheduling plan is represented by the process sequence and the machine sequence; S3: Initialize the algorithm parameters, set the population size of the hybrid zebra-lemming algorithm, the number of iterations, and the upper and lower limits of the number of candidate steps in the exploration phase; S4: Set up a continuous-discrete conversion mechanism to discretize the continuous process sequence and machine sequence after initialization and position update; S5: Initialize the population, use random initialization to initialize the population position, calculate the completion time of each individual, and select the individual with the minimum completion time as the global leader; S6: Use the exploration phase of the Zebra algorithm as the exploration phase of the hybrid Zebra-Lemmings algorithm to pre-update all individual positions. Before pre-updating, determine the number of candidate step sizes, use the optimal step size during pre-updating, and add a random perturbation that follows the Levy flight distribution during each individual pre-update. Determine whether the individual completion time decreases after the update. If so, update the individual position and further determine whether to update the global leader. Otherwise, do not perform the update. S7: Use the artificial lemming algorithm development phase as the hybrid zebra-artificial lemming algorithm development phase to pre-update all individual positions. During each individual pre-update, add a random perturbation that follows the Levy flight distribution to determine whether the individual completion time decreases after the update. If so, update the individual position and further determine whether to update the global leader. Otherwise, do not perform the update. S8: Determine whether the set number of iterations has been reached. If not, repeat S6 and S7. Otherwise, output the optimal scheduling plan and maximum completion time.
2. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: The specific content of the mathematical model of the flexible job shop scheduling problem established in step S1 is as follows: For the flexible job shop scheduling problem, the following constraints must be met: a. All machines are available at time 0; b. There is no order restriction between processes of different workpieces; c. Machine interruption is not allowed while the machine is processing a process; d. The same machine can only process one process at a time; e. All workpieces have the same priority; f. At any time, only one process can be processed on a single machine. The description of the above flexible job shop scheduling problem and the constraint modeling are shown in formula (1): where s pqr is a binary decision variable that is equal to 1 if process q of workpiece p is processed on machine r, and 0 otherwise; represents the start time of workpiece p executing process q on machine r, t r represents the earliest available time of machine r, T represents the end time of workpiece p completing process q on machine r, pqr represents the processing time of workpiece p performing process q on machine r; The objective function of this model is to minimize the maximum completion time, as shown in formula (2): f=min{C max } (2) Among them C max =max{C1, C2, ... C n }, C1 to C n Respectively represent the time for n workpieces to be completed, C max Indicates the time required to complete all n workpieces.
3. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: The method for expressing the feasible solution by the process sequence and machine sequence in step S2 is as follows: The same element in the process sequence represents the same workpiece, the number of times the same workpiece has appeared represents the process of the workpiece, and the value of each element in the machine sequence represents the index of the machine number available for the workpiece process at the corresponding position in the process sequence when arranged from small to large. The lengths of the two sequences are equal; a flexible job shop contains n workpieces and m machines, and workpiece i (i = 1, 2, ..., n-1, n) has J i process, the sequence length of each scheduling plan is 4. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: The specific implementation steps of the continuous-discrete conversion mechanism in step S4 are as follows: After the original discrete scheduling plan is updated by the hybrid zebra-lemming algorithm and the population is randomly initialized, a continuous sequence is obtained, and a continuous-to-discrete conversion is performed at this time; the continuous process sequence is converted from continuous to discrete using the ROV rule, that is: first, the continuous process sequence is arranged in ascending order of value, and then replaced with the original discrete process sequence arranged in ascending order of value, and element numbers (i.e., ROV values) are assigned, and finally the original continuous process sequence arrangement is restored to obtain the updated discrete process sequence; the continuous machine sequence is first rounded up and then checked against upper and lower limits to obtain the updated discrete machine sequence.
5. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: The specific implementation steps of randomly initializing the population in step S5 are as follows: The position of each individual in the solution space can be represented by a row vector. Each element in the row vector is the sequence element of the scheduling scheme. The entire population can be represented by a matrix. During initialization, the position of individuals in the search space is randomly assigned. The population matrix is shown in formula (3), the population fitness is shown in formula (4), and the individual position initialization formula is shown in formula (5). x i,j =lb j +r1×(ub j -lb j ) (5) Where X represents the entire population, X i represents individual i, x i,j Indicates the value of the j-dimensional variable of the i-th individual, N is the number of individuals, dim is the number of variables, Y i represents the value of the i-th individual objective function, which is the corresponding completion time, lb j is the lower bound of the j-th dimension variable, ub j is the upper bound of the j-th dimension variable, and r1 represents a random number that satisfies a uniform distribution in (0,1).
6. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: The exploration phase of the hybrid zebra-lemming algorithm in step S6 adopts the exploration phase of the zebra optimization algorithm, and introduces the Levy flight strategy and the sinusoidal candidate step strategy. Its position update method is shown in formula (7): I=round(1+r2) (6) If the completion time of the pre-updated scheduling solution is less than the completion time of the pre-updated scheduling solution, the individual position is updated, as shown in formula (8): in represents the pre-updated solution of individual i in the exploration phase of the hybrid zebra-lemming algorithm, Indicates the corresponding completion time, LeadX indicates the global leader position, r2 indicates a random number that satisfies uniform distribution in (0,1), and round(1+r2) is the value after rounding 1+r2. represents the optimal step size selected, and Levy(β) represents a random perturbation that obeys the Levy flight distribution.
7. The flexible job shop scheduling optimization method based on the hybrid zebra-lemming algorithm according to claim 1 is characterized in that: In step S7, the hybrid zebra-artificial lemming algorithm development phase adopts the development phase of the artificial lemming optimization algorithm and introduces the Levy flight strategy; the selection criteria for the lemming foraging behavior and predator avoidance behavior in the development phase are shown in formula (9), where r3 represents a random number that satisfies a uniform distribution in (0, 1): In view of the foraging behavior of lemmings, the artificial lemming algorithm uses a spiral winding mechanism to mathematically model this behavior. Its position update formula is shown in formula (10): spiral i =radius i ×[sin(2π×r6)+cos(2π×r6)] (12) in represents the pre-update solution of individual i in the development phase of the hybrid zebra-lemming algorithm, F represents the control factor of the search direction, spiral i is the spiral factor of individual i, radius i represents the Euclidean distance between individual i and the global leader, r4, r5, and r6 all represent random numbers that satisfy uniform distribution in (0,1); The mathematical modeling formula for lemmings’ behavior of avoiding natural enemies is shown in (14); Where t is the current iteration number, T is the maximum iteration number; Levy(β) represents a random perturbation that obeys the Levy flight distribution; The position update judgment formula for lemmings' foraging behavior and predator avoidance behavior is consistent; if the completion time corresponding to the pre-update scheduling scheme is less than the completion time corresponding to the pre-update scheduling scheme, the individual position is updated; as shown in formula (16): in represents the undetermined solution for individual i in the development phase of the hybrid zebra-lemming algorithm, Indicates the corresponding function value.
8. The Levy flight strategy according to claim 6, characterized in that: In the position update formula of the hybrid zebra-lemming algorithm in the exploration and development phases, a random perturbation term that obeys the Levy flight distribution is added. The position update formula that introduces the Levy flight strategy is as follows: in is the undetermined solution of individual i in the hybrid zebra-lemming algorithm, Levy(β) is a random perturbation that obeys the Levy distribution, and the random number is generated using the normal distribution. The specific formula is as follows: Among them, u obeys the normal distribution, that is, u~N(0,σ 2 ); υ follows the standard normal distribution, that is, υ~N(0,1); the value of σ is as follows: The value of β is 1.
5.
9. The sinusoidal candidate step length strategy according to claim 6, characterized in that: In the exploration phase of the hybrid zebra-lemming algorithm, multiple candidate step sizes are introduced. The mechanism for selecting the best candidate step size is as follows: An integer is randomly selected within the upper and lower limits of the number of candidate sine step lengths as the candidate step length number, and then it is evenly distributed on the unit period sine function to obtain multiple candidate step lengths, as shown in formula (21): h=round[hmin+r7×(hmax-hmin)] (20) Where hmax and hmin are the upper and lower limits of the number of candidate step sizes, respectively. h is the number of candidate step sizes, which is a random integer in the interval [hmin, hmax]. Finally, a total of h candidate step sizes are obtained. r7 represents a random number that satisfies a uniform distribution in (0, 1). The minimum step length among the h completion times is selected as the pre-update step length: in is the scheduling scheme corresponding to the kth candidate step length when the i-th individual is pre-updated in the exploration phase of the hybrid zebra-lemming algorithm, The corresponding completion time is This is the optimal step size selected.