A Hybrid Gray Wolf Weed Algorithm for Flexible Job-shop Scheduling Problem

For the flexible job shop scheduling problem with the goal of makespan, a mathematical model is established and a hybrid algorithm (GIWO) based on gray wolf and invasive weeds is proposed. In this paper, the intrusive weed optimization algorithm is embedded on the basis of the gray wolf algorithm to improve the algorithm’s global search and local search ability. And an effective initial population generation mechanism is added to improve the quality of the initial solution. A variable neighborhood search structure that adaptively changes according to the search is proposed. Finally, other improved gray wolf algorithms are compared with the algorithm in this paper through different benchmark instances. Experimental results show that the proposed algorithm performs better than the other algorithms in effectiveness and superiority. The algorithm can effectively solve the flexible job shop scheduling problem.


Introduction
The job shop scheduling problem (Job shop scheduling problem, JSP) has proved it's an NP-hard problem by GAREY [1]. Flexible job shop scheduling problem (FJSP), as an extension of the classic job shop scheduling problem, is more suitable for new modern manufacturing models. FJSP was first proposed by BRUCKER [2] and had proved to be a more complex NP-hard problem. Compared with the job shop scheduling problem (JSP), in the FJSP problem each operation can be processed in a series of candidate machines, which increases the flexibility of scheduling in the processing process and is more in line with the actual factory production and processing. The research of FJSP problem has become very important in the field of workshop scheduling. At present, the meta-heuristic algorithm has become the main methods to solve the problem of workshop scheduling. The meta-heuristic algorithm provides a detailed solution method for the FJSP problem, and has attracted widespread attention from scholars at home and abroad, but no single algorithm can be comprehensive effectively solve FJSP problems.
Many the meta-heuristic algorithms are developed to solve the maximum completion time of the FJSP problem. Ghiath proposed an improved greedy algorithm to solve the makespan of the workshop in the flexible job shop problem, and constructed a scheduling optimization model of the maximum completion time [3]; Guiliang proposed a new decomposition-based the multi-objective solution algorithm of FJSP, in order to optimize the three goals of the makespan, total weighted early/tardiness penalty and total energy consumption in FJSP [4]; JUN-QIANG LI proposes an improved tabu search algorithm to optimize the four goals of early/delay penalty, maximum workload, completion period and total process workload in FJSP, and builds a multi-objective shop scheduling optimization model  [5]. Currently, most of the problems of FJSP are solved by improved classic algorithm, that integrating a certain classic operator into another algorithm, or the parallel about two classic algorithms, etc. Less attention and research on the newer meta-heuristic algorithms and their extensible structure, so the excellent characteristics of the new meta-heuristics, such as fast convergence speed, strong local search ability, strong robustness are ignored. Therefore, this paper uses new meta-heuristic algorithm to establish a serial structure model, and uses the inter-algorithm dynamic and the excellent characteristic of the new algorithm to solve the FJSP problem.
Grey wolf optimization algorithm is a new meta-heuristic algorithm based on the principle of wolf predation process [6][7][8]. Although the algorithm has been studied and explored late, it has been applied to various optimization problems such as UAV navigation and rectangular part layout due to its excellent global search capabilities. Invasive weed optimization algorithm is a group meta-heuristic optimization algorithm that simulates the reproduction process of weeds in rice fields [9][10][11]. It is similar to the gray wolf algorithm. Due to its excellent local search ability, it has been applied to various fields in class optimization problem. However, the two algorithms are currently less used in the field of production scheduling, and there are only a few literatures that apply the gray wolf algorithm or the invading weed algorithm to the flexible job shop scheduling problem.
This paper focuses on the huge solution space of FJSP problem and the shortcoming of existing algorithms in optimization. A series of designs and improvements are made on the excellent characteristics of the gray wolf algorithm and the invading weed optimization algorithm and propose the hybrid gray wolf weed optimization algorithm (GIWO). This paper adopts two-stage random key coding combined with heuristic rules to improve the quality of the initial population, and uses variable neighborhood search to strengthen the local search ability of the overall algorithm. In this paper, the weed algorithm is embedded in the algorithm to form a serial structure of the algorithm, and make use of the dynamic change of fitness during the population iteration process to achieve better secondary exploration of excellent individuals. Experiments with benchmarks are tested, and the results verify its effectiveness and superiority. 12 , , , ) . During processing the operation follows the constraints: each machine can only process one process at the same time; each process can only be processed on one machine at the same time; only consider the order constraint relationship between the same job's process. This paper aims to optimize the maximum completion time, as follows: where，the total jobs is n ; i T is the completion time of job i J ; ij TS is the start time of operation ij OP ; ij TE is the completion time of operation ij OP ; ijh P is the processing time of operation ij OP on machine h; ijh x If the operation ij OP processed by machine h, ijh x will be 1,else will be 0; Eq.(2) ensure the processing time sustained, Eq.(3) ensure the processing sequence; Eq.(5)-(6) guarantee that two operations can't be processed on the same machine at the same time.
population and then guides the changes of the individual positions in the offspring wolves. Through continuous iterations, food is finally found and captured，which can be given as follows Eq.(7)- (15). Invasive weed optimization (IWO) algorithm is a group meta-heuristic optimization algorithm that simulates the propagation of weeds in rice fields.

