1 Introduction

Many real-world problems can be transformed into optimization problems, such as wireless sensor networks [1], feature selection [2], and scheduling problems [3]. It is worth noting that scheduling problems are important combinatorial optimization problems that find applications in various fields, including industrial production, transportation, energy, and more [4]. Job shop scheduling problem is one of the significant scheduling problems, and its study holds important theoretical and practical value. The Flexible Job Shop Scheduling Problem (FJSP) is a typical optimization problem and a significant extension of the traditional Job Shop Scheduling Problem (JSP) [5]. It has been proven to be an NP-hard problem [6]. The NP-hard nature of this problem implies that even on small-scale instances, there are no polynomial-time algorithms to find the optimal solution.

Since the 1980s, metaheuristic algorithms that simulate biological, physical, and human behavioral processes in the natural world have attracted the attention of scholars both domestically and internationally. These metaheuristic optimization algorithms are characterized by fast convergence, high efficiency, and a wide range of applications, offering new ideas and directions for solving job shop scheduling problems. Consequently, extensive research has been conducted on the development of metaheuristic algorithms, leading to the development of various new population-based algorithms, such as Genetic Algorithm (GA) [7] and Bat Algorithm (BA) [8]. Parizi et al. [9] introduced a novel Woodpecker Mating Algorithm (WMA) called OWMA, which is based on antagonistic learning. The goal of this algorithm is to establish a balance between global exploration and local exploitation phases, simulation results demonstrated that the algorithm exhibited excellent performance in most instance models. Aqel et al. [10] addressed the issue of high CPU time consumption by some metaheuristic algorithms in the context of FJSP and proposed an improved iterative greedy algorithm to mitigate this problem. Wang et al. [11] combined the improved Optimal Foraging Algorithm (OFA) with the Pythagorean Fuzzy Set (PFS) algorithm to establish a multi-objective optimization algorithm called PFSOFA for solving multi-objective FJSP problems. Zhang et al. [12] embedded the WMA position updating equation, which is based on efficient exploration capability, into the HWMWOA algorithm. They used arithmetic spiral motion with a novel search-guiding pattern in the HWMWOA algorithm. Experimental results indicated that the performance of the HWMWOA algorithm outperformed WOA and WMA. Although a large number of metaheuristic algorithms have emerged, the solving and optimization process of most algorithms is accomplished through continuous trial and error, and their performance depends on the complexity of the discussed problems. Algorithms designed specifically for FJSP tend to be complex and less applicable to other optimization problems. Furthermore, these new algorithms often suffer from drawbacks such as long optimization times and low optimization accuracy [13]. Therefore, there is an increasing need for novel and effective algorithms to address the aforementioned issues.

Grey Wolf Optimization (GWO) algorithm is a new swarm intelligence optimization algorithm proposed by Mirjalili et al.in 2014. It mainly simulates the natural gray wolf pack hierarchy and predation behavior, and achieves the purpose of optimization search through emulating the process of searching, encircling and chasing prey behaviors of the gray wolf pack. The GWO algorithm has the advantages of simple principle, few parameters and easy to understand. Relevant research has proved that it is superior to other traditional optimization algorithms in convergence speed and optimization accuracy, and has been widely used to solve various engineering problems. However, the gray wolf algorithm still suffers from the same problems as other heuristic algorithms, such as slow convergence speed, premature convergence and low solution accuracy, etc. In recent years, scholars from both domestic and international backgrounds have actively researched improvements to these issues. Teng et al. [14] proposed a grey wolf algorithm combined with particle swarm optimization, which introduced the idea of Tent chaotic sequence and particle swarm algorithm to improve the search performance of the algorithm. Meidani et al. [15] proposed an improved version of Adaptive GWO, which adaptively adjusts the exploration/exploitation parameters based on the fitness history of candidate solutions during the optimization process. It also controls the stopping criteria by enhancing the importance of fitness-based improvements in optimization. Experimental results show that AGWO can automatically converge to sufficiently good optimal results in the shortest time. Bansal et al. [16] who proposed the use of exploration equations over contrastive learning (OBL) to modify the exploration and exploitation capabilities of classical GWO. Negi [17] et al. proposed a framework for implementing a hybrid PSO-GWO algorithm for solving some reliability assignment and optimization problems and demonstrated the advantages and competitiveness of the framework through numerical experiments. Saremi et al. [18]introduced dynamic evolutionary population operator into the GWO algorithm to enhance the local search capability of the algorithm; Nasrabadi et al. [19]used opposition-based learning strategy to improve the GWO algorithm and parallelize the algorithm; Malik et al. [20]used a weighted distance strategy to adjust the position vector update equation of the GWO algorithm for solving function optimization problems; Madhiarasan et al. [21]proposed to simplify the structure of grey wolf algorithm and introduced the worst individual in the process of algorithm updating, which has achieved good results in optimizing neural network problems.

