Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2025 May 24;15:18124. doi: 10.1038/s41598-025-01255-0

Application of Levy flight-based harmony search algorithm for the flexible job shop scheduling

Jun Li 1,2,✉,#, Yang Zhou 1,#
PMCID: PMC12103513  PMID: 40413242

Abstract

The Flexible Job Shop Scheduling Problem (FJSP) is an extension of the classical job shop scheduling problem, which is characterized by the fact that each process can be processed on multiple candidate machines, and needs to solve the two subproblems of machine allocation and process sequencing simultaneously. Since FJSP is an NP-hard problem, its complexity and multi-objective characteristics make the traditional exact methods inefficient. At the same time, the existing intelligent optimization algorithms are prone to falling into local optimums, which makes it difficult to balance global exploration and local exploitation capabilities. To this end, this study proposed a Levy flight-based Harmony Search algorithm (LHS), which effectively avoids premature convergence by dynamically and adaptively adjusting the Harmony Memory Considering Rate (HMCR), the probability of Pitch Adjusting Rate (PAR), and the arbitrary distance Bandwidth(BW), and by introducing a Levy flight mechanism to perturb the parameters to broaden the search space and enhance the diversity of the population. We validate the experiments using 8 × 8, 10 × 10, and 10 benchmark instances proposed by Brandimarte in the literature, and the experimental results show that the Harmony search algorithm based on Levy flight outperforms the other comparative algorithms in terms of the solution quality and the convergence speed, demonstrating the effectiveness of its solution for FJSP.

Keywords: Levy flight, Harmony search, Optimization, Flexible job shop scheduling

Subject terms: Engineering, Computer science

Introduction

Manufacturing, as the pillar of the national economy, plays a significant role in economic growth and improving living standards1. The strategy of intelligent manufacturing is of great importance to the development of the manufacturing industry. The core idea of intelligent production in manufacturing is to provide a flexible, efficient, and green production model, aiming to improve production efficiency through the deep integration of manufacturing and information technology2. Scheduling optimization plays a crucial role in both manufacturing and service industries. The Job Shop Scheduling (JSP) problem, as a typical scheduling optimization problem, has been widely studied in the field of manufacturing systems3. Among them, the Flexible Job Shop Scheduling (FJSP) problem is a subclass of the classic JSP4. In FJSP, an operation can be processed on one or more candidate machines, making FJSP more complex than JSP5.

With the development of mathematics and computer information technology, FJSP has been studied since 1990 when Brucker and Schlie began researching it using polynomial algorithms. Since then, many different methods and algorithms for solving FJSP have emerged, mainly divided into two categories: exact techniques6 and approximation techniques7. Exact techniques tend to have low solution efficiency due to various constraints8, while approximation techniques are widely studied and applied due to their higher solution efficiency9. Chaudhry and Khan10 conducted a comprehensive survey on the development and solution techniques of FJSP from 1990 to 2014, covering various publications (including books, conference papers, journal articles, and reports). The survey found that 59% of the publications employed hybrid intelligent technologies or evolutionary algorithms to solve FJSP. Solving FJSP typically involves considering two sub-problems: the routing subproblem (machine allocation)11 and the scheduling subproblem (operation sequencing). Common intelligent optimization algorithms used to solve FJSP include GA (Genetic Algorithm)12, PSO (Particle Swarm Optimization)13, ABC (Artificial Bee Colony)14, and Artificial Bee Colony (ABC) algorithm15.

The FJSP problem is difficult for traditional exact algorithms (e.g., branch-and-bound methods) to cope with the demand of solving large-scale instances due to its NP-hard nature and the dual complexity of machine assignment and process sequencing. Optimization algorithms (e.g., meta-heuristics) are able to find high-quality approximate solutions in a reasonable time by simulating natural phenomena or group intelligence behaviors, and have become the mainstream methods for solving FJSP.

Metaheuristics are a general class of algorithmic frameworks for solving complex optimization problems by simulating natural phenomena or biological behaviors to find an approximate optimal solution to the optimization problem. The core of metaheuristics lies in striking a balance between global and local search in order to avoid falling into local optimal solutions while improving the convergence speed and quality of the algorithm. In recent years, with the increasing complexity of optimization problems, metaheuristics have been used to find approximate optimal solutions to complex optimization problems. Some recently developed metaheuristic algorithms perform well, e.g.: red fox optimizer16, the flying fox optimizer17, polar bear optimization18 and the mayfly optimization algorithm19. The successful application of these algorithms further demonstrates the effectiveness and potential of metaheuristic algorithms in solving complex optimization problems.