The Framework of the GIWO Algorithm
The gray wolf invasion weed optimization hybrid algorithm mainly uses the good characteristics of the two algorithms to perform collaborative processing. The basic flow chart of proposed GIWO is shown in Figure 1. The detail of steps as follows:

Encoding and Decoding
The standard GWO or IWO algorithm is mainly used to solve continuous variable optimization problems. The FJSP problem can be subdivided into two problems: machine allocation and process sequencing, which are discrete optimization problems. In order to achieve the correspondence of continuous spatial variables to discrete variables. The individuals of the population are divided into two-segment coding and the length is 2l , corresponding to the machine allocation plan and the process sorting plan, as shown in Figures 2 and 3. This article uses ROV rules based on random key coding [12,13].
1) Machine assignment The machine part is mainly located in the first half of the individual , and its sorting adopts GLR machine selection methods, namely: global selection (GS), local selection (LS) and random selection (RS), to achieve the balance of machine workload and high utilization rate, and improve the purpose of the initial solution quality. Its use ratio is 0.6, 0.3, 0.1.
2) Operation sequence The process sequence part is mainly located in the latter half of the individual The process part will be arranged according to the ROV rule. First, a position value will be randomly generated for each process position, the value range is   - ， .Then according to the random value, the process arrangement is arranged of the ROV ascending order rule.  In the process arrangement part of decoding, arrange the position elements according to the ascending ROV rule, and convert the position elements into the process sequence numbers they represent, as shown in Figure 4. At the same time, in order to realize that the process can be processed at the earliest possible processing time on the corresponding selectable machine, and to reduce the maximum completion time, the decoding method of active decoding scheduling is adopted.

Initialization
According to the vector representation of individual position, the initialization process is carried out in two steps. The first step is to complete the allocation and sorting of the machine, which is mainly the GLR selection sorting method, which is selected according to the ratio of 0.6, 0.3, and 0.1; the second step is the process sorting part, which is carried out according to the random key coding method.

The Weed Optimization Algorithm
The gray wolf algorithm forms the initial population, and sorts out the top half of the gray wolf individuals according to the fitness of the population, and uses it as the initial parent population of the weed algorithm, and starts to search for the optimal individual iteratively. In this way, the invading weed optimization algorithm is used to find the optimal solution [14]. When the invasive weed optimization algorithm iteratively searches for the optimal value in the population, the encoding and decoding rules are consistent with the gray wolf algorithm. The detail steps as follows: Step 1: Select the number of individuals in the invading weed algorithm population m P according to the population number in the gray wolf algorithm, and determine the maximum number of iterations n I .
Step 2: Calculate the fitness of the population individuals, and calculate the number of seeds e N produced by one individual, as follows:  (16) where, Step 3: Calculate the variance of individual, as follows: where, I n , w I represents the maximum and minimum iterations; m D , n D represents the maximum and minimum variance number，L represents total processes.
Step 4: If the number of individuals in the current population reaches the maximum number of individuals, replace individuals with poorer parents based on fitness to maintain the population size. When the maximum number of iterations is reached, the invasive weed optimization algorithm is jumped out.
In the iterative search process of invading weeds algorithm, the mutation uses position mutation, as follows: where i  distributed evenly in   -1,1 .

Neighborhood Structure
In the entire iterative search process of the algorithm, the quality of the population individuals, especially the three wolves that guide the decision-making level, will determine the final result of the entire optimization algorithm. This paper embeds variable neighborhood search into the whole algorithm, and acts on ,,    three individuals in each iteration. For the individuals, the following three neighborhood structures are designed as follows: NS1：In the process arrangement part, choose two position elements of different processes, and exchange these two position elements.
NS2：Choose a position element in the process arrangement part of the individual, read the value of its position, and change the value of its position through a multi-strategy method, that using different search methods for different individuals. The fitness of the top three of wolves is retained, and according to the fitness difference ,,    , as Eq. (19)-(21). it is transformed into the number of changing positions, for  the process change position is one. This structure can adaptively change the number of position searches in each iteration of the evolution process.  :  : where , abare random numbers. NS3：In the machine arrangement part, an element at a certain position is randomly selected. If there is more than one candidate machine corresponding to this position element, a new machine is randomly selected; if there is only one candidate machine, another position element is randomly selected.
The details of steps can be described as follows: Step 1: Take the first three wolf individual positions as the initial solution X and set the maximum number of iterations max q . Step 2: Calculate the difference between the individual fitness of the three wolves. When the individual fitness of the three wolves or the two wolves are the same, the nearest individual fitness must be selected for replacement, and a random number r will be generated, as follows: ( ) According to the r , chooses different neighborhood search structures to generate new solutions ' X .
Step 4: If the fitness of ' X less than the fitness of X , the individual ' X will replace X , and q increases 1. Step