Despite the commendable efforts made in the above-mentioned research, these methods still face certain challenges, such as slow convergence rates and limited applicability in terms of learning efficiency, particularly in the face of increasing environmental complexity. In the current scenario, these methods still fall short of fully adapting to the specific requirements of practical applications. Therefore, there is a growing need for a more comprehensive and in-depth study to provide more effective ideas and technologies that can effectively address the specific needs of enterprises.To address issues such as slow convergence in the later stages of the standard Grey Wolf Optimization (GWO) algorithm and premature convergence, this paper introduces an optimization algorithm based on the GWO, denoted as SS-GWO. This approach incorporates the spiral mechanism from the Whale Optimization Algorithm (WOA) into the GWO. It employs a strategy of spiral line updates to enable the algorithm to conduct more detailed searches in the vicinity of the optimal solution. The goal is to enhance exploratory and exploitative capabilities while establishing real-time balance between these two phases, with the aim of reducing maximum completion time and delay ratios.The main contributions of this paper can be summarized as follows:

  1. (1)

    A nonlinear convergence factor strategy is used to control the algorithm’s ability to globally explore and locally exploit at different stages to improve the accuracy of finding the optimal solution.

  2. (2)

    Combining the WOA, its spiral search mechanism is used in the GWO algorithm to improve the shortcomings of the algorithm’s slow convergence at the later stage and to improve the exploration ability of the GWO.

  3. (3)

    The improved algorithm SS-GWO is applied to solve the scheduling optimization problem of flexible job shop. By solving 22 classic benchmark test functions and Brandimarte flexible job shop scheduling example analysis experiment, it can on the one hand verify the relative superiority of the improved algorithm SS-GWO proposed in this paper, and on the other hand, it provides a reference theoretical support for the application of the algorithm in the scheduling of flexible job shop, which is of great significance.

2 Encoding and Decoding

Encoding is the genetic gene representation of the solution, which is the primary problem encountered in the optimization process of algorithm implementation and one of the keys to the success of the application. The encoding process must consider the legitimacy, feasibility and validity of the chromosome, as well as the completeness of the representation of the problem solution space, which directly affects the performance of the algorithm in terms of solving speed and computational accuracy.

The standard GWO algorithm is in principle an optimization method dealing with continuous functions, while the scheduling problem in the flexible job shop is a discrete problem of allocating resources. Using appropriate encoding and decoding mechanisms to establish the connection between discrete and continuous bodies is the key for the GWO to solve the FJSP problem.

There are two problems that should be considered for coding in the flexible work shop. The first problem is the rational sequencing of the workpiece processes, and the second problem is that each process of the sequenced workpiece has a corresponding set of machines, and the machines for each process are required to be selected in such a way that the processing time is the shortest after processing all the processes. In this paper, we will use a two-layer coding method to code the flexible scheduling algorithm, the first layer is the process number, and the second layer is the code of the machine selected from the set of selectable machines for the process. We refer to these as machine selection (MS) and operations sequencing (OS). Based on this, chromosome encoding is performed. As an illustration, Table 3 shows an FJSP example with a size of 3 \(\times \) 3 (workpiece \(\times \) machines), and Fig. 1 shows the optimal scheduling scheme for Table 1. Figure 2 shows how the scheduling scheme of Fig. 1 is encoded, divided into operation sequences and machine sequences, which correspond to each other. The first “2” of the operation sequence represents the first process of workpiece 2, which corresponds to “1” of the machine sequence, indicating the processing of \({O}_{21}\) on machine \({M}_{1}\). The process sequence of machine \({M}_{1}\) is \({O}_{21} \rightarrow {O}_{11}\rightarrow {O}_{12}\rightarrow {O}_{33}\), the process sequence of machine \({M}_{2}\) is \({O}_{31}\rightarrow {O}_{22}\rightarrow {O}_{13}\), and the process sequence of machine \({M}_{3}\) is \({O}_{32}\rightarrow {O}_{23}\).The process sequence is coded as follows \({O}_{21}^{1}\rightarrow {O}_{31}^{2}\rightarrow {O}_{11}^{3}\rightarrow {O}_{22}^{2}\rightarrow {O}_{32}^{3}\rightarrow {O}_{12}^{1}\rightarrow {O}_{23}^{3}\rightarrow {O}_{13}^{2}\rightarrow {O}_{33}^{1}\).

The scheduling scheme can be decoded by scanning the operation sequence from left to right to fetch the machine assignment for each operation. The first “1” in the operation sequence section indicates the first process of job 1, while the corresponding “3” in the machine assignment section indicates that the operation is processed on machine \({M}_{3}\). The second “2” in the operation sequence section indicates the second process of job 2, while the corresponding “2” in the machine assignment section indicates that the job is processed on machine \({M}_{2}\). According to the above description, the operation sequence and machine assignment of the process can be understood as (\({O}_{21}\),\({M}_{1}\)),(\({O}_{31}\),\({M}_{2}\)),(\({O}_{11}\),\({M}_{3}\)),(\({O}_{22}\),\({M}_{2}\)),(\({O}_{31}\),\({M}_{3}\))(\({O}_{12}\),\({M}_{1}\)),(\({O}_{23}\),\({M}_{3}\)),(\({O}_{13}\),\({M}_{2}\)), (\({O}_{33}\),\({M}_{1}\)).

