Discrete Bat Algorithm for Optimal Problem of Permutation Flow Shop Scheduling

A discrete bat algorithm (DBA) is proposed for optimal permutation flow shop scheduling problem (PFSP). Firstly, the discrete bat algorithm is constructed based on the idea of basic bat algorithm, which divide whole scheduling problem into many subscheduling problems and then NEH heuristic be introduced to solve subscheduling problem. Secondly, some subsequences are operated with certain probability in the pulse emission and loudness phases. An intensive virtual population neighborhood search is integrated into the discrete bat algorithm to further improve the performance. Finally, the experimental results show the suitability and efficiency of the present discrete bat algorithm for optimal permutation flow shop scheduling problem.


Introduction
Scheduling problems are taking the very important effect in both manufacturing systems and industrial process for improving the utilization efficiency of resources [1], such as, aircraft landing scheduling problem, job shop scheduling problem, and flow shop scheduling problem. In the past several decades, scheduling problems are widely researched. Permutation flow shop scheduling problem (PFSP) is one of best known production scheduling problems, which can be viewed as a simplified version of the flow shop problem and has been proved that non-deterministic polynomial (NP) time [2]. Due to its significance in both academic and engineering applications, the permutation flow shop with the criterion of minimizing the makespan, maximum lateness of jobs, or minimizing total flow time, a great diversity of methods have been proposed to solve PFSP and some achievements were obtained.
So far, there are many methods that have been introduced for solving PFSP with the objective of minimizing the makespan. To sum up, these methods can be classified into three categories: exact methods, constructive heuristic methods, and metaheuristic algorithms based on the constructive operation and neighborhood search. Exact methods include branch and bound method [3], integer linear programming method [4], and so on. Constructive heuristic methods which build some rule to construct a feasible scheduling, such as, Johnson method, Rajendran NEH can be viewed as the typical cases [5]. Among them, the NEH is one of the most successful constructive methods and can provide comparable results with metaheuristics. The metaheuristics mainly include genetic algorithm (GA) [6], particle swarm optimization algorithm (PSO) [7], differential evolution (DE) [8], and bat algorithm (BA) [9] and so on. Many metaheuristic algorithms are used to solve flow shop scheduling based on the constructive operation and neighborhood search in the past few years. In [6], Wang and Zheng proposed a SGA to solve flow shop scheduling, which used the wellknown NEH combined with GA to generate the initial population and applied multicrossover operators to enhance the exploring potential. In [10], Tasgetiren et al. applied the PSO algorithm to solve PFSP for makespan and total flow time minimization by using the smallest position value rule borrowed from the random key representation of GA, and the proposed algorithm was combined with the variable neighborhood-based local search, as called PSO VNS. Liu et al., in [11], proposed an efficient particle swarm optimization based mimetic algorithm (MA) for PFSP to minimize 2 The Scientific World Journal the maximum completion time. In [12], two effective heuristics are used during the local search to improve all generated chromosomes in every generation. Yagmahan and Yenisey have proposed a multiobjective ant colony system algorithm to simultaneously minimize objectives of makespan and total flow time [13]. Tasgetiren et al. present a discrete artificial bee colony algorithm hybridized with a variant of iterated greedy algorithms to find the permutation that gives the smallest total flow time [14]. In [15], a novel mechanism is employed in initializing the pheromone trails based on an initial sequence, and the pheromone trail intensities are limited between lower and upper bounds which change dynamically. Moreover, a local search is performed to improve the performance quality of the solution. In [16], Li and Yin applied a differential evolution based memetic algorithm, named ODDE, to solve PFSP by combining with NEH heuristic initialization, oppositionbased learning, pairwise local search, and fast local search in ODDE. In [17], Liu et al. a multipopulation PSO based memetic algorithm for permutation flow shop scheduling is proposed. In [18], Mirabi proposed a novel hybrid genetic algorithm to solve the sequence-dependent permutation flow shop scheduling problem. In [19], Victor and Framinan use on insertion tie-breaking rules in heuristics for the permutation flow shop scheduling problem.
In recent years, a bat algorithm (BA) as a new metaheuristic optimization algorithm is proposed [9]. BA is inspired by the intelligent echolocation behavior of microbats when their foraging. After the bat algorithm is proposed by Yang in 2010, bat algorithm is used to solve various optimization problems. For example, Gandomi et al. focus on solving constrained optimization tasks [20]. Yang and Gandomi apply bat algorithm to solve many global engineering optimizations [21]. Mishra et al. present a model for classification using bat algorithm to update the weights of a functional link artificial neural network (FLANN) classifier [22]. Meanwhile, there are improved bat algorithms that are applied to various optimization problems; Xie et al. proposed a DLBA bat algorithm based on differential operator and Lévy flights trajectory to solve function optimization and nonlinear equations [23]. Wang et al. proposed a new bat algorithm with mutation (BAM) to solve the uninhabited combat air vehicle (UCAV) path planning problem [24]. In this paper, we propose a discrete bat algorithm (DBA) to solve PFSP. Here, the DBA is constructed based on the idea of continuous bat algorithm, which divide whole scheduling problem into many subscheduling problems, then NEH heuristic was introduced to solve subscheduling problem. Moreover, some subsequences are operated with certain probability in the pulse emission and loudness phases. An intensive virtual population neighborhood search is integrated into the DBA to further improve the performance. Finally, the experimental results show the effectiveness of the discrete bat algorithm for PFSP.

