An efficient simulated annealing algorithm for a No-Wait Two Stage Flexible Flow Shop Scheduling Problem

In this paper, no wait two stage flexible flow shop scheduling problem (FFSSP) is solved using two meta-heuristic algorithms. This problem with minimum makespan performance measure is NP-Hard. The proposed algorithms are Simulated Annealing and Genetic Algorithm. The results are analyzed in terms of Relative Percentage Deviation of Makespan. The performance of the proposed algorithms are studied and compared with that of MDA algorithm. For this propose a number of problems in different sizes are solved. The results of the studies proposes the effective algorithm. This is followed by describing the outline of the study, concluding remarks and suggesting potential areas for further researches


INTRODUCTION
Flexible flow shop is a typical classical flow shop, which consists of m stages each one with one or more than one identical parallel machines, n given jobs to be processed on m subsequent stages. . Flexible flow shop also known as a hybrid flow shop, flexible flow line or flow shop scheduling problem with parallel machines . This area has been studied by many researchers [1][2][3][4]. For a literature review in this area the readers are referred to those conducted by Ruiz Et al [5] and Ribas Et al [6].
A prominent class of scheduling problems is identified by a no-wait production environment, in which there is no storage between the machines. Thus, jobs must be processed from the start to finish, deprived of any interruption on machines or between them. Consequently, the processing of a job on the initial machine may need to be delayed to guarantee that no waiting takes place on any subsequent machine. There are two main motives for a no wait environment: the type of procedure, or a lack of storage between intermediate machines (work stations). In some industries, due to the temperature or other characteristics of the material it is required that each operation follow the previous one immediately. Such situations appear in the chemical processing [11], food processing [12], concrete ware production [13], pharmaceutical processing [14] and production of steel, plastics, aluminum products [15].
These kinds of manufactures can often be modeled as a 'pure' flow shop environment in which all of n jobs follow the same sequence at each stage, each of n jobs consist of two operations owning a predetermined processing order through machines. Each job is to be processed without preemption and interruption on two stages or between them. That is, once a job is started on the first machine, it has to be continuously processed through the subsequent machine without interruption. In addition, each machine can handle no more than one job at a time and each job has to visit each machine exactly once. Therefore, it may occur a condition that the starting time of a job on the first machine must be delayed in order to meet the no-wait requirement [16]. As an example, in a chemical industry if the waiting time is allowed between each subsequent stage, it may lead to deteriorate the material property (e.g. degrading the polymer). Therefore, in such industries, once an operation is completed, the subsequent operation shall be started without any delay. For a further study in no wait manufacturing the readers are recommended to review the paper present by Hall and Sriskandarajah [12] The problem studied in this paper is makespan minimization in a no wait two stages flexible flow shop scheduling problem as it has a multiplicity of practical implementations in both manufacturing industry and service corporations. This particular hybrid flow shop(i.e. two stage hybrid flow shop) scheduling problem with the objective of minimizing makespan is first considered in Riane et al. [7]. Narasimhan,S.& Mangiameli,P [8] also introduced a heuristic algorithm known as the Cumulative Minimum Deviation (CMD) rule for a two-stage hybrid flow shop scheduling problem with single machine in stage one and two independent machines in stage 2. The results of the study reveals that this algorithm outperforms SPT and LPT in reducing the machine idle time and in-process waiting time at the second stage.
Liu Zhixin et al [17] presented a heuristic algorithm named Least Deviation (LD) rule for twostage no-wait hybrid flow shop scheduling with a single machine in each stage and makespan performance measure. The results of the study indicate that this algorithms is superior than L,D and Johnson. Also they shown LD algorithm has low computational complexity and is easy to implementation thus it is of favourable application value. Jinxing Xie et al. [18] proposed a new heuristic algorithm known as Minimum Deviation Algorithm (MDA) to minimize makespan in a two stage flexible flow shop with no waiting time.Experimental results of their study show that MDA outperformed partition method, partition method with LPT, Johnson's as well as the modified Johnson's algorithms.
Jinxing Xie and Xijun Wang [19] considers the two-stage flexible flow shop scheduling problem with availability constraints. They discussed the complexity and the approximability of the problem and provide some approximation algorithms with worst case performance bounds for some special cases of the problem. Their results showed that the problems studied are much more difficult to approximate than the case without availability constraints. Huang et al [20] considered a no-wait two stage flexible flow shop with setup times and with minimum total completion time performance measure. They proposed an integer programming model and ant colony optimization heuristic approach. The ACO results revealed that the efficiency of the proposed algorithm is superior to those solved by integer programming while having satisfactory solutions.
In this study a no wait flexible flow shop problem is solved using two methaheuristic algorithms based on Simulated Annealing and Genetic Algorithm. The aim is to find an effective algorithm with minimum makespan. The rest of the article is formed as follows: Section 2 briefly describes the problem addressed in this paper. Section 3 presents the framework of the proposed algorithms. Numerical problems developed to study the performance of the proposed algorithms are introduced in section 4. This is followed by presenting the results of simulation study. Finally Section 5 describes the outline of the research with the concluding remarks and suggestion for further researches.