Harmony Search (HS) is an intelligent optimization algorithm proposed by Geem et al. that simulates the process of musical performance20. Despite the emergence of a variety of novel metaheuristic algorithms in recent years, the harmony search algorithm still has significant advantages due to its unique mechanism. First, HS collaboratively generates new solutions through memory banks, which can effectively balance global exploration and local exploitation and avoid premature convergence; second, with fewer HS parameters (only harmony memory considering rate (HMCR), pitch adjustment rate (PAR) and Bandwidth (BW)) and low complexity of tuning parameterization, which facilitates practical applications, HS is still a powerful algorithm for solving FJSP problems. However, HS is prone to falling into local optima when solving high-complexity problems, leading many scholars to propose various improvements to the HS algorithm. Orman21 introduced a global Harmony Search algorithm that modifies the fine-tuning step size, allowing the new harmony to be influenced by the best harmony in the memory pool. This alleviates the issue of needing to tune the fine-tuning step size. Zhao et al.22 introduced a random-key-based effective minimum sequence rule to initialize the harmony memory pool and proposed a hybrid HS algorithm with variable neighborhood search, effectively solving the flow shop scheduling problem. Yuan et al.23 combined heuristic and random strategies to initialize the harmony memory pool, ensuring that the initial harmony memory pool has quality and diversity. They proposed a novel hybrid HS algorithm based on an ensemble approach to minimize the manufacturing cycle and solve the flexible job shop scheduling problem. Awadallah et al.24 introduced a hybrid harmony search algorithm by introducing the global-best concept from particle swarm optimization to improve the memory consideration operator of the harmony search (HS) algorithm and integrating a hill climbing optimizer (HCO) to enhance its local search capability.This hybrid algorithm effectively addressed highly constrained nurse rostering problems. Abu Doush et al.25 introduced a neighborhood heuristic and acoustic search algorithm based on the island model by dividing the population into multiple islands and performing migration operations between the islands, which effectively improves the diversity of the algorithm and solves the problem of scheduling between blocking streams. Abu Doush et al.26 combined three neighborhood heuristics (insert-or-swap, insert-invert-block, and full-optimality) to improve the quality of the newly generated harmonies, and proposed an modified harmony search algorithm, which further optimizes the performance of the HS algorithm for the blocking flow shop scheduling problem. Pan et al.27 introduced a chaotic harmony search algorithm for solving permutation flow-shop scheduling problems with limited buffers.This algorithm leveraged chaotic sequences to enhance global exploration, combined with an improved improvisation scheme and a chaotic local search algorithm, resulting in effective optimization of scheduling solutions. Wang et al.28 introduced a hybrid modified global-best harmony search algorithm for the blocking permutation flow-shop scheduling problem. This algorithm incorporated an insertion neighborhood-based local search and a revised pitch adjustment rule to significantly improve the search efficiency and convergence accuracy under bufferless constraints. Pan et al.29 introduced a local-best harmony search algorithm with dynamic sub-harmony memories (DLHS), is proposed to minimize the total weighted earliness and tardiness penalties for a lot-streaming flow shop scheduling problem with equal-size sub-lots. Zhang et al.30 proposed an improved mayfly algorithm for the Distributed Flexible Job Shop Scheduling Problem (DFJSP), which effectively improves the algorithm’s global search capability and local optimization performance through discrete mapping, three-layer coding rules, hybrid initialization strategy, active time window decoding strategy, and improved crossover and mutation operations, and provides a new idea for the solution of the DFJSP problem and methods for solving the DFJSP problem.

Although the HS search algorithm performs well in solving complex optimization problems, it still suffers from defects such as premature convergence and parameter statics limitation when dealing with high-dimensional, multi-peak optimization problems. Especially in NP-hard problems such as FJSP, traditional HS algorithms are difficult to effectively balance global exploration and local exploitation, resulting in limited solution quality.

For this reason, this paper proposes a Levy flight-based harmony search algorithm. Introducing the Levy flight.

The main contributions of this paper are as follows:

(1) A Levy flight-based Harmony Search algorithm(LHS) is proposed, which solves the local optimization problem caused by the fixed parameters of the traditional HS algorithm by dynamically and adaptively adjusting the HMCR, PAR and BW;

(2) Introducing the long-tailed jump property of Levy flight to enhance the algorithm’s global exploration ability in the solution space, while improving the local exploitation efficiency through the parameter adaptive mechanism;

(3) The LHS algorithm is applied to the FJSP problem, and the experimental results show that it significantly outperforms the comparative algorithms in terms of solution quality and convergence speed.

The rest of the paper is organized as follows. “Flexible job shop scheduling problem (FJSP)” introduces the flexible job shop scheduling problem, “Levy flight principle” introduces the Levy flight principle, “Harmony search principle” introduces the harmonic algorithm principle, “Proposed methodology: modified harmony search algorithm based on Levy flight” and “Improved LHS algorithm for solving FJSP” describes the proposed algorithm and then it is evaluated and analyzed in “Experimental results and analysis”. Finally, conclusions and future work are provided in “Conclusion and future work”.

Flexible job shop scheduling problem (FJSP)

Given a set of jobs Inline graphic, each job Inline graphic consists of a sequence of operations Inline graphic, which must be executed one after another in a specified order. The set of machines is Inline graphic, and each operation Inline graphic can be processed on a subset of compatible machines Inline graphic. If there exists at least one operation Inline graphic for which the machine set Inline graphic is a proper subset of Inline graphic, the job exhibits partial flexibility. In the case of total flexibility, each operation Inline graphic has its own set of compatible machines Inline graphic. The processing time for each job depends on the machine it is assigned to. Let Inline graphic represent the processing time of operation Inline graphic on machine Inline graphic. Preemption is not allowed, meaning each operation must be completed without interruption. Furthermore, each machine can perform at most one operation at a time, and all jobs and machines are available at time zero. The solution to the FJSP consists of two main parts: (1) Assigning each operation to an appropriate machine. (2) Sequencing the operations on each machine to minimize the makespan (the total time required to complete all jobs).

Table 1 illustrates an example of a 3-machine, 3-job problem for better understanding.

Table 1.

Processing schedule.

Job Operation Inline graphic Inline graphic Inline graphic Time of completion Job weight
Inline graphic 7 5 10 15 1
Inline graphic Inline graphic 8 10 5
Inline graphic 6 5 8
Inline graphic 8 7 15 47 1
Inline graphic Inline graphic 14 11 -
Inline graphic 5 11 8
Inline graphic 15 - 12
Inline graphic 6 9 5 37 1
Inline graphic Inline graphic 6 - 7
Inline graphic 10 - 9
Inline graphic 8 7 10

In Table 1, assume that job Inline graphic has three operations, and each operation can be processed on three machines (Inline graphic). The numbers represent the processing time required by each machine for the corresponding operation. The optimal total time required to process all three operations of job Inline graphic is 5, and the weight of job Inline graphic is 1. The descriptions of jobs Inline graphic and Inline graphic are similar to that of Inline graphic. A “-” indicates that a particular machine cannot process that operation. The objective function of the FJSP is defined as follows:

graphic file with name d33e750.gif 1

Where Inline graphic represents the final completion time of the job; Inline graphic represent the machining time and start time on the h-th process of job Inline graphic, respectively.

Levy flight principle

Levy flight31 is a type of stochastic process with the Markov property, which is of significance in improving intelligent computation. The jump lengths in Levy flight follow a Levy distribution, which has a heavy-tailed asymptotic form: Inline graphic is the Levy index. The Levy distribution is defined as:

graphic file with name d33e790.gif 2

where Inline graphic is a scale parameter and Inline graphic is the step size.

The random numbers generated by Levy flight consist of two parts: the random direction selection and the step size of the Levy flight. Using the Mantegna algorithm, a balanced Levy stable distribution can be generated. The mathematical expression for the step sizes is:

graphic file with name d33e812.gif 3

Where Inline graphic and Inline graphic are drawn from normal distributions. That is,Inline graphic, and Inline graphic, Inline graphic is the Gamma function.

Harmony search principle

HS algorithm is a meta-heuristic optimization method based on the process of musical improvisation20. The core idea is to simulate the process of musicians adjusting the pitches of different instruments to achieve a state of harmony. In the optimization problem, each “instrument” corresponds to a decision variable, and “harmony” is mapped to the optimal solution of the objective function. HS achieves efficient search by balancing global exploration (randomly generating new solutions) and local exploitation (fine-tuning existing solutions), and is applicable to continuous, discrete and mixed-variable optimization problems. discrete and mixed-variable optimization problems.

The HS algorithm is implemented through the following five main steps26.

Usually, in discrete optimization problems with constraints, the objective function Inline graphic is obtained by mathematical modeling to represent the specific problem:

graphic file with name d33e872.gif 4

The following constraints are satisfied:

Equality constraints: Inline graphic

Inequality constraints: Inline graphic

Where Inline graphic denotes the solution vector of the Inline graphic decision variables.

Step 1. Initialize the required parameters. The parameters of the harmony search algorithm include the following: Harmony Memory Size (HMS), Harmony Memory Considering Rate (HMCR), Pitch Adjusting Rate (PAR) and Bandwidth (BW).

Step 2. The initial solution is randomly generated and stored in the Harmony Memory (HM):

graphic file with name d33e916.gif 5

where Inline graphic is the variable dimension and Inline graphic denotes the i-th variable of the j-th solution.

Step 3. Improvise to generate new harmonies. Generate new solutions by the following rules Inline graphic:

  1. Memory bank selection: randomly select variable values from HM with probability HMCR.

  2. Random Generation: Generate values randomly with probability 1-HMCR within the variable range.

  3. Local fine-tuning: if the variables are from the HM, fine-tune them with probability PAR:

graphic file with name d33e966.gif 6

where Inline graphic is the bandwidth.

Step 4. Updates to the HM. Calculate the fitness value Inline graphic of the new solution Inline graphic and replace it if it is better than the worst solution in the HM.

Step 5. Check if the algorithm terminates. Repeat steps (2)-(3) until termination conditions are met (e.g., maximum number of iterations or convergence threshold).

Proposed methodology: modified harmony search algorithm based on Levy flight

In HS algorithms, the memory considering rate (HMCR), Pitch Adjusting Rate (PAR), and bandwidth (BW) are usually set to fixed values empirically, resulting in a search performance limited by parameter sensitivity. To overcome this problem, various parameter adaptive strategies have been proposed in existing studies. For example, Pan et al.27 dynamically adjusted PAR and BW through chaotic perturbations to improve the convergence accuracy of flow shop scheduling, and Yuan et al.23 used a heuristic initialization method to optimize HMCR and enhance population diversity. However, these methods often rely on additional operators or complex rules, which increase the computational complexity.

In this paper, we propose a dynamic adaptive adjustment strategy for parameters based on Levy flight. Different from the PSO hybrid method in literature24, LHS does not need to introduce an external optimization mechanism, but directly perturbs HMCR and BW through the long-tailed stochasticity of Levy flight (Eqs. 12, 15), so that it promotes global exploration (low HMCR, high PAR) at the beginning of the iteration, and shifts to local exploitation (high HMCR, adaptive BW) at the later stage. This strategy not only simplifies the parameter tuning process but also extends the search space coverage through Lévy flight properties (Eq. 11). This design aligns with the theoretical framework in literature25, where parameter self-adaptation is emphasized as the core mechanism for balancing exploration and exploitation.

Adaptive harmony memory considering rate based on Levy flight

The size of the memory bank fetch probability HMCR value directly affects the entire scope of the algorithm search. The larger HMCR values facilitate the local search of the HS algorithm, and the smaller HMCR values increase the diversity of the harmonic memory bank. Therefore, a dynamic adaptive change HMCR is proposed with the following expression:

graphic file with name d33e1036.gif 7

where Inline graphic represents the probability of the memory bank fetch at the t-th iteration, Inline graphic represents the minimum value of the probability of the memory bank fetch, Inline graphic represents the maximum value of the probability of the memory bank fetch, Inline graphicrepresents Levy flight random wandering, and Inline graphic represents the density function of the normal distribution that satisfies a variance of 1, i.e.,Inline graphic. where the expected value of Inline graphic is determined by the number of iterations of the algorithm. Its improved HMCR dynamic adaptive change curve graph is shown below:

As seen from Fig. 1, in the early stages of the iterative search, the value of HMCR fluctuates due to the perturbation effect of Levy flight, aking a smaller value that helps increase the diversity of the population and expand the search range. In the later stages of the iterative search, HMCR gradually increases as the number of iterations increases, and the effect of Levy flight disturbance becomes weaker. At this point, the value of HMCR is larger, which helps the algorithm focus on local search and improves the convergence rate.

