An Improved Genetic Algorithm for Solving the Multi-AGV Flexible Job Shop Scheduling Problem

In real manufacturing environments, the number of automatic guided vehicles (AGV) is limited. Therefore, the scheduling problem that considers a limited number of AGVs is much nearer to real production and very important. In this paper, we studied the flexible job shop scheduling problem with a limited number of AGVs (FJSP-AGV) and propose an improved genetic algorithm (IGA) to minimize makespan. Compared with the classical genetic algorithm, a population diversity check method was specifically designed in IGA. To evaluate the effectiveness and efficiency of IGA, it was compared with the state-of-the-art algorithms for solving five sets of benchmark instances. Experimental results show that the proposed IGA outperforms the state-of-the-art algorithms. More importantly, the current best solutions of 34 benchmark instances of four data sets were updated.


Introduction
The flexible job shop scheduling problem (FJSP) widely exists in the modern manufacturing workshop and is becoming more and more important. For FJSP, an operation can selected to be machined by a set of machines instead of one. Therefore, two sub-problems, namely machine selection and operations sequencing must be determined. Moreover, FJSP has proved to be an NP-hard problem [1,2]. In real production, there is a certain distance between different machines. The jobs must be transformed by automatic guided vehicles (AGVs) from machines to machines. Due to the high price of AGVs and the workshop layout, the number of AGVs is limited. The FJSP with a limited number of AGVs (FJSP-AGV) is much nearer to real production than FJSP and very important. Compared with FJSP, FJSP-AGV should solve three sub-problems, namely the machine selection sub-problem, the AGV selection sub-problem, and the operations sequencing sub-problem. Therefore, FJSP-AGV is a much more difficult NP-hard problem than FJSP [3].
The genetic algorithm (GA) is inspired by the process of natural selection and has been widely implemented to solve shop scheduling problems [4,5]. Moreover, GA shows good effectiveness for solving FJSP [6,7] and therefore, can be used for solving FJSP-AGV. With regard to the classical GA, the diversity of the population decreases with the algorithm iteration, and some individuals can become extremely similar, even identical, causing stagnation of population evolution. In order to overcome this problem, an improved GA (IGA) with a population diversity check method was specifically designed. Comparison experiments of benchmark instances were conducted to evaluate the effectiveness and efficiency of IGA. What is more, the proposed IGA can update the current best solutions of 34 benchmark instances.
The rest of this paper is presented as follows: Section 2 introduces the literature review of FJSP-AGV; Section 3 describes the FJSP-AGV; Section 4 presents the IGA from several aspects in detail; Section 5 displays the experimental results; Section 6 contains the conclusions and proposed future work.

Literature Review of FJSP-AGV
JSP with a limited number of AGV is named as JSP-AGV. With regard to JSP-AGV, the existing works have been focused on minimizing makespan. Bilge and Ulusoy [21] designed an iterative algorithm and a set of benchmark instances. Erol et al. [22] developed a multi-agent-based algorithm, which includes four agents, namely manager agent, staff agent, AGV agent, machine agent, and AGV-machine resource agents. Deroussi et al. [23] designed a novel neighboring method, which includes three intelligent algorithms, namely iterated local search, simulated annealing, and their hybridization. Kumar et al. [24] developed a novel differential evolution algorithm, whose encoding only considers the operations sequencing sub-problem. Moreover, the machine selection sub-problem and the AGV selection sub-problem are determined in the decoding with specific heuristics. Zheng et al. [25] designed a tabu search algorithm and first presented a mixed integer linear programming (MILP) model to obtain optimal solutions. Fontes and Homayouni [26] proposed an improved MILP by considering more constraints for minimizing makespan of JSP-AGV. Abdelmaguid et al. [27] proposed a hybrid GA/heuristic approach, while the heuristic is to determine the AGV selection in the decoding scheme. Lacomme et al. [28] designed a disjunctive graph-based framework for modeling JSP-AGV and an improved memetic algorithm. Ham [29] first developed a constraint programming model and a new set of benchmark instances.
In order to simultaneously optimize makespan, mean flow time, and mean tardiness of JSP-AGV, an improved multi-objective GA was designed [30], which determines the AGV selection sub-problem in the decoding. With regard to JSP-AGV simultaneously making makespan, AGV travel time, and minimized penalty cost, a multi-objective GA was designed, which used the fuzzy expert system to adjust crossover operators [31]. With consideration of the battery charge of AGV, three intelligent algorithms, namely GA, particle swarm optimization (PSO), and hybrid GA-PSO were developed to simultaneously make makespan with the number of AGV being minimized [32].
With only one AGV in a flexible manufacturing system, Caumond et al. [33] proposed a MILP for scheduling problems. Moreover, the maximum number of jobs, the limited input/output buffer capacities, and the no-move-ahead trips were taken into consideration simultaneously. With regard to FJSP-AGV on minimizing makespan, Ham [29] extended the constraint programming model of JSP-AGV and proved the optimality of ten benchmark instances [34]. Homayouni and Fontes [3] proposed the first MILP model for solving smallsized instances to optimality and a local search-based heuristic for solving small to largesized instances. Chaudhry et al. [35] presented a Microsoft Excel spreadsheet-based solution and GA, and Homayouni et al. [11] proposed a multi-start biased random key genetic algorithm (BRKGA). In BRKGA, the encoding only considers the operations sequencing sub-problem, and the machine selection and AGV selection sub-problems are determined by several different greedy heuristics. Zhang et al. [36] designed a hybrid algorithm GATS that combines GA and tabu search algorithm (TS) for minimizing makespan and of FJSP-AGV with bounded processing times. In GATS, the GA decides the machine-AGV selections of all operations and TS optimizes the operations sequencing. In order to fast and accurately estimate the makespan of FJSP-AGV, Cheng et al. [37] designed an adaptive ensemble model of back propagation neural networks. Yan et al. [38] first studied the FJSP-AGV in a digital twin workshop and developed a three-layer -encoding based GA. Moreover, in order to implement the optimized schedules to a digital twin system, an entity-JavaScript Object Notation method was designed. As we know, Li et al. [12] first studied dynamic FJSP-AGV with simultaneously minimizing makespan and total energy consumption and developed a hybrid deep Q network (HDQN)-based dynamic scheduling method.