Across and mutation
In the iterative of GIWO, it is easy to fall into a local optimal solution and reduce the diversity of the population, when only the individuals in the decision-making layer are changed. A better optimization algorithm is not only limited to local search capabilities, but global search capabilities are also very important. This paper, the process part adopts the IPOX cross method, and the machine part uses the two-point cross method [15]. In the mutation, the process part adopts the mutation method based on neighborhood search, as shown in Figure 5. The machine part adopts the mutation method based on random replacement of the machine at one location.

GIWO Step
The details of steps can be described as follows： Step1: Set initial population parameters; Step2: Determine the gray wolf rank according to the fitness value of the individuals; Step3: Individuals of gray wolf population perform invading weed algorithm for iterative optimization,  , and update the three individuals based on the results; Step 5: Performing crossover and mutation operations on individuals, and update the whole population according Eq (7) -(15); Step 6: Whether the algorithm meets the termination condition, if it is satisfied, go to Step 8; otherwise, go to Step 2; Step 7: The algorithm ends and outputs the result.

Results & Discussion
In this section, this paper simulates the benchmark example of FJSP problem. All algorithms are coded in Matble R2016b and run on a computer with Intel Core i5, with Windows 10 operating system.

Parameter Settings
The setting of algorithm parameters has a great impact on the overall performance. In order to achieve a better comparison, the algorithm parameters in this article are consistent with other algorithms, which is the population is 100, and the maximum iterations is 200, maximum iteration number of variable neighborhood search is 20, the cross probability is 0.8, the mutation probability is 0.2, and the Dn is 4, Dw is 20, m p is 50.In order to avoid random errors, each algorithm was run independently twenty times for different benchmark instances and then compared.

Performance Analysis
In this paper, the GIWO algorithm compares with the basic gray wolf algorithm (GWO), the population initialization method is added to the gray wolf algorithm, and the variable neighborhood search algorithm is embedded on the basis of the gray wolf algorithm initialization [13]. vg . min T is the minimum value and best T is the best value in the twenty times. As shown in Table 1, GIWO can always find the optimal solution, compared with the original GWO algorithm, this algorithm can quickly find better solutions with 10. Also, compared with the GWOin algorithm, the algorithm in this paper can find better solutions with 8 and compared with the GWOin+vns algorithm, this paper can basically find the optimal solution accurately with 5. And the dev in this paper is minimum compared with others. In this paper, GIWO algorithm also is compared with SMGAIWO [14], as shown in Table 2. It can be seen from Table 3 above that the improved algorithm in this paper has the same effectiveness as SMGAIWO in solving the benchmark examples.
This paper uses the GIWO algorithm to simulate based on the benchmark examples and calculates the optimal solution as shown in Table 3. The GIWO algorithm's results are better than those in the TS except for the MK08 result [16]. For the results in TSPCB, in addition to the same results obtained by the calculation examples MK03 and MK10, the results obtained by other calculation examples are better [17]. For the results in PSO+TS except for the MK01, MK07, and MK08, the results obtained are better [18]. For the results in MAPSO2, the algorithm in this paper is in the calculation examples MK04 [19]. Except that the results obtained are equal, the results obtained by other calculation examples are better. It further proves the superiority of the proposed algorithm in this paper. It further proves the superiority of the proposed algorithm.  TS  PSO+TS  TSPCB  MAPSO2  GIWO   MK01  42  40  42  41  40  MK02  32  32  28  26  32  MK03  211  207  204  207  204  MK04  81  67  75  65  65  MK05  186  188  179  171  177  MK06  86  85  69  61  84  MK07  157  154  149  173  156  MK08  523  523  555  555  523  MK09  369  437  342  307  331  MK10  296  380  242  312  242   From the Tables 1-3, the GIWO algorithm is accurate and effective in finding the optimal solution. Therefore, the proposed GIWO algorithm is effective and superiority in finding the optimal maximum completion time in solving flexible job shop scheduling.

Conclusions
Aiming at the flexible job shop scheduling problem, this paper studies the gray wolf optimization and invasive weed optimization algorithm and proposes a serial structure, also the population initialization method, variable neighborhood search and global search mechanism are studied. The main conclusions are as follows: (1) In the population initialization, two-stage coding based on random keys is used to realize the conversion from continuous space to discrete scheduling space. Heuristic rules, active and delay-free scheduling are incorporated. Improve the quality of the initial solution.
(2) Embedding the invasive weed optimization algorithm on the basis of the gray wolf algorithm improves the excellent performance of the population, promotes the secondary evolution optimization of