Fig. 1.

Fig. 1

Dynamic change of the Inline graphic

Adaptive pitch adjustment rate

A smaller Pitch Adjustment Rate (PAR) enhances the algorithm’s local search capability, while a larger PAR is beneficial for adjusting the search area and expanding the search range. Therefore, an improvement to the PAR is proposed, with the following expression:

graphic file with name d33e1112.gif 8

where Inline graphic represents the pitch adjustment probability at the t-th iteration, Inline graphic and Inline graphic, represents the minimum pitch adjustment probability and the maximum pitch adjustment probability, respectively.

As shown in Fig. 2, in the early stages of the iterative search, the PAR value changes rapidly, which helps the algorithm perform local exploration. In the later stages of the search, the PAR value changes more slowly, and the algorithm adjusts the search range using the harmony memory (HM), allowing the LHS to gradually expand the search range across the entire solution vector. This helps the algorithm escape local optima more effectively.

Fig. 2.

Fig. 2

Dynamic change of the Inline graphic

Adaptive bandwidth based on Levy flight

A larger Bandwidth(BW) helps the Harmony Search algorithm escape from local optima, while a smaller BW favors more refined local search in a confined area. Therefore, Levy flight is used to improve BW, which encourages the algorithm to jump out of local optima and explore other regions of the solution vector, thus enhancing the computational accuracy.The expression for the BW is as follows:

graphic file with name d33e1163.gif 9

The expression for generating a new harmony is as follows:

graphic file with name d33e1171.gif 10

where Inline graphic is the denotes element-wise multiplication; Inline graphic represents the step control quantity, Inline graphic represents the open square root of the current population expectation; Inline graphic represents the optimal harmony for the i-th dimension.

The principle of BW is shown in Fig. 3 below:

Fig. 3.

Fig. 3

BW principle of dynamic adaptive change.

In Fig. 3, Inline graphic and Inline graphic are symmetric about point Inline graphic. The distance between points Inline graphic and Inline graphic is the defined trust domain, and the distance between Inline graphic and Inline graphic is defined as the Inline graphic of the i-th component. In the early stages of the search, the differences between the various harmony vectors are large, resulting in a larger step size and a wider trust region, which facilitates global search. As the search progresses, Inline graphic moves toward Inline graphic, causing most harmony vectors to converge. At this point, the step size becomes smaller, and the corresponding trust region narrows, promoting more localized search.

The dynamic adaptive change curve for BW is shown in Fig. 4 below:

Fig. 4.

Fig. 4

Dynamic change of the BW.

The dynamic adjustment strategy of HMCR (Eq. 7) allows the algorithm to expand the search range with lower HMCR values at the beginning of the iteration (Fig. 1) by introducing random perturbations of Levy flights to increase the population diversity, while the HMCR gradually increases with the increase of the number of iterations to strengthen the local search. This design is in line with the principle of “exploration-exploitation” balance of the metaheuristic algorithm, and its effectiveness can be verified indirectly through the convergence analysis (Sect. 5.4): the spectral radius of the iteration matrix in Eq. 19, ρ(M) < 1, indicates that the dynamic adjustment strategy of the algorithm parameters can ensure the convergence of the solution. In addition, the long-tail property of the Levy flight (Eq. 3) further reduces the probability of falling into a local optimum through intermittent large-span jumps.

Constraint handling in LHS algorithm

For the vast majority of constrained optimization problems, the optimal feasible solution is often located on the boundary. Therefore, the LHS algorithm utilizes a feasible harmony solution Inline graphic to repair infeasible harmony solutions Inline graphic by mapping them to the boundary. In cases where the optimal feasible solution does not lie on the boundary, no further processing is performed by the LHS algorithm.

In practical constraint handling, it is often difficult to directly find the boundary point closest to Inline graphic. To address this, the algorithm identifies a boundary point on the line segment connecting the infeasible harmony solution Inline graphic and the feasible harmony solution Inline graphic, as referenced in32.

Lemma

For any continuous function Inline graphic, and a pair of points Inline graphic and Inline graphic, there always exists a real number Inline graphicsuch that the following conditions hold:

graphic file with name d33e1395.gif 11
graphic file with name d33e1401.gif 12

Theorem

For any feasible harmony solution Inline graphic and infeasible harmony solution Inline graphic, there always exists a real number Inline graphic such that Inline graphic, and the following condition holds for the boundary point:

graphic file with name d33e1450.gif 13
graphic file with name d33e1456.gif 14
graphic file with name d33e1462.gif 15

Prove that there exists a real number Inline graphic such that Inline graphic and at least one equality holds.

Proof

For the constraints that are not satisfied Inline graphic, it follows from the lemma that there existsInline graphicsuch that Inline graphicand Inline graphic.

Given a constraint Inline graphic that satisfies the condition, if for any Inline graphic, Inline graphic holds, then let Inline graphic be defined; otherwise, by the lemma, there exists an Inline graphic such that Inline graphicand Inline graphic, which yieldsInline graphic.

From the above, it follows that for all constraints Inline graphic, there exists a corresponding Inline graphicsuch that both Inline graphic and Inline graphic are satisfied. Consequently, by setting Inline graphic, Inline graphic becomes the real number that meets the conditions.

The aforementioned theorem demonstrates that, under the assumption of continuity, there must exist a boundary point on the line segment connecting the infeasible harmony solution and the feasible harmony solution.

Convergence analysis of the LHS algorithm

Based on the creative process of Harmony Search (HS) algorithm, as documented in literature33, the exploration capability of the algorithm is measured using the expected standard deviation of all harmonies within the Harmony Memory (HM). It has been demonstrated that the exploration capability of HS is associated with parameters HMCR, PAR, BW, as well as the upper and lower bounds of variables, LB and UB. The expression for the exploration capability is presented as follows:

graphic file with name d33e1610.gif 16
graphic file with name d33e1616.gif 17

The proof process is detailed in reference33. In this paper, the value of BW is Inline graphic, which leads to:

graphic file with name d33e1634.gif 18

The iterative equation composed of Inline graphic and Inline graphic is given by:

graphic file with name d33e1654.gif 19

It can be simplified to Y = MX + B, where the iteration matrix is:

graphic file with name d33e1662.gif 20

After t iterations, the result is:Inline graphic

The eigenvalues of the iteration matrix Inline graphic are:Inline graphic.

It is known that HMS (Harmony Memory Size) represents the size of the harmony memory bank, with the condition that Inline graphic. Consequently, the spectral radius of the iterative matrix Inline graphic is denoted as Inline graphic. Therefore, Inline graphic. Hence, Inline graphic and Inline graphicare iteratively convergent, implying that the algorithm exhibits iterative convergence.

Improved LHS algorithm for solving FJSP

Encoding and decoding

Zheng and Wang34 proposed the following encoding and decoding scheme, where each job is represented by two carriers: the Operation Sequencing Vehicle (OSV) and the Machine Assignment Vehicle (MAV). OSV : This represents the sequence of all operations that satisfy the precedence constraints. MAV : This represents the machine allocation according to the optimal processing time required for the operations in the OSV. The lengths of OSV and MAV are given by: Inline graphic.

Based on the dataset presented in Table 1, this coding method is applied to encode the algorithm as proposed. The coding process, as depicted in Fig. 5, is utilized to elucidate the entire coding methodology.

Fig. 5.

Fig. 5

Schematic diagram of encoding.

In Fig. 5, assuming that there is a harmonic vector A in continuous space first sort the harmonic vector in ascending order and record the position of each value in the vector to convert the entire harmonic sequence into a discrete sequence that can be read in FJSP. Specifically, we adopt the encoding of OSV and MAV to map the continuous harmonic vectors to discrete process and machine assignments. OSV denotes the sequence of all processes that satisfy the priority constraints, while MAV selects the optimal machine to be assigned based on the order of the processes in OSV. In this way, the LHS algorithm can efficiently optimize in discrete space and ensure its applicability to the discrete nature of FJSP. Utilizing the dataset presented in Table 1, the process is as follows: First, the OSV is employed to sort the transformed harmony vectors for operation sequencing. Subsequently, the MAV is used to allocate machines based on the sorted operations from OSV. The entire scheduling process is shown in the Gantt chart in Fig. 6.

Fig. 6.

Fig. 6

Gantt chart for the entire scheduling activity.

LHS algorithmic flow for the FJSP problem

Step 1. Set the maximum number of iterations and parameters within the LHS algorithm.

Step 2. Initialize the HM. Employing an OSV-MAV-based encoding scheme, generate the initial HM for both operations and machines.

Step 3. Generate new candidate harmonies. If Inline graphic, the new harmony is generated by selecting a variable value from the HM. Otherwise, the variable value is randomly generated within its corresponding range.

Step 4. Perform pitch adjustment on the newly generated harmony. If, use the BW to fine-tune the new harmony. Otherwise, keep the new harmony unchanged.

Step 5. Calculate the objective value of the new harmony set. Decode the new harmony after neighborhood transformation, and replace the harmony in the harmony memory with the worst objective value with the newly generated harmony.

Step 6. Check if the maximum number of iterations is reached. If the condition is satisfied, proceed to step 7. Otherwise, go back to step 3.

Step 7. Terminate the algorithm and output the best solution stored in the HM.

Experimental results and analysis

The LHS and HS algorithms are tested under Inline graphic, Inline graphic, and 10 problem instances proposed by Brandimarte. All test cases are executed in a MATLAB 2016a environment with a Core™@2.50 GHz processor. The parameters for the LHS algorithm are set as follows:Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic. The parameters for the HS algorithm are Inline graphic, Inline graphic, Inline graphic, Inline graphic. Both the LHS and HS algorithms are independently run 10 times to calculate the average value, with Inline graphic, Inline graphic. The obtained results are compared with the Multi-Agent Tabu Search with Local Optimization (MATSLO) and Hybrid Harmony Search (HHS) results from literature23, as shown in Table 2.

Table 2.

Comparison table of running results.

Examples HS MATSLO HHS LHS
n*m (LB, UB) Best Aver Best Aver Best Aver Best Aver
mk01 10*6 (36,42) 44 44.5 40 40.5 40 40 40 40
mk02 10*6 (24,32) 33 33.7 26 27.5 26 26 26 26.2
mk03 15*8 (204,211) 212 214.4 204 205 204 204 204 204
mk04 15*8 (48,81) 74 74.5 60 61.7 60 50 60 60
mk05 15*4 (168,186) 181 181 173 173 172 172.8 171 172.1
mk06 10*15 (33,86) 58 63.1 62 63.5 58 59.1 55 58.6
mk07 20*5 (133,157) 153 154 148 148.6 139 139.5 141 141.2
mk08 20*10 (523) 560 562 523 540.5 523 523 523 523
mk09 20*10 (299,369) 350 351.7 315 315.4 307 307 301 301.7
mk10 20*15 (165,296) 260 262 220 220.4 205 211.1 205 208
8*8 8*8 (14,NA) 18 18.5 14 15 - - 14 14.5
10*10 10*10 (7,NA) 13 13 7 7.5 - - 7 7