Permutation Flow Shop Scheduling
Problem. The permutation flow shop scheduling problem (PFSP) in the paper consists of a set of jobs on a set of machines with the objective of minimizing the makespan. In PFSP, jobs are to be processed on a series of machines, sequentially. All jobs are processed in the same permutation; meanwhile, every job is processed in one machine only once and each machine can only process one job at a time, and all jobs are processed in an identical processing order on all machines.
The permutation flow shop scheduling problems are often denoted by the symbols | | prmu | max , where represents the number of jobs; is the number of machines; prmu denotes the type of flow shop scheduling problem; and max is the makespan. Let , (1 ≤ ≤ , 1 ≤ ≤ ) be the times of job processed on machine , assuming preparation time for each job is zero or is included in the processing time , ; = ( 1 , 2 , . . . , ) is a scheduling permutation of all jobs. Π is set of all scheduling permutation. ( , ) is completion time of job on machine , and every job will be processed on machine 1 to machine orderly. The completion time of the permutation flow shop scheduling problem according to the processing sequence = ( 1 , 2 , . . . , ) is shown as follows: where * is the most suitable arrangement which is the goal of the permutation flow shop problem to find max ( * ) is the minimal makespan.

Bat Algorithm (BA).
The bat algorithm (BA) is an evolutionary algorithm first introduced by Yang in 2010 [9]. In simulations of BA, under several ideal rules, the updated rules of their positions and velocities V in a D-dimensional search space are defined. The new solutions and velocities V at generation are given by where ∈ [0, 1] is a random vector drawn from a uniform distribution, denotes frequency of each bat, and the frequency ∈ [ min , max ]. Here * is the current global best location (solution) which is located after comparing all the solutions among all the bats.
After the position updating of bat, a random number is generated; if the random number is greater than the pulse

Begin
Initialization. Set the generation counter = 1; Initialize the population of bats randomly and each bat corresponding to a potential solution to the given problems; define loudnes , pulse frequency and the initial velocities V ( = 1, 2, . . . , ); set pulse rate . While the termination criterion is not satisfied or < for each individual Compute pulse emission rate by (6); if rand > / * sub-sequence swap * / Randomly select two sub-sequences defined by frequency on ( ); Swap the two sub-sequences to generate a new position; else / * sub-sequence inserting * / Randomly select one sub-sequence defined by frequency on ( ); Insert this sub-sequence into a random location in remainder sequence; endif endfor Algorithm 3: The pseudocode of pulse emission rate local operation. 4 The Scientific World Journal emission rate , a new position will be generated around the current best solutions, and it can be represented by where ∈ [−1, 1] is a random number, while = ⟨ ⟩ is the average loudness of all the bats at current generation .
Furthermore, the loudness and the pulse emission rate will be updated and a solution will be accepted if a random number is less than loudness and ( ) < ( * ). and are updated by where , are constants and (⋅) is fitness function. The algorithm repeats until the termination criterion is reached. The basic steps of the bat algorithm (BA) can be described in Algorithm 1.