Fig. 1
figure 1

Scheduling scheme of Table 1

Fig. 2
figure 2

A coded representation of Fig. 1

3 Standard Grey Wolf Optimization

3.1 Algorithm Principle

Gray wolves belong to the canine family and are considered top predators, which are at the top of the biosphere food chain. Gray wolves mostly prefer to live in packs, with an average of 5 to 12 wolves in each group. Of particular interest is the fact that they have a very strict social hierarchy [22], as shown in Fig. 3.

Fig. 3
figure 3

The pyramid of Social hierarchy of grey wolves

The first level of the pyramid is the leader of the pack, called \(\alpha \). In the wolf pack, \(\alpha \) is the individual with management ability and is mainly responsible for various decisions in the pack, such as hunting, the time and place to sleep, and food distribution. The second layer of the pyramid is the think-tank team of \(\alpha \), called \(\beta \). \(\beta \) is mainly responsible for assisting \(\alpha \) in making decisions. When there is a vacancy of \(\alpha \) in the whole wolf pack, \(\beta \) will take over \(\alpha \)’s position. \(\beta \)’s dominance in the wolf pack is second only to \(\alpha \). It gives \(\alpha \)’s orders to other members and feeds back the implementation of other members to \(\alpha \) to play the role of a bridge. The third layer of the pyramid is \(\delta \). \(\delta \) follows the decision-making orders of \(\alpha \) and \(\beta \) and is mainly responsible for matters such as scouting, sentry duty and caretaking. Poorly adapted \(\alpha \) and \(\beta \) will also be reduced to \(\delta \). The bottom layer of the pyramid is \(\omega \), which is mainly responsible for the balance of relationships within the population.

3.2 Mathematical Models

The GWO algorithm solves the specific optimization problem by dividing the gray wolf population into four groups \(\alpha \), \(\beta \), \(\delta \), and \(\omega \). The first three groups \(\alpha \), \(\beta \), and \(\delta \) guide the fourth group \(\omega \) to search forward toward the target. The GWO algorithm mainly simulates 3 behaviors of gray wolf pack hunting: surrounding prey, chasing prey, and attacking prey.

(1) Surrounding prey

When wolves find prey, they will quickly advance toward the prey, and during the hunt, the behavior of gray wolves in surrounding prey is defined as follows:

$$\begin{aligned}{} & {} \vec {D}=|\vec {C} \cdot \overrightarrow{X_p}(\textrm{t})-\vec {X}(\textrm{t})|\end{aligned}$$
(1)
$$\begin{aligned}{} & {} \vec {X}(\textrm{t}+1)=\overrightarrow{X_P}-\vec {A} \cdot \vec {D} \end{aligned}$$
(2)

Equation (1) represents the distance between an individual and its prey, and Eq. (2) is the update formula for the position of the gray wolf. Where t is the current iteration, \(\vec {A}, \vec {C}\) are coefficient vectors \(\vec {X_{P}}\) is the position vector of the prey, and \(\vec {X}\) is the position vector of the grey wolf, \(\vec {A}\) and \(\vec {C}\) are calculated as follows:

$$\begin{aligned}{} & {} \vec {A}=2 \vec {a} \cdot \overrightarrow{r_1}-\vec {a} \end{aligned}$$
(3)
$$\begin{aligned}{} & {} \vec {C}=2 \cdot \overrightarrow{r_2} \end{aligned}$$
(4)

where \(\vec {a}\) is the convergence factor, and as the number of iterations decreases linearly from 2 to 0, the modulus of \(\vec {r_{1}}\) and \(\vec {r_{2}}\) is taken as a random number between [0,1].

(2) Chasing prey

Gray wolves are able to identify the location of prey and encircle them. When the gray wolves identify the location of the prey, \(\beta \) and \(\delta \) guide the wolves to encircle the prey under the leadership of \(\alpha \). In the decision space of the optimization problem, we do not know the best solution (the location of the prey). Therefore, to model the hunting behavior of the gray wolf, we assume that \(\alpha \), \(\beta \) and \(\delta \) are more aware of the potential location of the prey. We save the three optimal solutions obtained so far and use the positions of these three to determine where the prey is, while forcing other gray wolf individuals (including \(\omega \)) to update their positions based on the positions of the optimal gray wolf individuals, gradually approaching the prey. The mechanism by which individuals within a wolf pack track the location of their prey is shown in Fig. 4. Among them, the parameter R represents the range of possible positions where the next gray wolf may appear after the current iteration update of gray wolf positions.