Table 2 shows the optimal and average values of the LHS algorithm as well as the HS, MATSLO and HHS algorithms for solving the FJSP problem. By comparing the average and optimal values (when the optimal values are the same), it can be seen that the smaller the value, the better the algorithm is optimized. Overall, the average and optimal values of the LHS algorithm are better than or at least comparable to those of HS and MATSLO in most of the instances, indicating a significant optimization performance improvement in solving the FJSP problem. Compared to the HHS algorithm, the LHS also exhibits better or comparable performance in most instances, especially in large-scale instances where the optimization advantage of the LHS is more obvious.

As an example, the mean value of LHS in mk01 (10 × 6) is 40, which is the same as HHS and better than HS (44.5) and MATSLO (40.5), indicating that LHS is able to find the globally optimal solution quickly and maintains the stability in small-scale instances. In mk06 (10 × 15), the average value of LHS is 58.6, which is better than HS (63.1), MATSLO (63.5) and HHS (59.1), which indicates that LHS can effectively avoid local optimality and find better solutions in medium-sized instances. In the large-scale instance mk09 (20 × 10), the average value of LHS is 301.7, which is better than HS (351.7), MATSLO (315.4), and HHS (307), indicating that LHS significantly improves the optimization performance through dynamic parameter tuning based on Levy flight. Similarly, in mk10 (20 × 15), LHS has a mean value of 208, which is superior to HS (262), MATSLO (220.4) and HHS (211.1), further demonstrating its superiority in large-scale problems.

The improved optimization performance of the LHS algorithm is mainly due to the dynamic parameter tuning strategy based on Levy flights.The long-tailed distribution characteristic of Levy flights significantly enhances the algorithm’s global exploration ability, which enables it to skip the local optimal region and expand the search scope at the beginning of the iteration. As the iterations proceed, the dynamically adjusted HMCR, PAR and BW parameters based on Levy flights further balance the global exploration and local exploitation, improving the convergence speed and accuracy of the algorithm. In addition, the improved constraint handling method and OSV-MAV coding method ensure the efficient optimization of the algorithm in discrete space to satisfy the discrete characteristics of FJSP.

Therefore, in terms of the overall effect, the LHS algorithm has good feasibility in solving FJSP, and the introduction of Levy flight mechanism in the standard harmonic search algorithm and the adaptive improvement of parameters are effective and can significantly improve the optimization performance of the algorithm.

In addition, the application of LHS algorithm in the FJSP example and the scheduling of the process processing machines in the mk01 scheduling optimization process are visually demonstrated through the Gantt chart and the convergence curve graph, which further verifies its optimization performance.

Figure 7 illustrates the Gantt chart of the LHS algorithm during the optimization process of instance mk01, while Fig. 8 depicts the convergence curve of the LHS algorithm during the optimization process of instance mk06.

Fig. 7.

Fig. 7

Gantt chart of mk01’s optimal solution scheduling.

Fig. 8.

Fig. 8

Convergence curve of mk06.

Convergence analysis

Figure 8 shows that the objective function value of the LHS algorithm decreases rapidly at the beginning of the iteration and stabilizes in subsequent iterations. The HS algorithm, on the other hand, requires more iterations to gradually approach the optimal solution. This indicates that the LHS algorithm is able to converge quickly and has better convergence properties. This fast convergence ability is mainly attributed to the combination of the Levy flight mechanism and the dynamic parameter tuning strategy, which enables the algorithm to achieve an effective balance between global exploration and local exploitation.

The HS algorithm significantly enhances the global exploration capability while ensuring convergence by dynamically tuning the HMCR, PAR, and BW parameters in combination with the long-tailed distribution property of Levy flight. The dynamic adjustment strategy enables the algorithm to quickly jump out of the local optimal solution and enter into a wider search space at the beginning of the iteration; while at the later stage of the iteration, the gradually decreasing BW values and increasing HMCR and PAR values focus on the local optimization to achieve rapid convergence.The introduction of Levy flight mechanism further avoids the algorithm from falling into the local optimum in the complex optimization problem, which provides a strong guarantee for the convergence.

Diversity analysis

To quantify the performance of LHS in terms of population diversity, we used the concept of population moisture (Shannon Entropy)35. Population moisture is a measure of population diversity that is based on the concept of entropy in information theory and reflects the uniformity of the distribution of individuals in a population.

The diversity of the population is measured by calculating the entropy value for each operational position. The specific steps are as follows:

1. Extraction of population manipulation sequences

Let HM be Inline graphic, where Inline graphic is the size of the Harmony Memory, and each harmony vector Inline graphic contains a sequence of operations. We extract all the operations as sequences, denoted as Inline graphic, where Inline graphic denotes the operation sequence of the i-th harmonic vector.

2. Calculate the entropy value for each operation position

For each operation position Inline graphic, its entropy value is defined as:

graphic file with name d33e2349.gif 21

where Inline graphic, denotes the number of harmony vectors in the harmony memory. Inline graphic denotes the length of each sequence of operations. Inline graphic denotes the set of all possible operations at the Inline graphic-th operation position. Inline graphic denotes the number of occurrences of operation Inline graphic at the Inline graphic-th operation position. Inline graphic denotes the probability that operation Inline graphic is at the Inline graphic-th operation position. Inline graphic is the natural logarithm. The higher the entropy value, the more diversified the operations at that position; the lower the entropy value, the more concentrated the operations at that position.

3. Calculate the average entropy of the population

The entropy values of all operational positions were summed and averaged to obtain a diversity measure for the entire population:

graphic file with name d33e2427.gif 22

In this study, we calculated the average population moisture of the populations after each iteration and normalized it for comparison purposes. The normalization was done by dividing the population moisture value calculated for each iteration by the population moisture value at the beginning of the iteration. In this way, we can obtain a normalized diversity value between 0 and 1, where 1 indicates maximum diversity and 0 indicates minimum diversity.

It can be observed from Fig. 9 that although the population diversity of both algorithms decreases with the number of iterations in the early stage, the LHS algorithm still maintains a higher level of diversity in the middle and late search process. This higher diversity helps the algorithms to avoid premature convergence and to find optimal solutions in a wider search space.