Discrete Bat Algorithm for PFSP
Since standard BA is a continuous optimization algorithm, the standard continuous encoding scheme of BA cannot be used to solve PFSP directly. Meanwhile, many combinational optimization problems are discrete problem, and PFSP is a typical case. In order to apply BA to PFSP, there are two methods: the first method is to solve PFSP using continuous BA, however, this method needs to construct a direct mapping relationship between the job sequence and the vector of individuals in BA; the second method is to construct a discrete BA for PFSP. Therefore, in this paper, a discrete bat algorithm is proposed to solve PFSP with minimal makespan. In addition, for PFSP, some neighborhood search methods always are used to enhance the quality of the solution, and the performance is remarkable. In this paper, four neighborhood search methods, that is, insert, swap, inverse, and crossover, will be employed. These neighborhood operations are shown in Figure 1. The details of these neighborhoods are as follows.
Swap. Choose two different positions from a job permutation randomly and swap them.
Insert. Choose two different positions from a job permutation randomly and insert the back one before the front.
Inverse. Inverse the subsequence between two different random positions of a job permutation.
Crossover. Choose a subsequence in a random interval from another random job permutation and replace the corresponding part of subsequence.

Solution Representation in DBA.
In original BA, the position of each virtual bat is viewed as a candidate solution of problem; these bat individuals adjust the flight speed by randomly selecting frequency of sonic wave which they emitted and then update the position of bats. Furthermore, the pulse emission rate and loudness are used to control the intensive local search that is process to generate a new individual around the current global best solution. In DBA, in general, the position ( ) of individual denotes a scheduling plan on th iteration, where represents the scheduling plan including jobs. The ( ) is also viewed as a = ( 1 , 2 , . . . , ). For example, if 4 1 (2) = [3 2 1 4], which represents the processing order of all jobs on all machines, is 3 → 2 → 1 → 4, this permutation represents the position of first bat individual in second generation. The velocity V ( ) consists of a part of scheduling plan or whole scheduling plan on th iteration, where ≤ .

Population Initialization.
In this paper, the DBA is applied to explore the new search space. Initial swarm is often generated randomly, and, in DBA, this initial strategy is adopted. Meanwhile, recent studies have confirmed the superiority of NEH over the most recent constructive heuristic [5]. Many metaheuristic algorithms in order to generate an initial population with certain quality and diversity take advantage of the NEH heuristic to generate some individuals and the rest of the individuals are initialized with random values [16]. In this paper, this kind of initialization strategy is not including in DBA, but NEH is used in position updating of bat. However, a discrete bat algorithm with NEH initialization strategy is experimented. By experiments, we find that the combination of NEH initialization strategy and succeeding operation always deteriorates the population diversity, by tracking offspring, the results showed that all the individuals in the final population were similar.
In [25], NEH heuristic is regarded as the best heuristic for the PFSP. The NEH algorithm is based on the idea that the high processing time on all machines should be scheduled as early in the sequence as possible. The NEH heuristic has two phases.
(1) The jobs are sorted in nonincreasing sums of their processing time.
(2) A job sequence is established by evaluating the partial schedules based on the initial order of the first phase. The standard NEH and a variant of standard NEH (NEH1) can be described as shown in Algorithm 2; the only difference of two NEH is that the inserted position of new job in partial schedules is different: NEH1 have only two possibilities of inserting.

Position Updating of Bat.
Scheduling problem with many jobs can be viewed as a combination of many subscheduling problems; as we all know, we can apply dynamic programming to solve this problem. However, in this paper, the idea of partition is adopted, a complete scheduling sequence is divided into many segments, and each subscheduling problem is solved by superior NEH. In continuous BA, the bat individual randomly selects a certain range of frequency, and its speed is updated according to their selected frequency; at last, a new position is generated using its speed and its own position. In DBA, for each individual, firstly, a frequency is selected in the range of frequency [ min , max ]; frequency denotes the number of The Scientific World Journal subsequences, where min , max are two integers in the range of job amount , where ⌊⋅⌋ denotes rounded down function. Secondly, frequency decides the starting location and ending location of each subsequence, and the position ( ) is divided into subsegments; these subsequences are viewed as the velocity V , ( ) of bat individual, where ≤ . Thirdly, these velocities are updated by NEH; the new velocity is called V tmp, ( ). At last, the corresponding part of ( ) is replaced by V tmp, ( ).
In order to facilitate understanding, there is a simple instance:

Pulse Emission Rate Local Operation.
In original BA, the pulse emission rate and loudness are used to control the intensive local search, that is to generate a new individual around the current global best individual . In DBA, each individual has its own pulse emission rate . The initial pulse emission rate is a positive and smaller number; with the increase of iteration, pulse emission rate will increase to 1. The updating of using Figure 2 presents an example of updating curve of pulse emission rate under maximal iterations is 100, pulse emission rate has a value ranging from 0 to 1. Using this updating formula, the algorithm can not only quickly exploit near the current optimal position in the early iteration, so that speed up the convergence rate, but also can mainly concentrate in diversity in later search and can avoid to fall into local optima.  The pulse emission rate will control the subsegment local operation. For each individual, randomly generate a random number; if this random number is larger than its , this position of bat individual will be updated by random swap two segments defined by frequency ; otherwise, the updating operation will be implement by random inserting operation; the pseudo code can be described as shown in Algorithm 3.

Loudness Local Operation.
In DBA, the loudness Ld of bat individual is relative to its own fitness fit ; the better fitness, the less loudness. The loudness can be described by where fit is the fitness of individual and fit min and fit max are the minimum and maximum fitness in current population, respectively. In DBA, the loudness reflects the quality of individual. In this subsection, there are two kinds of local search embedded into algorithm, random subsequence inverse and random subsequence inserting. Note that, where inserting operation is different from inserting operation in Section 3.4. In this part, for each individual, randomly generate a random number; if this random number is larger than its Ld , a random length of subsequence is randomly selected in range of [1, ⌊ /2⌋]; this position of bat individual will be updated by inserting operation with random subsequence; otherwise, the updating operation will be implement by random subsequence inverse operation. Note that the subsequence is a portion of the current best position ; however, the corresponding replacement portion is the individual in bat population, and the pseudo code can be described as show in Algorithm 4.
Although this inserting and inverse operation may generate invalid scheduling sequence,those invalid scheduling sequences need to adjust to a feasible solution. The adjustment of the pseudo code can be described as show in Algorithm 5. 3.6. Intensive Virtual Population Neighborhood Search. In this paper, an intensive virtual population neighborhood search with same population size is easily embedded in DBA for solving PFSP. The purpose of the virtual population neighborhood search is to find a better solution from the neighborhood of the current global best solution. In this part, three neighborhoods, that is, insert, swap, and single-point move backward operate, are employed. These operations are used to improve the diversity of population and enhance the quality of the solution.
In order to enhance the local search ability and get a better solution, a new population is generated based on the current global best solution, and the population size is not less than original bat population; the new population is called virtual population. The new population size ps 1 = × ps, ≥ 1 is real number.
Firstly, the virtual population is generated by randomly selecting two jobs to perform swap operation. Secondly, the virtual population is generated by randomly selecting a job and insert into another random location. At last, the singlepoint move backward operation is performed also based on current global best individual . In the simulation, first of all, a job position is chosen randomly in ; the selected job is inserted into the back of job , orderly, until the population size ps 1 is reached. For example, the population size ps 1 = 3, random job position = 2, and = [2,5,4,1,3]; the virtual population is generated as follows:

Discrete Bat Algorithm (DBA).
In DBA, all individuals once the update either in bat population or in virtual population, these individuals will be evaluated and one solution be accepted as the current global best if the objective fitness of it is better than the fitness of the last . The algorithm terminates until the stopping criterion is reached; the DBA algorithm for PFSP can be described in Algorithm 6.