PROBLEM DEFINITION
The no-wait flexible flow shop scheduling problem (NWFFSSP) can be described as follows: given the processing time p(i, j) of Stage i on Job j, each of n jobs will be sequentially processed in stage 1, 2 respectively. At each stage there are mi machines. In addition at any event of time, each machine can process at most one job. Similarly each operation of a job can only be processed on one machine. Once the sequence of the jobs at the first stage is defined, the same sequence is applied for the second stage. To fulfill the no-wait restrictions, the completion time of a job on a given machine must be equal to the start time of the job on the next machine. In other words, there must be no waiting time between the processing of any consecutive operations of each job. The problem is to find a sequence that the maximum completion time, i.e., makespan (C max ), is minimized. { , ,..., } n π π π π = denote the schedule or permutation of jobs to be processed, the minimum delay on the first machine between the start of job 1 j π − and j π restricted by the no-wait constraint.
Then L can be calculated as follows: Thus, the makespan can be defined as max  The no-wait FFSSP with the makespan criterion is to find a permutation * π among the all permutations Π such that * max arg{ ( )} min . C π π π = → ∀ ∈ Π Where arg represents the arranged permutation.
The problem is shown by 2 . If the number of parallel machines in each stage is not input variables, the problem can be shown by 2 max ( ) |no-wait| C F p . In this study the operations' set up times are assumed to be independent from the job sequences and hence is added to the operation times. This problem is schematically depicted in Figure 1.  [21]. The two stage no wait flexible flow shop problems are NP-hard in the strong sense [22]. Therefore, all exact algorithms for even a simple flow shop and simple parallel machines will most likely have running times that increase exponentially with the problem Size. In this paper we propose metaheuristic algorithms to the problem described above. The framework of this algorithm is explained in the next section.

FRAMEWORK OF THE PROPOSED ALGORITHMS
The proposed algorithms in this study are based on GA and SA methods. They are categorized based on the algorithms applied for job sequencing and machine assignment. With reference to the algorithms presented in this paper, the job sequences are generated using the stochastic search process of SA and GA. The jobs are then allocated to the machines using a constructive heuristic algorithm which allocates the job with the first priority to the machine with the earliest available time.
In the remaining part of this section, first the schematic of a chromosome/ solution is presented. Then the structure of the Genetic Algorithm and Simulated Annealing are presented. This is followed by describing the constructive heuristic algorithm is applied for machine assignment in the metaheuristic algorithms.

GA and SA chromosome/solution representation
Suppose that there are n jobs each one to be assigned to two identical machines in each stage. The proposed algorithms first choose the initial solutions using a uniform distribution in a range between 0 and one. For the sake of clarification, suppose that there are 5 jobs and two machines in each stage. At first 5 random numbers are generated in a range between 0 and 1. Assume that the outcomes are 0.45, 0.63, 0.13, 0.33 and 0.77. Figure 2 shows the corresponding chromosome/solution.  Figure 3. Figure 6 shows the resulting sequence.