Fig. 4
figure 4

The GWO location update mechanism

The mathematical model of an individual gray wolf tracking the location of its prey is described as follows:

$$\begin{aligned} \left\{ \begin{array}{l} \overrightarrow{D_\alpha }=|\overrightarrow{C_1} \cdot \overrightarrow{X_\alpha }-\vec {X}|\\ \overrightarrow{D_\beta }=|\overrightarrow{C_2} \cdot \overrightarrow{X_\beta }-\vec {X}|\\ \overrightarrow{D_\delta }=|\overrightarrow{C_3} \cdot \overrightarrow{X_\delta }-\vec {X}|\end{array}\right. \end{aligned}$$
(5)

where \(\overrightarrow{D_\alpha }\),\(\overrightarrow{D_\beta }\) and \( \overrightarrow{D_\delta }\)denote the distances between \(\alpha \), \(\beta \) and \(\delta \) and other individuals, respectively; \(\overrightarrow{X_\alpha }\),\(\overrightarrow{X_\beta }\) and \( \overrightarrow{X_\delta }\) denote the current positions of \(\alpha \), \(\beta \) and \(\delta \), respectively;\(\overrightarrow{C_1}\), \(\overrightarrow{C_2}\) and \( \overrightarrow{C_3}\) is random vectors, \(\overrightarrow{X}\) is the current location of the gray wolf.

$$\begin{aligned}{} & {} \left\{ \begin{array}{l} \overrightarrow{\textrm{X}_1}=\overrightarrow{\textrm{X}_\alpha }-\textrm{A}_1 \cdot \overrightarrow{\left( \textrm{D}_\alpha \right) } \\ \overrightarrow{\textrm{X}_2}=\overrightarrow{\textrm{X}_\beta }-\textrm{A}_1 \cdot \overrightarrow{\left( \textrm{D}_\beta \right) } \\ \overrightarrow{\textrm{X}_3}=\overrightarrow{\textrm{X}_\delta }-\textrm{A}_1 \cdot \overrightarrow{\left( \textrm{D}_\delta \right) } \end{array}\right. \end{aligned}$$
(6)
$$\begin{aligned}{} & {} \overrightarrow{X_{(t+1)}}=\frac{\overrightarrow{X_1}+\overrightarrow{X_2}+\overrightarrow{X_3}}{3} \end{aligned}$$
(7)

Equation (6) defines the step length and direction of \(\omega \) individuals in the wolf pack toward \(\alpha \), \(\beta \) and \(\delta \), respectively, and Eq. (7) defines the final position of \(\omega \).

(3) Attacking prey

Finally, the mathematical description of the attack by the gray wolf pack is \(\vec {a}\) decreases from 2 to 0 as the number of iterations increases. When \(A \le 1\), it corresponds to local search and the gray wolf pack concentrates its attack on the prey; when \(A > 1\), the gray wolves disperse and the algorithm starts global search (Fig. 5).

Fig. 5
figure 5

Attack on prey and search for prey

3.3 Algorithm Process

See Fig. 6.

Fig. 6
figure 6

Flow chart of standard GWO algorithm

4 Flexible Job-Shop Scheduling Problems

4.1 FJSP

Suppose a flexible work shop has m processing machines and n workpieces, each workpiece has a number of different processes to be processed, while the processing of the processes is carried out in a certain order, each process can be carried out on many different machines, and the processing time required is different. The optimization objective of the FJSP problem is to assign the appropriate machine to each process and to rank the processing order of the processes on each machine with a view to achieving the given objective optimally.

Table 1 shows an example of flexible job shop scheduling for a 3 \(\times \) 3, where\({O}_{ij}\)denotes the jth process of workpiece i, \({M}_{1}~{M}_{3}\) indicates the available machines in the workshop, “–” indicates that the corresponding process for the corresponding workpiece cannot be processed on the current machine.

For FJSP issues, the following premises exist [23]:

  1. (1)

    Zero moment when all workpieces and machines are in a usable state;

  2. (2)

    Machine preparation time prior to processing is ignored;

  3. (3)

    Once the process is started, it cannot be interrupted;

  4. (4)

    A machine capable of handling only one workpiece at a time;

  5. (5)

    The processes of different workpieces are independent of each other, and the processes of the same workpiece have a definite relationship of successive processing;

  6. (6)

    Each workpiece is machined with the same priority.

4.2 Mathematical Model

The mixed 0-1 integer programming model developed in this chapter with the objective of minimizing the maximum completion time of the shop is as follows:

$$\begin{aligned}{} & {} \min C_{\max }=\max \left( C_{i j}\right) \end{aligned}$$
(8)
$$\begin{aligned}{} & {} C_{i j}=S_{i j}+\sum _{k=1}^m x_{i j k} t_{i j k} \end{aligned}$$
(9)
$$\begin{aligned}{} & {} S_{i^{\prime } j^{\prime }}+c\left( 1-y_{i j i^{\prime } j^{\prime } k}\right) \ge C_{i j} \end{aligned}$$
(10)
$$\begin{aligned}{} & {} S_{ij}+c_{yiji^{\prime }j^{\prime }}\ge C_{i^{\prime }j^{\prime }} \end{aligned}$$
(11)
$$\begin{aligned}{} & {} S_{i\left( j+1\right) }-C_{ij}\ge 0 \end{aligned}$$
(12)

where, n is the number of workpieces; m is the number of machines(\(k \in \left\{ 1, 2... m \right\} \)); assume that \({O}_{ij}\)is thej-th process of workpiece i; \({C}_{max}\) denotes the maximum completion time; \({C}_{ij}\) denotes the completion time of process\({O}_{ij}\); \({S}_{ij}\) denotes the start processing time of process \({O}_{ij}\); \({x}_{ijk}\) is a variable that indicates that process \({O}_{ij}\) is processed on machine k when it is 1 and 0 otherwise; \({t}_{ijk}\) indicates the processing time of process \({O}_{ij}\) on machine k; \({y}_{iji^{\prime }j^{\prime }k}\) is a variable that indicates that process \({O}_{ij}\) is processed on machine k before process \({O}_{i^{\prime }j^{\prime }}\) when it is 1, otherwise it is 0; c is an infinite number.

Table 1 An instance of 3\(\times \)3 partial FJSP

Equation (8) indicates that the optimization objective of this paper is to minimize the maximum completion time; Eq. (9) is the formula for calculating the process completion time, which indicates that the machining process of the workpiece cannot be interrupted; Eqs. (10) and (11) indicate the sequence constraints of the workpiece processes processed on the same machine; Eq. (12) indicates that the sequence of different processes of the same workpiece has constraints.

5 GWO Algorithm Improvement

5.1 Nonlinear Time-Varying Adaptive Weight

In the standard GWO algorithm, when \(|{A}|\>1 \), the candidate solution is far away from the prey and enters the search phase, which requires the widest possible search range, when a larger value of A allows the individual gray wolf to maintain a better exploration ability; in \(|{A}|\le 1\), the candidate solution approaches the prey, and the GWO algorithm will try to achieve higher search accuracy according to the location of the optimal solution, and a smaller A value will correspond to a better local exploitation capability. In other words, the change of A value directly affects the global exploration ability and local exploitation ability of the algorithm at different stages. In the basic GWO algorithm, the value of A is determined by the control parameter a. Therefore, a weight factor that varies with the number of iterations can be introduced to control the value variation of a.

In this paper, we propose a nonlinear time-varying adaptive weight, which is defined as follows.

$$\begin{aligned} a=2\times \left( 1-\left|\frac{cos\frac{e^{\frac{t}{t_{max}}}}{2}-cos\frac{1}{2}}{cos\frac{e}{2}-cos\frac{1}{2}}\right|\right) \end{aligned}$$
(13)

where t is the current number of iterations and \({t}_{max}\) denotes the maximum number of iterations of the algorithm.

Fig. 7
figure 7

Change curves of the convergence factor a

As shown in Fig. 7, the proposed weight factor decreases slowly at the beginning of iterations, and the algorithm can maintain a good global exploration capability; the weights drop rapidly after a certain number of iterations, which enables the algorithm to search for the optimal solution more finely in the local development stage.

5.2 Fusing WOA Algorithm with GWO

Inspired by the hunting behavior of humpback whales, the Whale Optimization Algorithm (WOA) was proposed by Mirjalili et al. [24] in 2016, The same as the GWO algorithm, this algorithm is a group intelligent optimization algorithm that imitates the feeding behavior of whales in nature, with the characteristics of fewer parameters, multiple group synergy, and good algorithm adaptability, and it has been successfully applied to a variety of optimization problems because of its superiority-seeking ability in large-scale problem models. The WOA algorithm simulates the hunting behavior of humpback whales, called the bubble net attack. This kind of attack is accomplished by forming unique bubbles along a spiral path as the humpback whale surrounds its prey. During the spiral update phase, the algorithm mimics the whale’s hunting behavior by spiraling ever so slowly closer to the prey as it finds it. When a whale individual swims in a spiral, it first calculates the distance between it and its prey (replaced by the current optimal individual), and then gradually approaches its prey in a spiral manner, with the following mathematical model.

$$\begin{aligned}{} & {} D=|C \cdot X p_{(t)}-X_{(t)}|\end{aligned}$$
(14)
$$\begin{aligned}{} & {} X_{(t+1)}=D \cdot e^{b l} \cdot \cos (2 \pi l)+X p_{(t)} \end{aligned}$$
(15)

where t is the number of current iterations; \({X}_{(t)}\) is the individual position vector; \({X}_{P(t)}\) is the prey position vector, where D is shown in Eq. (14); b is the constant used to qualify the logarithmic spiral shape; and L is a random number of \([-1, 1]\).

In order to solve the limitation of slow convergence of GWO algorithm in the late stage, improve the exploration ability of GWO and solve the problem of premature convergence of GWO, this paper hybridizes GWO and WOA algorithm with good exploration ability, uses the spiral mechanism of whale optimization algorithm for GWO algorithm, and uses the spiral line update position strategy to make the algorithm search more exhaustively near the optimal solution to improve the shortcoming of weak exploration ability of GWO.

$$\begin{aligned} {\left\{ \begin{array}{ll}\vec {X}_{(t+1)}=\frac{\vec {X}_1+\vec {X}_2+\vec {X}_3}{3}-m \cdot |\frac{\vec {X}_1+\vec {X}_2+\vec {X}_3}{3}-\vec {X}_{(t)}|&{} h>0.5 \\ \vec {X}_{(t+1)}=\frac{\vec {X}_1+\vec {X}_2+\vec {X}_3}{3}+\left[ \frac{\vec {X}_1+\vec {X}_2+\vec {X}_3}{3}-\vec {X}_{(t)}\right] \cdot e^{b l} \cdot \cos (2 \pi l) &{} h<0.5\end{array}\right. } \end{aligned}$$
(16)

where b is a constant coefficient, h and m are random numbers between [0,1], and l is a random number between \([-1,1]\).

5.2.1 Search Mechanism of SS-GWO Algorithm

Fig. 8
figure 8

Location distribution of gray wolf individuals under the constriction enclosure mechanism

  1. (1)

    Random movement of gray wolf individuals(global search)

    While the group is preying, individual gray wolves will move randomly according to each other’s position. The group search is the process of convergence to the optimal value, which represents the local search, while the convergence target of random movement is a random individual, so it represents the global search of the gray wolf. This behavior can also avoid the algorithm from falling into local optima to some extent.

  2. (2)

    Grey wolf predation pattern combined with spiral search(local search)

    1. a.

      Contraction of the envelope mechanism (linear movement)

      When the value of the random value A lies within \([-1,1]\), the next position of the individual gray wolf may be anywhere between its position and that of its prey. Figure 8 shows the random position of the gray wolf individual (X,Y) converging to the current optimal individual (X*,Y*) when A is at [0,1]:

    2. b.

      Spiral search mechanism (spiral movement)

      This stage first uses the position of individual gray wolves to calculate the distance between the location of the prey and the optimal individual within the current population, and then searches in a spiral movement. where, b is a constant that defines the shape of the logarithmic spiral and l is a random number within \([-1,1]\). The behavior of this spiral convergence can be represented by Fig. 9.

Fig. 9
figure 9

Location distribution of gray wolf individuals under the spiral search mechanism

5.3 Improved SS-GWO Algorithm Flow

Step 1 Set the size of the population to N, dimension d, and initialize the A, C, a.

Step 2 By using randomly generated data as the initial population information \(\big \{ {X}_{i}, i=1, 2, 3,..., N\big \}\), then calculate the individual fitness value \(\left\{ {f}_{i}, i=1, 2, 3,..., N\right\} \).

Step 3 Sort the order of fitness values by size, and take the first three fitness values corresponding to the individual as \(\alpha \), \(\beta \), \(\delta \). The corresponding position information is \({X}_{\alpha }, {X}_{\beta }, {X}_{\delta }\).

Step 4 Use Eq. (13) to calculate the nonlinear control parameters a, and then update the value of A and C according to Eqs. (3) and (4).

Step 5 Use Eq. (16) to update the location of individuals, then recalculate the fitness values and update values of \(\alpha , \beta , \delta \).

Step 6 Judge whether t reaches \({T}_{max}\) value, if reached, the fitness value of \(\alpha \) is output, that is, the best solution. Else go to Step 3 (Fig. 10).

Fig. 10
figure 10

Algorithm flow chart of SS-GWO

6 Algorithm Verification and Performance Analysis

In this section, we set up a series of comparative experiments to verify the effectiveness of the proposed SS-GWO. The proposed SS-GWO algorithm is compared with several state-of-the-art algorithms through a series of comparative experiments, and its performance is evaluated by solving a large-scale brandimarte flexible shop floor scheduling arithmetic and 22 classical benchmarking functions. The algorithm verification experiments were implemented in Matlab 2021b using MATLAB language programming, and the computer model was Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz, Win10.

6.1 Brandimarte Flexible Shop Scheduling Example

In this section, we design a large-scale brandimarte experiment to verify the effectiveness of SS-GWO algorithm for solving flexible job-shop scheduling problems. In these examples, large-scale brandimarte flexible shop floor scheduling examples were used for this experiment, where the number of workpieces ranged from 10 to 20, the number of machines ranged from 6 to 15, and the number of processes ranged from 58 to 232.

Under the same experimental conditions, the performance of eight algorithms, namely IGWO [26], GA [28], SLGA [29], HGWO [30], ABC [31], TS [25], GWO, and SS-GWO, was verified. By solving ten brandimarte instances [25] with different scales (jobs * machines) and targeting the minimization of maximum completion time, the comparative results between the SS-GWO algorithm and other algorithms were obtained.

Table 2 The best value (BV) obtained by 8 algorithms to solve 10 examples
Fig. 11
figure 11

The algorithm solves MK1-10 to get the boxplot of the results

Table 2 presents the optimal solutions obtained by the 8 algorithms for solving the 10 instances. The best result for each example is highlighted in bold. In addition, “+” indicates that the comparison algorithm performs poorly compared to SS-GWO. “–” indicates that the comparison algorithm performs better than SS-GWO, and “=” indicates a “not significantly different” relationship between the comparison algorithms and SS-GWO. “g/d/l” denotes that SS-GWO wins on g instances, draws on d instances, and fails on l instances, and LB denotes the historical optimum of the 10 algorithms [27]. As can be seen from Table 2, for the arithmetic examples MK1-MK10, the SS-GWO algorithm obtains the optimal solution with respect to all the other six except HGWO, which indicates that the SS-GWO algorithm has good convergence performance. Meanwhile, the HGWO algorithm also achieves better results in 10 arithmetic cases. By counting the results obtained by running MK1-10 for 20 times and obtaining the box-and-line diagram shown in Fig. 11, it can be intuitively and clearly seen that the optimal and Median value obtained by SS-GWO have a large advantage, which further verifies the convergence of the algorithm.

Figure 12 gives the average of the running times obtained from 20 runs of the eight algorithms. Analysis of the data in Fig. 12 shows that SS-GWO is the fastest algorithm. This result is due to the fact that the optimal fusion evaluation strategy reduces the number of unproductive iterations and computation time, proving that the improvement of the GWO proposed in this paper further improves the solution speed.

Fig. 12
figure 12

Comparison of time taken by algorithms to solve MK1-10

Fig. 13
figure 13

Convergence curve of Brandimarte MK01

Figure 13 shows the scheduling scheme and convergence curves obtained by SS-GWO solving MK01 with an artifact-machine size of 10\(\times \)6. The different colors in the figures represent different workpieces, the vertical axis represents the machine, the horizontal axis represents the machining time, \({C}_{max}\) represents the shortest machining time that can be achieved by using SS-GWO, from the figure it can be seen that the shortest machining time of the calculation example MK01 reaches 39.

Table 3 shows the relative percentage deviation (RPD) calculated by Eq. (17), and the values of BV are shown in Table 2. And in the last row of Table 3, the average value of RPD of the 8 algorithms solving 10 cases is calculated and the difference between the average RPD of SS-GWO and the other 7 algorithms is compared, as shown in Fig. 14, which shows that SS-GWO will obtain a better solution than other algorithms except SLGA when solving the same scheduling problem relative to other algorithms.

$$\begin{aligned} RPD=\frac{BV-LB}{LB}\times 100\% \end{aligned}$$
(17)
Table 3 The RPD obtained by 9 algorithms to solve 10 examples
Fig. 14
figure 14

Different in average RPD

Table 4 22 classic benchmark test functions

6.2 22 Classical Benchmark Test Functions

In this section, the performance of the algorithm is evaluated by solving 22 classical benchmark test functions whose basic information is shown in Tables 4 and 5. To avoid the randomness of the evolutionary algorithms, each algorithm was tested with 20 simulations for each test function. The experimental data are statistically analyzed and the performance of each algorithm is evaluated in terms of statistical features such as optimal value, mean and standard deviation. For all algorithms, the population size and maximum number of iterations were set to 90 and 300, respectively. The settings of other parameters for each algorithm are shown in Table 6.

Table 5 22 Classic benchmark test functions
Table 6 Parameters of optimization algorithm
Table 7 Optimal values of the optimization results
Table 8 Average values of the optimization results
Table 9 Standard deviations of the optimization results

The results of the comparison between SS-GWO and other algorithms on the 22 test functions are shown in Tables 7, 8, 9. The first column is the name of the test function and the second to ninth columns are the experimental results. The results of the computation of the optimum, mean and standard deviation are shown in Tables 7, 8, 9, respectively. As can be seen from Tables 7, 8, 9, for the test functions F14-F22, most of the algorithms get the optimal solution, only SS-GWO shows superiority on F1-F13, and the results show that SS-GWO can handle the high-dimensional problems well. Moreover, the superiority of SS-GWO becomes more obvious as the dimension of the test function increases. This is due to the fact that the improvement strategy effectively ameliorates the problem of the algorithm’s tendency to fall into local optimality. From Table 9, it can be seen that the standard deviation obtained by SS-GWO is significantly better than that of other algorithms, indicating that the convergence performance of SS-GWO is stable. In Tables 7, 8, 9, the superiority of SS-GWO can be easily seen from the results of “g/d/l”.

In order to illustrate the performance advantages of SS-GWO more intuitively, the convergence curves of different algorithms for solving the test function are plotted, as shown in Fig. 15. From the convergence curves, it can be seen that there is no significant difference in the final convergence accuracy of the algorithms on low-dimensional test functions such as F14–F22. While on the high dimensional test functions such as F1–F13, only SS-GWO can get the best results. The higher the dimension of the test function, the more obvious the superiority of SS-GWO. Thus, the superiority of SS-GWO in solving high-dimensional functions is further confirmed. In addition, it can be seen from Fig. 15 that the accuracy of SS-GWO is significantly improved, indicating that the improvement strategy is effective.

Fig. 15
figure 15

Convergence curves of different algorithms on solving the test functions

To further demonstrate the speed advantage of SS-GWO, the computation time when searching for the optimal value of the test function was compared, as shown in Table 10, where NaN indicates that the algorithm was unable to find the global optimum in 200 iterations. From Table 10, it can be seen that SS-GWO has a significant speed advantage. SS-GWO retains the advantage of GWO’s fast convergence speed, while the improved strategy compensates for its disadvantage of easily falling into local optima. As a result, the number of iterations is reduced and the search speed of the algorithm is improved. In summary, the results of the above work clearly show that SS-GWO has better global exploration capability and local excavation capability.

Table 10 Calculation time of the algorithms

To further evaluate the effectiveness of the improvement strategy, we conducted a significance test at a 5% significance level using the Wilcoxon rank-sum test [32] on SS-GWO and five other metaheuristic algorithms to determine if there are significant differences. We applied this test to 10 selected benchmark functions (D = 10). Table 11 presents the p-values calculated for SS-GWO and the other algorithms. Bold values indicate no significant difference or comparable performance. When the p-value is less than 0.05, it indicates a significant difference between the two algorithms. N/A signifies that both algorithms achieved comparable performance with optimization results equal to 0.

Table 11 P value of Wilcoxon rank-sum test (D = 10)

Table 11, it can be observed that SS-GWO performs significantly better than the other metaheuristic algorithms on the selected benchmark functions. In the case of F5 and F10, the performance of SS-GWO is comparable to SSA, GA, SLGA, and GWO, and significantly better than ABC. For F6 and F9, SS-GWO exhibits no significant difference compared to SLGA but significantly outperforms other metaheuristic algorithms. In summary, SS-GWO demonstrates a significant advantage over most of the comparison algorithms on the mentioned functions, further confirming the effectiveness of the proposed strategy.

7 Conclusion

7.1 Summary

The growing demand for simple and efficient metaheuristic algorithms has led to the development of an improved Grey Wolf Optimization algorithm, SS-GWO, for solving the Flexible Job Shop Scheduling Problem (FJSP). Extensive research on GWO and identification of algorithmic shortcomings served as the basis for the proposed SS-GWO algorithm. Through benchmark instance simulations and comparisons with other algorithms, the effectiveness of SS-GWO was validated. Results from testing on Brandimarte’s FJSP instances, with the objective of minimizing the maximum completion time, demonstrated that SS-GWO provides results similar to or equal to classical heuristics but significantly improves convergence speed, especially for large problem instances. Compared to IGWO and GWO, SS-GWO reduced the maximum completion time by 19% and 37%, respectively, showcasing its capability to meet practical production scheduling requirements and confirming its effectiveness and practicality in production scheduling. Furthermore, solving 22 benchmark test functions demonstrated the robustness of the new approach to random influences, with minimal impact from variations in hyperparameters, only noticeable in cases of significant deviation from ideal settings.

7.2 Prospect

In most cases, job shop scheduling is typically regarded as a resource allocation problem. It involves arranging job sequences and machine configurations sensibly based on existing constraints to minimize processing time and costs. Therefore, it is essential to consider various real-time scenarios, such as process insertion, machine failures, process cancellations, dynamic tasks, and multi-objective problem-solving, which can make FJSP quite complex. However, this paper focuses solely on solving the single-objective FJSP. Therefore, our future research will concentrate on applying the algorithm to more complex instances of FJSP, including considerations like machine loads, urgent job insertions, and carbon emission constraints. Additionally, our algorithm validation in experiments requires further optimization, addressing issues such as overly simplified scheduling instance models and a limited number of compared algorithms. Furthermore, the improvements made in this paper have led to a slight increase in computational complexity, making it comparatively more demanding in terms of hardware resources than other algorithms. Thus, future work should involve an analysis of the algorithm’s underlying model principles, parameters, and formulas to understand their impact on algorithmic search performance. While striving to enhance algorithm search accuracy, efforts should be made to minimize both computational requirements and complexity, which may include using chaos theory to enhance algorithm performance and initializing populations to reduce model complexity.