Numerical Simulation Results and Comparisons
To test the performance of the proposed DBA for the permutation flow shop scheduling, computational simulations are carried out with some well-studied problems taken from the OR-Library (http://people.brunel.ac.uk/∼mastjjb/ info.html). In this paper, 29 problems from two classes of PFFSP test problems are selected. The first eight problems are instances Car1, Car2 through to Car8 designed by Carlier [26]. The second 21 problems are instances Rec01, Rec03 through to Rec41 designed by Reeves and Yamada [27]. So for each individual Compute loudness by (7); if rand > / * random sub-sequence inserting * / Randomly select a length of sub-sequence; Randomly determine the sub-sequence with selected length in ; Insert this sub-sequence into a random location in remainder sequence; else / * random sub-sequence inverse * / Randomly select a length of sub-sequence; Randomly determine the sub-sequence with selected length in ; Perform inverse operation on selected sub-sequence; Replace original sub-sequence with inverted sub-sequence end if end for far, these problems have been widely used as benchmarks to certify the performance of algorithms by many researchers.
The DBA is coded in MATLAB 2012a, and in our simulation, numerical experiments are performed on a PC with AMD Athlon(tm) II X4 640 Processor 3.0 GHz and 2.0 GB memory. In the experiment, the termination criterion is set as ( × /2) × 30 ms maximum computation time. Setting the time limitation in this way allows the much computation time as the job number or the machine number increases. And, this method is also adopted by many researchers, such as Jarboui et al. [28], Ruiz and Stützle [29]. Each instance is independently run 15 times for every algorithm for comparison.
The comparison method adopts BRE, ARE, and WRE to measure the quality of solution by the percentage difference from * ; these expressions as follows: where * is the optimal makespan or upper bound value known so far, the makespan of an obtained solution in DBA is max , BRE represents the best relative error to * , ARE denotes the average relative error to * , and WRE represents the worst relative error to * . Std denotes the standard deviation of the makespan. These performance measures are employed in our experiments; these results are rounded to the nearest number which contains 2 or 3 digits after the decimal point.

Parameter Analysis.
In the subsection, parameters of DBA are determined by experiments, and the impact of each parameter is analyzed. In DBA, parameters ps, are tested. ps is population size, A small ps may lead insufficient information provided, and the diversity cannot guarantee. On the other side, a large one indicates diversity is sufficient, but the computing time will increase. determines the size of virtual population; the large one can perform large single point neighborhood search, which may achieve a better solution, especially, the current best solution extraordinarily approximated the exact solution; however, an oversize will increase the computing time, and the precision of optimal solution may have lesser improvement. In order to evaluate the sensitivity of parameters, Car5 and Rec11 are chosen to run 15 times and the results are shown in Figures 3 and 4

Figures 3 and 4 represent the relative error of test case
Car5 and Rec11 after 15 times independent running, which showed the sensitivity of parameters ps and . = 2 when test parameter ps, and ps = 10 when test parameter . From the two test cases, for Car5, the performance is better and better while parameter ps gradually increases. But for Rec11, ps equal to 40 or 50 can achieve exact solution, but the performances do not follow the laws of Car5. In DBA, the parameter ps takes a compromise values, ps = 50. Similarly, parameter equal to 2 is optimal for Car5; however, = 3 is optimal for Rec11. In order to balance all test cases, the parameter is set as 1 while ps = 50.

Comparisons of DBA, DBA NEH1, and DBA-IVPNS.
In order to evaluate the performance of each strategy, two variants of DBA are compared, whose abbreviations are as follows.
At this group experiment, the parameter setting is ps = 10, = 2, termination criterion is set as ( × /2) × 10 ms maximum computation time, and the algorithm is run 15 times independently. The statistical performances of DBA, DBA NEH1, and DBA-IVPNS are shown in Table 1.
reason may be that the IVPNS implementation is singlepoint operation on the current global best individual ; this operation may improve the quality of solution, bur this needs much computing time, so the DBA-IVPNS have more time to explore of more new position. However, from Rec1 to Rec41, the DBA is much better than other variants.

12
The Scientific World Journal      Std  BRE  ARE  WRE  BRE  ARE  WRE  BRE  ARE  BRE  ARE  Std  Car1-Car8  32  31  30  32  32  27  28  32  29  30  30  16  32  19  27  Rec1-Rec41  60  58  62  70  40  37  56  73  66  78  20  4  73  57  77  Car1-Rec29 78  78  78  83  63  54  67  85  75  84  47  19  82  54  81  Car1-Rec41  92  89  92  102  72  64  84  105  95  108  50  20  105  76   In addition, in order to demonstrate the effect of each strategy in the specific scheduling problem, the frequency of finding a new best solution by applying these moves in DBA is recorded; it can show the contribution of each strategy. The Car1 to Car8 and Rec1 to Rec15 16 benchmarks are chosen to tested. Each problem was run 10 times; each time a new best solution was found by the algorithm; the move resulting in this improvement was recorded. Figure 5 demonstrates the percentage of contribution.

4.3.
Comparisons of DBA, PSOMA, PSOVNS, OSA. In order to show the effectiveness of DBA, we carry out a simulation to compare our DBA with other state-of-art algorithms, that is, PSOMA proposed by Liu et al. [11], PSOVNS proposed by Tasgetiren et al., and experimental results reference [5], and SA is a simulated annealing, the experimental results reference [16]. The population size is 50 and the termination criterion is set as ( × /2) × 30 ms maximum computation time. The experimental results are listed in Table 2.
From Table 2, for the Car problems, the DBA, PSOVNS, PSOMA, and OSA all can find the exact solution, and DBA is better than the other algorithm on ARE. For the Rec problems, DBA also can find better solutions. Compared with DBA, PSOVNS, PSOMA, and OSA, the DBA achieved 14 exact solutions; several optimal job permutations are shown in Table 3. PSOVNS achieved 11 exact solutions, PSOMA achieved 16 exact solutions, and OSA achieved 13 exact solutions. For all test problems, obtained solutions of DBA are not better than the PSOMA and OSA, but the performance is similar to PSOMA and OSA.
In order to compare each norm (BRE, ARE, WRE, and Std) of corresponding algorithms, for all benchmarks, each norm is scored among corresponding algorithms. The first is score 4, the second is score 3, the third is score 2, the fourth is score 1, and the last is score 0, if several results are same, they have same score. The statistical results are listed in Table 4. From Table 4, for Car problems, the DBA is best on ARE, the DBA and PSOMA are identical on WRE, DBA has better Std compared with OSA. For Rec problems, the OSA and PSOMA have better BRE, the DBA is better than PSOVNS, the DBA is better than PSOVNS, OSA, the DBA is also better than PSOVNS on WRE among DBA, PSOVNS, and PSOMA, but the Std is not better than OSA. The DBA is best on ARE for Car1 to Rec29 among DBA, PSOVNS, PSOMA, and OSA, and the Std is better than OSA. On the whole, the achieved solutions of DBA have better quality. For large-scale scheduling problems, the DBA still have the room for improvement; it also is our further work.
The DBA achieved 14 exact solutions, due to the fact that Rec35 have 10 machines and 50 jobs, the margin of paper is restricted, the Gantt chart of an optimal schedule for Rec35 cannot display on this paper, and the Gantt chart of Car5, Car6, Rec7, and Rec11 is selected as instance. These Gantt charts of an optimal schedule are shown in Figures 6, 7, 8, and 9. Figures 10, 11, 12, and 13 show the convergence curves of Car5, Car6 Rec7, and Rec11. From Figures 10 to 13, the convergence rate of DBA is fast, and the precision of solution is prominent. The performance of DBA is similar to PSOMA; however, the convergence rate of DBA is faster than PSOMA in the early phase of iteration. The precision of solution is not as good as PSOMA while the scale of scheduling problems is increasing. The DBA is better than SGA + NEH [5], PSOBNS, and OSA in some aspects.

Conclusions
In this paper, we construct a direct relationship between the job sequence and the vector of individuals in DBA; a DBA is proposed to solve PFSP. In order to evaluate the performance of the proposed DBA, we compare DBA with several PFSP algorithms with benchmark problems of PFSP. Experimental results have shown that our algorithm is pretty effective, the performance of each strategy is evaluated, and sensitivity of parameters is analyzed. Moreover, our further work is to study the theoretical aspects as well as the performance of the technique.