Constructive heuristic
The jobs are assigned to the machine with the earliest available time. The details are explained at below. { } a n d a d d to th e S te p 2 : if 0 th e n a n d and j j P P represent processing time of the job j in first stage and second stage respectively. And π denotes the job permutation.

Genetic Algorithm
Holland [23] for first time introduced genetic algorithm as an optimization tool that redefines the problems in the genotype space by converting the features of phenotype as the chromosomes. In the genetic algorithm a population of chromosomes is maintained and stochastic search operators such as crossover, mutation and selection are used to finding better answers [24]. The combinations of genes are evolved through the genetic operators so that the chromosomes move toward the optimal solution generation by generation. There are three genetic operators: selection, crossover and mutation. Crossover operators can produce new solutions optimistically retaining good characteristics from parents, and mutation operator can enhance diversity and provide a chance to escape from local optima. So far, GAs have been widely applied in many fields, especially in operations research [25,26].

Selection operator
The main goal of selection operators is choosing better chromosomes to obtain better solutions. To achieve this goal, several issues should be taken into consideration; how to choose chromosomes in the population in order to create offspring and how many offspring should be created and how chromosomes are selected as population in the next generation. [27] Parent selection is performed by roulette wheel selection scheme. In this procedure selection probability of each chromosome is calculated by following formula: In this scheme each chromosome has more chance to be selected as the fitness value increases. This rule results in finding strong off springs.
After determination of chromosome as parents, in order to transit to the next generation ( λ µ + )-selection strategy is applied as survivor selection rule [28]. In the process of survival selection, in each generation, after producing λ offspring and calculating the respective fitness values, among λ µ + chromosomes, the best λ µ + chromosomes are selected as the next population members.

Crossover
The crossover operation is used to effectively explore the search space. The main purpose of crossover operator is to exchange information among randomly selected parent chromosomes with the aim of producing better solution, i.e. offspring. It recombines genetic members of two parent chromosomes to produce the offspring for the next generation that retain good properties of the parent chromosomes. The exchange is also intended to search for better genes [29]. To perform a crossover, two parents are selected from the mating pool at random. With the probability of 1 − p c , the parents are copied as they are. On the other hand, with the probability of pc, called the crossover probability, the crossover operation is performed. Figure 4 presents the crossover operation. According to the above addressed figure, firstly an array of binary mask with a length equal to the chromosome members is generated. Then the offspring is generated from a couple of nominated parents in two ways resulting in offspring 1 and 2. In offspring one, the ith member is copied from the ith member of parent 1 if the respective binary mask member value is equal to one, otherwise the value is copied from parent 2. This is continued till all members of the offspring are constructed. The second offspring member generation is similar to that of the first offspring except that, in any selection, the member from the first parent is selected if the respective binary mask value is equal to zero, otherwise the member from the second value is generated. Syswerda, G [30] shown that this crossover operator obtains good exploitations. Therefore in this paper it is applied as a cross over operator in the proposed GA algorithm.

Mutation
Mutation serves to maintain diversity in the population and is a way of enlarging the exploration. It acts to prevent the selection and crossover from focusing on a narrow area of the search space or the GA getting stuck in a local optimum. Mutation is done by selecting two different locations on the chromosome at random and interchanging the jobs at these locations. For each child obtained from crossover, the mutation operator is applied independently with a small probability pm. A sample of swap mutation is shown in the Figure 5.

Termination criterion
The algorithm continues until all generations are created. The running time of the GA depends on the number of generations along with the population size. The GA will have a greater like hood that an optimal or near to optimal solution is found if it is to run longer. Structure of genetic algorithm which is used in this study are shown in Figure 6.