Fig. 9.

Fig. 9

Diversity profile of mk06.

The ability of the LHS algorithm to maintain a higher level of population diversity is mainly due to the dynamic parameter tuning strategy based on Levy flights. The dynamic parameter tuning strategy utilizes smaller HMCR values, PAR values and larger BW values at the beginning of the iteration, which promotes population diversity and allows the algorithm to explore within a larger search space. As the iterations progressed, progressively larger HMCR values, PAR values and reduced BW values allowed the algorithm to search localized regions more finely, while maintaining some global search capability. This strategy ensures the algorithm’s diversity during the search process.The Levy flight mechanism, on the other hand, increases the diversity of the population by introducing long jumps, preventing the algorithm from converging to a local optimum prematurely.

Overall, the results in Fig. 9 further validate the effectiveness of the LHS algorithm in increasing population diversity and enhancing global search capability.

Statistical tests analysis

In order to further validate the performance benefits of the proposed Lévy flight-based harmonic search algorithm (LHS) in the flexible job shop scheduling problem (FJSP). We performed a paired-sample statistical test on the average results of the LHS algorithm against the other compared algorithms (HS, MATSLO, and HHS), and Table 3 shows the test results.

Table 3.

Comparison table of statistical test results.

LHS vs. HS LHS vs. MATSLO LHS vs. HHS
t-statistic 3.3794 3.0764 -0.1839
p-value 0.0081 0.0132 0.8581

In Table 3, the LHS algorithm has a significant performance advantage over the HS and MATSLO algorithms (p-value less than 0.05 in all cases), indicating that the LHS algorithm is able to obtain a better solution when solving FJSP. While compared to the HHS algorithm, the LHS performs slightly better in some instances, but the p-value is greater than 0.05, which indicates that the two are closer in performance. Overall, the LHS algorithm shows good optimization performance and convergence properties in solving the FJSP problem.

Conclusion and future work

In this paper, a harmony search algorithm based on Levy flight is proposed, which improves the deficiency of the harmony search algorithm that is prone to fall into the local optimal solution by dynamically and adaptively adjusting the HMCR, PAR and BW parameter according to the previous experience. The parameters of the algorithm are improved by introducing Levy flight, which effectively balances the global search capability and local search capability, and is applied to the FJSP. We tested the proposed method using 10 instances presented by 8*8,10*10 and Brandimarte. The experimental results show that this LHS algorithm obtains better solutions with better convergence properties than other optimization algorithms, and good results are obtained in solving the FJSP.

Statistical test results further validate the performance advantages of the LHS algorithm. Compared with the HS and MATSLO algorithms, the LHS is statistically significantly better than these two algorithms, indicating its higher optimization efficiency in solving the FJSP problem. Although there is no statistically significant difference between the LHS and HHS algorithms, the LHS performs better in certain complex instances with comparable overall performance. This finding is consistent with the results of existing studies on the application of intelligent optimization algorithms to scheduling problems, and further demonstrates the effectiveness of the introduction of the Levy flight mechanism in improving the harmonic search algorithm.

Future research can be carried out in the following aspects:

Incorporating real-time scheduling scenarios, mixing LHS with other algorithms, or exploring its application in dynamic or uncertain environments.

Author contributions

L.J. conceived the experiment(s). L.J. and Z.Y. conducted the experiment(s), and L.J. performed statistical analysis and figure generation. All authors reviewed the manuscript.

Funding

This research was funded by [the National Science Foundation of China Research on HMS Scheduling Optimization and Control and Intelligence System in Manufacturing IoT Environment] grant number [62063021], and [the National Natural Science Foundation of China Research on Terrain Representation and Dissemination Adaptive Scheduling Strategy for Large-scale Social Network Influence Adaptability] grant number [62162040], and [Education Department of Gansu Province: Young Doctor support Project Research on Distributed Hybrid Flow Shop Scheduling Method Based on Grey Wolf Algorithm and Its Application] grant number [2025QB-114].

Data availability

The original contributions presented in this study are included in the article/supplementary material. Further inquiries can be directed to the corresponding author(s).

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Li Jun and Zhou Yang contributed equally to this work.