Problem Description
The FJSP-AGV problem studied in this paper is the same as with the existing research [3]. FJSP-AGV includes a set of jobs, machines, and AGVs. For each job, it includes several operations and must abide by its predefined route. For each operation, it can select being machined on different machines and transported by different AGVs. When the two adjacent operations of a job are not assigned to the same machine, the job must be transported by one AGV. All the AGVs are identical, and each of them can transport at most one job at the same time. Moreover, the objective of this work was to determine the machine selection sub-problem, the AGV selection sub-problem, and the operations sequencing sub-problem so as to make the makespan minimized.
To intuitively show the FJSP-AGV, an example is given in Figure 1. Specifically, Figure 1a shows the FJSP with only one AGV and Figure 1b shows the FJSP with two AGVs. As we can see from Figure 1a

Initialization
Initialization of the GA includes the population and the parameters. With regard to

Initialization
Initialization of the GA includes the population and the parameters. With regard to the initial population, all the individuals are generated randomly according to the following encoding methods. The parameters include the population size N, the cross probability Pc, the mutation probability Pm, and the stopping criteria.

Encoding Scheme
Encoding explains how to represent a real solution. Encoding of the individual is very important in GA. In this paper, the encoding method that is usually used for FJSP is also used [6]. The encoding only considers two strings, namely operation sequence (OS) string and machine selection (MS) string, and not considering the AGV string. The operation sequencing subproblem is determined by the OS string, and the machine selection subproblem is determined by the MS string. With regard to the AGV selection subproblem, this is determined in the decoding scheme with specifically designed rules.
The OS string defines all operations of a job with the same symbol and then interprets them according to the sequence of their appearance, the length of which is equal to the total number of operations. The genes of the MS string describe the selected machines of the corresponding operations, whose length is also equal to the total number of operations. It is important to note that each element of MS does not represent the actual machine number but the index in the matrix of the alternative machine set. Figure 2 shows an example illustrating the encoding method. With regard to the MS string, for example, the machine index of operation O 2,1 is 1, and corresponds to the real Machine 2.

Decoding Scheme
Decoding is to transform a chromosome to a real schedule. The heuristic for determining the AGV selection is designed as follows: (1) With regard to the first operation of a job, of the AGVs that arrive at the machine ,1 i m the earliest is selected.
where, v t and v l denote the times that AGV v becomes available to transport its next operation and its location respectively when it finishes its previous operation. Specifically, the initial v t is 0, and the initial location of AGV v is L U . (2) With regard to other operations of a job, of the AGVs that arrive at the machine , i j m the earliest is selected.
Specifically, when two or more AGVs are available to transport an operation at the same time, the first AGV is selected.
The decoding starts from the first operation to the last operation, and the related times are updated from the following Equations (3)-(5).

Decoding Scheme
Decoding is to transform a chromosome to a real schedule. The heuristic for determining the AGV selection is designed as follows: (1) With regard to the first operation of a job, of the AGVs that arrive at the machine m i, 1 the earliest is selected.
where, t v and l v denote the times that AGV v becomes available to transport its next operation and its location respectively when it finishes its previous operation. Specifically, the initial t v is 0, and the initial location of AGV v is LU. T l 2 l 1 denotes the transportation time between locations l 1 and l 2 . Obviously, if l 1 = l 2 , then T l 2 l 1 = 0. m i,j denotes the selected machine for processing operation O i,j .
(2) With regard to other operations of a job, of the AGVs that arrive at the machine m i,j the earliest is selected. Specifically, when two or more AGVs are available to transport an operation at the same time, the first AGV is selected.
The decoding starts from the first operation to the last operation, and the related times are updated from the following Equations (3)- (5).
where, d v denotes the time that AGV v leaves machine m i,j−1 . c m i,j represents the time that machine m i,j finishes the current operation immediately before operation O i,j . c i,j indicates the finishing time of operation O i,j .

Selection Operator
In IGA, the role of selection operator is to select the individuals according to the fitness (makespan in this paper). For the purpose of this paper, we adopt two selection operators namely the elitist selection and the binary tournament selection [6]. The elitist selection aims to preserve the individual with the best fitness to the offspring. Specifically, the first two best individuals are directly preserved from the parent population to the offspring population. Except for the best two individuals, the other N-2 individuals in the offspring population are generated by using binary tournament selection, which works by selecting two individuals from the population and selecting the one with better fitness. For example, parent P1\P2 is generated by selecting the better one of two randomly selected individuals in the parent population. Then, offspring O1\O2 is generated from the parent P1\P2 by conducting crossover and mutation operators.

Crossover Operator
In this work, the two mostly used crossovers for OS string and MS string are adopted, namely precedence operation crossover (POX) and uniform crossover (UC). Specifically, POX is for OS string, and its steps are given as follows: First, all the jobs are randomly divided into two subsets, namely Jset1 and Jset2. Then, the jobs of parent P1\P2 that are the parts of Jset1\Jset2 are preserved to offspring O1\O2 keeping their positions unchanged. Finally, the other jobs of parent P2\P1 that are not parts of Jset1\Jset2 are copied to offspring O1\O2 keeping their positions unchanged. To intuitively show the POX, a small example is given in Figure 3a. the first two best individuals are directly preserved from the parent population to the offspring population. Except for the best two individuals, the other N-2 individuals in the offspring population are generated by using binary tournament selection, which works by selecting two individuals from the population and selecting the one with be er fitness. For example, parent P1\P2 is generated by selecting the be er one of two randomly selected individuals in the parent population. Then, offspring O1\O2 is generated from the parent P1\P2 by conducting crossover and mutation operators.

Crossover Operator
In this work, the two mostly used crossovers for OS string and MS string are adopted, namely precedence operation crossover (POX) and uniform crossover (UC). Specifically, POX is for OS string, and its steps are given as follows: First, all the jobs are randomly divided into two subsets, namely Jset1 and Jset2. Then, the jobs of parent P1\P2 that are the parts of Jset1\Jset2 are preserved to offspring O1\O2 keeping their positions unchanged. Finally, the other jobs of parent P2\P1 that are not parts of Jset1\Jset2 are copied to offspring O1\O2 keeping their positions unchanged. To intuitively show the POX, a small example is given in Figure 3a.
With regard to UC, this is used for the MS string, and its steps are as follows: First, a certain number of binary numbers is randomly generated. Then, the offspring O1\O2 is obtained by swapping the machine selections of parent P1\P2, whose binary numbers equal 1. Moreover, a small example is given in Figure 3b to intuitively show the UC.

Mutation Operator
In this paper, swap mutation and one-point-reassign mutation were adopted for the OS string and MS string respectively [6]. Swap mutation works by randomly selecting two different positions and exchanging their elements. With regard to one-point-reassign mutation, one position is randomly selected and then its value is changed to another eligible machine. These two mutation operators are selected randomly with the same 50% proba- With regard to UC, this is used for the MS string, and its steps are as follows: First, a certain number of binary numbers is randomly generated. Then, the offspring O1\O2 is obtained by swapping the machine selections of parent P1\P2, whose binary numbers equal 1. Moreover, a small example is given in Figure 3b to intuitively show the UC.

Mutation Operator
In this paper, swap mutation and one-point-reassign mutation were adopted for the OS string and MS string respectively [6]. Swap mutation works by randomly selecting two different positions and exchanging their elements. With regard to one-point-reassign mutation, one position is randomly selected and then its value is changed to another eligible machine. These two mutation operators are selected randomly with the same 50% probability.

Population Diversity Check
With regard to the classical GA, the diversity of the population decreases with the algorithm iteration, and some individuals may become extremely similar even identical, causing stagnation of population evolution. In order to make up the gap, at regular intervals, the population is checked and the similar individuals are randomly generated. Specifically, if two individuals have the same makespan and the similarity of their MS strings is no less than 80%, one of them must be regenerated. If in each generation, the population diversity is checked, it will be very time-consuming. Therefore, we check the population diversity at each Nt generation.

The Steps of the Proposed IGA
The steps of the proposed IGA are as follows:

•
Step 1: Initialization: Initialize the parameters and the initial population of IGA, and t = 1 .

•
Step 2: Evaluation: Evaluate all the individuals by the fitness of total energy consumption.

•
Step 3: Genetic evolutions: Execute the genetic operations, namely selection in Section 4.4, crossover in Section 4.5, and mutation in Section 4.6.

•
Step 4: Population diversity check: Check the population diversity Nt generations according to the methods in Section 4.7.

•
Step 6: Termination: Has the stopping criteria been reached? If the stopping criteria is met, go to Step 7; otherwise, go to Step 2.

•
Step 7: Output the best solution.

Computational Complexity Analysis
With regard to IGA computational complexity, this is determined by each step of the IGA. In detail, the complexity of initialization is O (N oper × N). The complexity of binary tournament selection is O(N). The complexity of POX and UC are O(N oper ). The complexity of swap mutation and one-point-reassign mutation are O(1). The complexity of the population diversity check is O(N oper × N 2 ). Therefore, the final computational complexity of IGA is mainly determined by N oper and N. Figure 4 shows the flow chart of the proposed IGA.


Step 6: Termination: Has the stopping criteria been reached? If the stopping is met, go to Step 7; otherwise, go to Step 2.  Step 7: Output the best solution. Figure 4 shows the flow chart of the proposed IGA.

Computational Complexity Analysis
With regard to IGA computational complexity, this is determined by each step IGA. In detail, the complexity of initialization is (

Experimental Results
The IGA was coded in C++ and run on a computer with the Win 11 system, Intel(R) Core(TM) i7-10700 CPU @ 2.90 GHz and 24 GB of RAM memory. Experimental tests were conducted based on five sets of benchmark data. For each instance, the test was repeated 20 times. The stopping criterion was set as maximum CPU time of 2N oper seconds, and N oper is the number of the total operations of all the jobs in the instance. To evaluate the effectiveness of the population diversity check method, the IGA was compared with the classical GA without considering the population diversity check method. The comparison results of MFJST01-10 and MKT01-10 [3] are shown in Table 1. Specifically, we set the relative percentage increase (RPI) as the comparison indicator, as is shown in Table 1: where, MC represents the result of a test instance that is obtained by a specific algorithm by repeating several times, and MC best denotes the best MC of all comparison algorithms. In Table 1, the "Best", "Mean" and "Worst" represent the best value, the mean value, and the worst value of repeats of 20 times. The "Mean RPI" represents the mean value of PRI for all the instances. As can be seen from Table 1, IGA outperforms GA in terms of the best value, the mean value, and the worst value. With regard to MFJST01, GA can obtain the same best solution 485 as IGA. GA cannot obtain the best solution 485 of 20 times, and its worst solution is 517. Compared with GA, the IGA can obtain the best solution 485 of 20 times. With other instances, IGA and GA cannot obtain the same solution of 20 times. This is because the solution spaces of the instances increase greatly as the problem size is increased.
To prove the effectiveness and efficiency of the proposed IGA, it is compared with state-of-the-art algorithms, namely, the MILP model [3], CP2 [29], LAHC [3], BRKGA [11], GATS [36], and PGA [35]. The comparison results of the five sets of benchmark data sets are shown in Tables 2-7. Moreover, in Tables 2-7, the solutions in bold are the best among all the algorithms, the solutions with "*" are the improved ones by our IGA, and the solutions with "-" are worse than the best-known solutions. In the Appendix A, we have given detailed information of some improved solutions.

Comparison Results of Data Set 1
The comparison results of data set 1 are shown in Table 2. Specifically, CP2 has proved the optimal solutions of all the ten instances. As shown in Table 2, our proposed IGA can obtain all the optimal solutions for the 10 instances. The existing meta-heuristic algorithms LAHC, BRKGA, and GATS can only obtain 9, 4, and 2 optimal solutions. Obviously, except for the exact algorithm CP2, our IGA is the only meta-heuristic algorithm that can solve all the instances to optimality.

Comparison Results of Data Set 2
The comparison results of data set 2 are shown in Tables 3 and 4. Specifically, Table 3 shows the results of data set 2 with t/p > 0.25, and Table 4 shows the results of data set 2 with t/p ≤ 0.25. In Tables 3 and 4, the obtained solutions of MILP model are optimal. As can be seen from Table 3, our proposed IGA outperforms all the existing algorithms and updates the current best solutions of four instances, namely, EX81, EX72, EX82, and EX83, and their best solutions are improved from 94, 62, 82, 85 and 87 to 91, 61, 80 and 84 respectively. Except the improved four instances, our IGA can obtain the best solutions for all the other 24 instances, and the existing meta-heuristic algorithms LAHC, BRKGA, and PGA can only obtain 22, 9, and 15 best solutions.
As presented in Table 4, our proposed IGA outperforms all the existing algorithms and improves the current best solutions of three instances, namely, EX730, EX741, and EX840. Specifically, our proposed IGA improves the upper bounds of EX730, EX741, and EX840 from 100, 150, and 144 to 99, 149, and 143 respectively. Except the improved three instances, our IGA can obtain the best solutions for all the other 26 instances. The existing meta-heuristic algorithms LAHC, BRKGA, and PGA can only obtain 18, 14, and 14 best solutions.

Comparison Results of Data Set 3
The comparison results of data set 3 are shown in Table 5, and the obtained solutions of the MILP model are optimal. As shown in Table 5, our proposed IGA outperforms all the existing algorithms and updates the current best solutions of MFJST09 and MFJST10. For MFJST09 and MFJST10, our proposed IGA improves their best solutions from 1120 and 1238 to 1117 and 1228 respectively. For all the other eight instances, our IGA can obtain all their best solutions, and the existing meta-heuristic algorithms LAHC and PGA can only obtain 8 and 4 best solutions.

Comparison Results of Data Set 4
The comparison results of data set 4 are shown in Table 6. From Table 6, we can see that our proposed IGA improves the current best solutions of 9 out of 10 instances. With regard to MKT05, the solution 244 of our proposed IGA is worse than the best solution 225. With regard to MKT01-04 and 06-10, our proposed IGA improved their best solutions from 187, 148, 371, 312, 389. 5, 291, 846, 794, and 712.5 to 177, 126, 342, 295, 321.5, 267, 780.5, 715, and 645 respectively.

Comparison Results of Data Set 5
The comparison results of 21 instances of data set 5 are shown in Table 7. As presented in Table 7, our proposed IGA updates the current best solutions of 16 out of 21 instances. For instances mt10cct, mt10xxt, and mt10xyzt, the IGA can obtain the same best solution as existing algorithms. For instances setb4cct and setb4xt, the solutions of IGA are better than these of LAHC (H = 100) and a little worse than LAHC (H = 1000). The reason can be attributed to the decoding heuristic of determining the AGV selection. Not considering AGV selection in the encoding scheme, the solution space of encoding-decoding is limited to some extent. For the instances setb4cct and setb4xt, the best\optimal solutions may not be in the solution space.

Conclusions and Future Works
This paper studied FJSP-AGV and proposed an IGA to minimize makespan. The IGA was designed specifically from the encoding method, the decoding method, the initiation method of the population, the evolution operators, and the population diversity check method. In order to prove the effectiveness and efficiency of IGA, it was compared with the state-of-the-art algorithms for solving five sets of benchmark instances. Experimental results show that the proposed IGA outperforms the existing algorithms and updates the current best solutions of 34 benchmark instances. Specifically, the proposed IGA updates the current best solutions of four instances of data set 2 with t/p > 0.25, three instances of data set 2 with t/p ≤ 0.25, two instances of data set 3, nine instances of data set 4 and 16 instances of data set 5.
In future research, the essential characteristics (e.g., different encoding and decoding schemes) of FJSP-AGV with minimizing makespan will be mined by analyzing the optimal solutions obtained by MILP models. Moreover, more objectives, such as energy-efficiency and cost objectives will be considered.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author, upon reasonable request.

Conflicts of Interest:
The authors declare no conflict of interest.