Simulated annealing algorithm
The Simulated Annealing (SA) is a search technique, which can be used to seek good solutions for various combinatorial problems. It has its origin in the material science and physics. The motivation for simulated annealing comes from an analogy between the physical annealing of solid materials and optimization problem. The analogy between physical annealing and simulated annealing can be summarized as follows: (i) The physical configurations or states of the molecules correspond to optimization solution; (ii) the energy of molecules corresponds to the objective function or cost function; (iii) a low energy sate corresponds to an optimal solution; (iv) the cooling rate corresponds to the control parameter which will affect the acceptance probability. The algorithm consists of four main components: (i) configurations; (ii) re-configuration technique; (iii) cost function and (iv) cooling schedule [31,32]. Similar to genetic algorithm, simulated annealing is a stochastic search method. It aims to find an acceptable solution where it is impractical to find the optimum solution using other methods. Simulated Annealing is a generalization of a Monte Carlo method for examining the equations of state and frozen states of a system [32]. Since the original work conducted by Metropolis on simulated annealing [32], a significant amount of works have been done on this technique and its applications in different fields. Because of the combinatorial nature of the scheduling problems, application of simulated annealing on this problem has been investigated extensively. Examples of using SA can be found in single machine, Flow shop, Job shop problems and combinations of these problems with various restrictions and job conditions [33][34][35]. However, to the author's knowledge, so far no work was conducted to solve no wait two stage flexible flow shop scheduling problem using simulated annealing approach.
The detailed description of the simulated annealing algorithm to solve no wait two stage flexible flow shop problems with minimum makespans is presented below.
• Step 1: Set the parameters: In this step the initial parameters of the algorithm are set. These include initial temperature, T (1), the minimum temperature, T (min), the temperature reduction multiplier, α, and the number of iterations at each Temperature, N. Also the iteration counter, n, are set to one in order to start the first iteration. • Step 2: Set F(X) equal to the objective function for the initial solution: In this step the value of the objective function for the initial sequence (X) obtained in the first phase is set equal to F(X). X is also defined as the best solution found (Xbest) and the best objective function calculated, F(Xbest), is set equal to F(X). • Step 3: Generate Y, a neighbourhood solution: In this step two jobs are randomly chosen and swapped in the sequence of jobs that define their priorities. Following the procedure used in phase 1, find the corresponding solution. Denote this solution as Y and the value of its objective function as F(Y). • steps 4: Check for improvement: The improvement, δ , of the new solution compared to the previous solution is evaluated as the difference between the objective functions of solutions Y and X. If δ is less than zero, then there is an improvement and the algorithm continues with step 5 otherwise go to step 6. • Steps 5: Compare the new solution with the best solution found. If the new solution is better, i.e. F(Y) <F (Xbest), replace the best solution and its objective function with Y and F(Y) respectively. Continue by following step 7. • Steps 6: Accept or reject the non-improving move randomly In order to randomly accept a non-improving move that might lead to a better solution, calculate L=Exp (δ/T(t)) and compare it to R, a random number between zero and one. If L>R the nonimproving move will be accepted with a hope to find a better neighbor of the solution, and the algorithm continues with step 7. Otherwise, solution Y is ignored and the algorithm returns to step 3 to generate a new solution. • Step 7: Update solution X Since solution Y was accepted in steps 5 or 6, solution X and F(X) are replaced with Y and F(Y) respectively. • Step 8: Update and check the iteration counter and compare the counter n with N. If n<N, increase n by one and go to step 3 to start a new iteration, otherwise increase the temperature counter t by one, calculate the new temperature: ( ) T t T(t 1) α = × − , set n=1, and continue with step 9. • Step 9: Check the termination criteria; If the temperature of the system is less than or equal to the minimum temperature allowed, the algorithm is terminated. Otherwise continue with the new temperature iteration by going to step 3. Structure of proposed simulated annealing is shown in Figure 7.

The fitness function
The performance measure considered in this study is minimum makespan. The corresponding fitness function is calculated as follow: Cj= Completion time of job j Makespan= Cmax = max (Cj) Figure 7. Proposed simulated annealing structure

NUMERICAL EXPERIMENTS
In this section, the performances of the proposed algorithms are studied by solving series of problems. At first the parameters used in the simulation experiments are introduced. This includes the scale of the problems in terms of the number of the jobs, number of machines at each stage and processing times. Next the results of the simulation study are illustrated and the performance of the proposed algorithms is compared with that of the others by solving various problems in different sizes.

Parameters of the simulation model
In this study we investigated the performance of the proposed approach for a fairly large number of the problems. In terms of the number of machines, the problems studied in this research are classified into two main categories namely small and large problem. Table.1 shows the problem size for each category.  number of jobs) are considered. They are twice, 4 times and 6 times of total number of machine respectively. In addition the operation times are generated using a uniform distribution with a couple of ranges. Table.2 shows the number of jobs and operations distribution.

Parameter tuning
Regarding the metaheuristic algorithms, the value of the parameters used in each algorithm affect its performance. For this purpose, the simulation was performed for a wide range of the parameters' values for both GA and SA algorithms and the values corresponding to the best solutions are selected. Table.3 shows the summary of the tuned parameters' value for the proposed algorithms.

The simulation process
This

Simulation results
As described in section one, review of the literature reveals that MDA obtains good solutions for the problems studied in this paper. Therefore in our study the performance of the proposed algorithms were compared with each other and MDA algorithm for 36 different problems. Simulation results are shown in two scales separately. (See Table.4 and Table.5) Results shown in Table 4 indicate that for small problems, in 17 out of 18 cases, the Simulated Annealing (SA) outperforms the other the algorithms. In addition RPD performance measure with % 95 confidence interval was calculated in both small and large scale problems. Table.6 shows the results. This indicates that in terms of RPD and with %95 confidence interval the range of the results obtained using the algorithms are not in overlapped. In addition the performance of the SA algorithm has lower Confidence interval. This confirms the superiority of the proposed SA compared with the other algorithms. Table 5 presents the results for large scale problems. Similar to the small scale problems, here SA also outperforms the all other algorithms; also similar to small scale problems in terms of RPD and with %95 confidence interval the range of the results obtained using the algorithms are not in overlapped. So this confirms the superiority of the proposed SA compared with the other algorithms Table 4 and 5 also present the performance of each algorithm in terms of CPU time. The results indicate that MDA has normally yielded the shortest CPU time. Such a processing speed is obviously due to the fact that MDA is a one iteration simple algorithm compared with the other algorithms in which the solutions are obtained though multi iteration based rules. Despite the fact that the proposed SA has significantly longer CPU time than that of MDA, but comparable with that of the other algorithms, its CPU time still is short. For instance for the largest problem with 132 jobs and 12 and 10 machines in stage one and two respectively, its CPU time is 230 second which is fairly short. Furthermore, for statistical evaluating the algorithms, mean and interval ( at 95% confidence interval) are plotted for small and large scale problems in Figure 8 and 9,respectively. with respect to these Figures it could be seen poroposed simulated annealing outperform GA and MDA in both scales. So, As a result, the proposed SA can be considered as an effective algorithm for no wait two stage flexible flow shop scheduling problem with minimum makespan.

CONCLUSION
This paper studied the performance of the proposed four metaheuristic algorithms for a no wait flexible flow shop scheduling problem with minimum makespan performance measure. The performances of these algorithms were also compared with that of MDA. A simulation model was developed to study the performance of the algorithms. For this purpose, 36 problems in different sizes in terms of the number of job and number of machine in each stage were solved.
The results of the simulation study revealed that the proposed Simulated Annealing Algorithms (SA) outperforms the other algorithms in terms of minimum makespan. Such superiority becomes more significant as the problem size increases. Therefore the proposed SA can be considered as an efficient algorithm for a no wait two stage flexible flow shop. As a further research it is recommended to study the performance of the proposed algorithm for the problem with more than two stage. In addition it is worthwhile to investigate the performance of the proposed algorithms for the problems with sequence depended set up times.