References

  • 1.Glaser, B. S. Made in China 2025 and the Future of American Industry (Center for Strategic and International Studies (CSIS), 2022).
  • 2.Oztemel, E. & Gursev, S. Literature review of industry 4.0 and related technologies. J. Intell. Manuf.31 (1), 127–182 (2020). [Google Scholar]
  • 3.Xiong, H. et al. A survey of job shop scheduling problem: The types and models. Comput. Oper. Res. 142, 105731 (2022).
  • 4.Dauzère-Pérès, S. et al. The flexible job shop scheduling problem: A review. Eur. J. Oper. Res.314 (2), 409–432 (2024). [Google Scholar]
  • 5.Serna, N. J. E. et al. A global-local neighborhood search algorithm and Tabu search for flexible job shop scheduling problem. PeerJ Comput. Sci.7, e574 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Soto, C. et al. Solving the multi-objective flexible job shop scheduling problem with a novel parallel branch and bound algorithm. Swarm Evol. Comput.53, 100632 (2020). [Google Scholar]
  • 7.Heydar, M., Mardaneh, E. & Loxton, R. Approximate dynamic programming for an energy-efficient parallel machine scheduling problem. Eur. J. Oper. Res.302 (1), 363–380 (2022). [Google Scholar]
  • 8.Zhang, F. et al. Collaborative multifidelity-based surrogate models for genetic programming in dynamic flexible job shop scheduling. IEEE Trans. Cybernetics. 52 (8), 8142–8156 (2021). [DOI] [PubMed] [Google Scholar]
  • 9.Su, C. et al. Fast Pareto set approximation for multi-objective flexible job shop scheduling via parallel preference-conditioned graph reinforcement learning. Swarm Evol. Comput.88, 101605 (2024). [Google Scholar]
  • 10.Chaudhry, I. A. & Khan, A. A. A research survey: review of flexible job shop scheduling techniques. Int. Trans. Oper. Res.23 (3), 551–591 (2016). [Google Scholar]
  • 11.Yuan, E. et al. Solving flexible job shop scheduling problems via deep reinforcement learning. Expert Syst. Appl.245, 123019 (2024). [Google Scholar]
  • 12.Tutumlu, B. & Saraç, T. A MIP model and a hybrid genetic algorithm for flexible job-shop scheduling problem with job-splitting. Comput. Oper. Res. 155, 106222 (2023).
  • 13.Xu, Y. et al. Hybrid quantum particle swarm optimization and variable neighborhood search for flexible job-shop scheduling problem[J]. J. Manuf. Syst.73, 334–348 (2024). [Google Scholar]
  • 14.Li, J. et al. A job shop scheduling method based on ant colony algorithm. In 2021 IEEE International Conference on Progress in Informatics and Computing (PIC). 453–457 (IEEE, 2021).
  • 15.Li, Y. et al. A reinforcement learning-artificial bee colony algorithm for flexible job-shop scheduling problem with lot streaming. Appl. Soft Comput.146, 110658 (2023). [Google Scholar]
  • 16.Połap, D. & Woźniak, M. Red Fox optimization algorithm. Expert Syst. Appl.166, 114107 (2021). [Google Scholar]
  • 17.Zervoudakis, K. & Tsafarakis, S. A global optimizer inspired from the survival strategies of flying foxes. Eng. Comput. 1–34 (2023).
  • 18.Połap, D. & Woźniak, M. Polar bear optimization algorithm: Meta-heuristic with fast population movement and dynamic birth and death mechanism. Symmetry9 (10), 203 (2017). [Google Scholar]
  • 19.Zervoudakis, K. & Tsafarakis, S. A mayfly optimization algorithm. Comput. Ind. Eng.145, 106559 (2020). [Google Scholar]
  • 20.Geem, Z.W., Kim, J.H. & Loganathan, G.V. A new heuristic optimization algorithm: Harmony search. Simulation76(2), 60-68 (2001). Qin, F., Zain, A.M. & Zhou, K.Q. Harmony search algorithm and related variants: A systematic review. Swarm Evolut. Comput. 74, 101126 (2022).
  • 21.Omran, M. G. & H,Mahdavi, M. Global-best harmony search. Appl. Math. Comput.198 (2), 643–656 (2008). [Google Scholar]
  • 22.Zhao, F. et al. A hybrid harmony search algorithm with efficient job sequence scheme and variable neighborhood search for the permutation flow shop scheduling problems. Eng. Appl. Artif. Intell.65, 178–199 (2017). [Google Scholar]
  • 23.Yuan, Y. et al. A hybrid harmony search algorithm for the flexible job shop scheduling problem. Appl. Soft Comput.13 (7), 3259–3272 (2013). [Google Scholar]
  • 24.Awadallah, M. A. et al. Hybridization of harmony search with hill climbing for highly constrained nurse rostering problem. Neural Comput. Appl.28, 463–482 (2017). [Google Scholar]
  • 25.Doush, I. A. et al. Island neighboring heuristics harmony search algorithm for flow shop scheduling with blocking. Swarm Evol. Comput.74, 101127 (2022). [Google Scholar]
  • 26.Doush, I. A. et al. Flow shop scheduling with blocking using modified harmony search algorithm with neighboring heuristics methods. Appl. Soft Comput.85, 105861 (2019). [Google Scholar]
  • 27.Pan, Q. K., Wang, L. & Gao, L. A chaotic harmony search algorithm for the flow shop scheduling problem with limited buffers. Appl. Soft Comput.11 (8), 5270–5280 (2011). [Google Scholar]
  • 28.Wang, L., Pan, Q. K. & Tasgetiren, M. F. A hybrid harmony search algorithm for the blocking permutation flow shop scheduling problem. Comput. Ind. Eng.61 (1), 76–83 (2011). [Google Scholar]
  • 29.Pan, Q. K. et al. A local-best harmony search algorithm with dynamic sub-harmony memories for lot-streaming flow shop scheduling problem. Expert Syst. Appl.38 (4), 3252–3259 (2011). [Google Scholar]
  • 30.Zhang, S. et al. An improved mayfly method to solve distributed flexible job shop scheduling problem under dual resource constraints. Sustainability 14(19), 12120 (2022).
  • 31.Wang, Z. et al. A novel particle swarm optimization algorithm with lévy flight and orthogonal learning. Swarm Evol. Comput.75, 101207 (2022). [Google Scholar]
  • 32.Jebaraj, L. Applications of differential evolution in electric power systems. In Differential Evolution: From Theory to Practice. 265–296 (Springer Nature Singapore, 2022).
  • 33.Das, S. et al. Exploratory power of the harmony search algorithm: analysis and improvements for global numerical optimization. IEEE Trans. Syst. Man. Cybern. Part. B (Cybern). 41 (1), 89–106 (2011). [DOI] [PubMed] [Google Scholar]
  • 34.Zheng, X. & Wang, L. A knowledge-guided fruit fly optimization algorithm for dual resource constrained flexible job-shop scheduling problem. Int. J. Prod. Res.54 (18), 5554–5566 (2016). [Google Scholar]
  • 35.Shannon, C. E. A mathematical theory of communication. Bell Syst. Tech. J.27 (3), 379–423 (1948). [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The original contributions presented in this study are included in the article/supplementary material. Further inquiries can be directed to the corresponding author(s).


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES