Improved Quantum Genetic Algorithm in Application of Scheduling Engineering Personnel

and Applied Analysis 3 Table 1: Example of scheduling engineering personnel problem. Engineering works Processes


Introduction
In engineering work, the number of participants is large and the qualities of the personnel are uneven, so the time of each group carrying out an engineering work is different; the processes of engineering work are so many that the scheduling of the engineering personnel is complex [1].There is parallelism in some processes of engineering work.Any work group can be selected for any process of engineering work and the operating times of different work groups are different.These factors increase the complexity and flexibility of scheduling.Different scheduling schemes cause different total operation time.Proper scheduling scheme can improve efficiency and save time [2].So, solving the personnel scheduling problem of engineering work is one of the key aspects to improve the efficiency of engineering work.
Scheduling engineering personnel is a complex NPhard problem [3].Currently the main methods to solve such problems contain branch-bound method, heuristic algorithms, and so on, but these algorithms can only solve the scheduling engineering personnel problem with a small scale, and there are imperfections in coding method of these algorithms, which may lead to illegal solutions [4].The improved quantum genetic algorithm has better robustness, versatility, excellent computing power, implicit parallelism, and global search capability and can be successful in solving the scheduling engineering operating personnel problem.

Description of Scheduling Engineering Operating Personnel Problem
Scheduling engineering operating personnel problem is the extension of standard scheduling personnel problem.

Standard Scheduling Personnel Problem.
The standard personnel scheduling problem can be described as follows: suppose there are  tasks which need to be finished, all of which can be divided into two stages:  and .The two stages must be finished in order, as in Figure 1.Every stage of the task is finished by only one work group.The object is to find an order to make the time from the beginning of the first task to the end of the last task shortest.The rule of sorting of the two-stage engineering work has been put forward by Johnson in 1954, which is as follows: min (  ,   ) ≤ min (  ,   ) .
(1)  Equation ( 1) is the condition that task  is ordered before the task , where   is the time needed by the first stage of task  and   is the time needed by the second stage of task .

Extension of Scheduling Engineering Personnel Problem.
Extension of scheduling engineering personnel problem is based on the standard personnel scheduling problem.The stages of the task needed to be done are more than two, the work groups for finishing every stage of the task are more than one, and the time in which different work teams finish the task is different.There is not an authentic rule of sorting of the extension of scheduling engineering personnel problem.
Extension of scheduling engineering operating personnel problem can be described as follows.There are a number of engineering works which can be decomposed into a certain number of steps, and at least one of all steps can be completed in parallel by multiple work groups.The problem is to determine the distribution of work groups in parallel.That is, there are  work groups and  engineering works { 1 ,  2 ,  3 , . . .,   }.Decompose these engineering works into  processes uniformly { 1 ,  2 ,  3 , . . .,   }.Each process   has   parallel work group (1 ≤  ≤ ,1 ≤   ≤ , ∑   > ).The figure of scheduling engineering operating personnel problem is shown in Figure 2. The target is to minimize the maximum flow time through conducting an optimal allocation [5].
Each process of each engineering work can be completed by any parallel team of corresponding process, but the work times are different [6].The specific example is shown in Table 1.  stands for the th process,   stands for the th parallel work group of the th process, and the data of   stands for the work time that the th parallel work group needs to complete the th process.Table 1 is an operational timetable which includes four engineering works ( 1 ,  2 ,  3 ,  4 ), three processes ( 1 ,  2 ,  3 ), and nine engineering work groups.
The engineering personnel scheduling problem in this paper satisfies the following constraints: (1) different engineering works have the same priority; (2) there is no order constraint between different engineering works, but the processes of the same engineering work are successive [7]; (3) any engineering work can start at the beginning; (4) one work group only can carry out one engineering work at the same time; (5) the same process of the same engineering work can only be completed by one work group.(6) Once started, each process of the engineering work cannot be interrupted.(7) The only performance is the maximum completion time  max ; that is, the purpose of scheduling is to minimize the maximum completion time: where   is the completion time of the work group   , 1 ≤  ≤  ( is the total number of work groups of each process), and   is the th parallel work group of the final process.

Calculation of Engineering Work Time
We need to follow certain principles to calculate the work time of the determined scheme to minimize the work time when the scheduling scheme of engineering work groups is determined.During the whole engineering work, the consuming time is divided into two parts: the working time and the waiting time [8].Suppose the   th work group of the work groups of the first process  (1)  (  ) needs cost  (2) (  ) to complete the first process of the th engineering work, the   th work group of the work groups of the second process  (2)  (  ) needs cost  (2)   (  ) to complete the second process, and the   th work group of the work groups of the third process  (3) (  ) needs cost  (2)   (  ) to complete the third process.The total time the first process of the th engineering work costs is  (1) (  ) ; the total time the  −1 th work group  (2)  ( −1 ) costs on the second process of the 1th engineering work is  (2)  ( −1 )−1 , ( > 1).Calculation of  (2)  (  ) is divided into two situations: (1) when Take the two situations together, the formula of calculating the total time  (2)  (  ) of the   th work group  (2)   (  ) completing the second process of the th engineering work is  (2)  () = max ( (1)  () ,  (2)  (−1)−1 ) +  (2)  () .
Similarly, similar formula of the third step can be obtained.The specific formulas are in Table 2.The formulas in Table 2 indicate the total time    of the th engineering work cost from the beginning to the th process.

The Improved Quantum Genetic Algorithm Used to Solve the Scheduling Engineering Personnel Problem
Quantum genetic algorithm (QGA) is the product of the combination of quantum computation and genetic algorithms, and it is a new evolutionary algorithm of probability [9].It is successfully used to solve the TSP problem [10].The quantum state vector is introduced in the genetic algorithm to express genetic code, and quantum logic gates are used to realize the chromosome evolution.By these means, better results are achieved [11].Genetic algorithm has been widely applied in scheduling engineering personnel [12][13][14].The improved quantum genetic algorithm is applied to solve the scheduling engineering personnel problem in order to achieve the optimization of scheduling engineering personnel.

The Qubit Encoding of Scheduling Engineering Personnel
Problem.Ensuring that the encoding method is the most important for applying improved quantum genetic algorithm to solve the scheduling engineering personnel problem.The qubit encoding needs to combine the optimization problem with the improved quantum genetic algorithm.The engineering works which can be divided into the same number of processes need to be completed, and there is at least one process that can be completed by multiple parallel work groups.It needs to ensure the distribution of parallel work groups in order to minimize the maximum completion time.
The features of scheduling engineering personnel problem are as follows: for example, there are  engineering works that need to be completed; every work must be completed through  processes.The number of parallel work groups of every process is   (1 ≤  ≤ ).There is at least one process that can be completed by multiple parallel work groups; that is, there is at least one   which is greater than one.Construct a  ×  dimensional matrix: where the element   of matrix is a random real number between the ranges [1,   + 1), which means that the th process of the th engineering work is completed by the int   th work group (int means getting the greatest integer which is not greater than   ).
, it indicates that the same processes of multiple engineering works are completed by the same work group.Use variable   ( = 1, . . .∑   ) to record the number of engineering works every work group completes.
The improved quantum genetic algorithm adopted in this paper is the algorithm based on the algorithm in document [11].The multiqubits encoding which has  parameters is defined as follows: where    represents the th individual chromosome of the tth generation;  represents the number of qubit encoding of each gene;  represents the number of genes in the chromosome [15].Initialize the quantum encoding (, ) of each individual in the population with (1/ √ 2, 1/ √ 2), which indicates that when  = 0, the possibility of each state expressed by a chromosome is equal [16].
The allocation coding matrix is encoded by qubit as The element in (7) is which represents the qubit encoding of the ordinal number of work team, where  ( = 1, 2, . . ., ) represents the ordinal number of engineering work,  ( = 1, 2, . . ., ) represents the ordinal number of process, and   ( = 1, . . ., ) represents the length of the qubit encoding; usually the more work groups there are for the process , the longer the length is.The number   generated by qubit encoding which represents the th process of the th work is finished by the   th work group.

The Solution Based on Improved Quantum Genetic Algorithm.
The solution should be solved based on the qubit coding.

Quantum Rotating Gates.
Quantum genetic algorithm applies the probability amplitude of qubits to encode chromosome and uses quantum rotating gates to realize chromosomal updated operation.
Quantum rotating gates can be designed according to the practical problems and usually be defined as The updated process is where (  ,   )  and (   ,    )  are the probability amplitudes of the th qubit in chromosome before and after the quantum rotating gates updating, respectively;   is the rotating angle, and the value and the sign of   are determined by the adjustment strategy [17,18].  is static in conventional quantum genetic algorithm.The value of   can be dynamically adjusted based on the evolutionary process in the improved quantum genetic algorithm.Adjust the value of the rotating angle according to the number of generation; the regulator is as follows: where   is the value of the rotating angle of the th generation,  max is the maximal rotating angle,  min is the minimal rotating angle,  max is the maximal generation, and iter is the current generation. max = 0.01,  min = 0.001.The adjustment strategy is as follows: comparing the fitness of the currently measured value () of the individual    with the fitness of the current optimal individual (best  ), if () > (best), then adjust the corresponding qubits of    , making the probability amplitude (  ,   ) evolve toward the direction that is propitious to the emergence of   .Conversely, if () < (best), then adjust the corresponding qubits of    , making the probability amplitude (  ,   ) evolve toward the direction that is propitious to the emergence of best.
Construct a determinant  = , where (  ,   ) is the probability amplitude of some qubit of the optimal solution which has been searched.(  ,   ) is probability amplitude of corresponding state of qubit in the current solution.When   ̸ = best  , if  ̸ = 0, then the direction of the rotating angle is −sgn().If  = 0, the direction of the rotating angle can be either positive of negative.

Quantum Mutation.
Add quantum mutation operation in conventional quantum genetic algorithm.Quantum mutation enables some individual to deviate slightly from the current evolutionary direction and prevent the evolution of individual into a local optimal solution [19].Quantum mutation can completely reverse the individual's evolutionary direction by swapping the value of probability amplitude of qubits (, ).Quantum NOT gates are adopted to realize chromosomal variation.2) C(3) B(4) A( 5) D( 6) C( 7) B(8) 2 B(1) A( 2) D( 3) C( 4) B( 5) A( 6) D( 7) C(8) 3 C(1) B( 2) A( 3) D( 4) C( 5) B( 6) A( 7) D(8) 4 D( 1) C( 2) B(3) A( 4) D( 5) C( 6) B( 7) A( 8 The new whole interference crossover operator is mainly used when the algorithm converges to local optimal solution to generate new individuals to overcome the prematurity in later evolution.Suppose that there are 4 populations and the lengths of them are all 8.One result of the whole interference crossover is as in Table 3.
It is important to note that quantum rotating gates, quantum mutation, and quantum disaster all act on quantum chromosome.However, whole interference crossover acts on the chromosome generated by quantum chromosome.The evolution performance will not be introduced if the whole interference crossover acts on quantum chromosome.
The improved strategy of quantum genetic algorithm mainly contains self-adaptive rotating angle strategy, the improvement of program structure of quantum evolution, added quantum mutation operation, quantum disaster operation, and whole interference crossover operation.The flowchart of improved quantum genetic algorithm is shown in Figure 3.

The Determining Flow of Scheduling Engineering Personnel.
The steps to determine the scheme of scheduling engineering personnel are as follows.
Step 1 (initialize distribution scheme).Initialize allocation scheme to form the initial population according to the needs of the evolution of quantum genetic algorithm and the assignment matrix.
Step 2 (time calculation).Calculate the time of all the allocated schemes in the population.Abstract and Applied Analysis 7Step 3 (optimize the allocation scheme).Apply the improved quantum genetic algorithm to optimize the allocation scheme in order to get the optimal allocation scheme.Go to Step 2, according to the termination condition, to do the judgment; if the termination condition is satisfied, then go to the End or else do the loop to Step 3.
Step 4 (determination of the optimal allocation scheme and the shortest work time).Choose the optimal allocation scheme form the population satisfied the termination condition.Calculate the work time of the optimal allocation scheme.
The flowchart is shown in Figure 4.

Simulation Analyses
Take some road building project as an example.There are 12 roads which need to be built.The building work can be divided into three procedures: prospecting, drawing and location designing, and construction.There are 3 prospecting groups, 2 drawing and location designing groups, and 3 construction groups.The capacities of the groups are different.The specific work times are shown in Table 4.
The specific steps of acquiring the optimal allocated scheme and the shortest work time are as follows.
(1) Construct 12 × 3 dimensional matrix: Suppose the generated matrix is Then, the encoding section of the assigned chromosome is (2) Seek the values of time     corresponding with       (where 1 ≤  ≤ 12, 1 ≤  ≤ 3, , ,  are integers) in Table 2.Then, the work timetable of every engineering work is gotten.In Table 5, the figure denotes the work time, and the subscript denotes the work group.
(3) Apply the method of Section 3 to calculate the work times of every work group according to the order determined by Step (2) and the time determined by Step (3).Then, find the maximum value as the total engineering work time.
Apply GA (genetic algorithm), QGA (quantum genetic algorithm), and IQGA (improved quantum genetic algorithm) to solve the problem of scheduling engineering personnel.The three kinds of algorithm are written and compiled in MATLAB.The simulation test in this paper is based on the AMD CPU 1.8 GHz, 1.5 GB RAM.The parameters of GA are set as follows: GA is encoded by real number, the total evolution generation is 80, the size of population is 40, and the probability of mutation is 0.01.The parameters of QGA are set as follows: QGA is encoded by the binary, the total evolution generation is 80, the size of population is 40, the length of the variable expressing 3 work groups is 2, and the length of the variable expressing 2 work groups is 1.The parameters of IQGA are set as follows: IQGA is encoded by the binary, the total evolution generation is 80, the size of population is 40, the length of the variable expressing 3 work groups is 2, the length of the variable expressing 2 work groups is 1, and the probability of mutation is 0.01.The fitness function is the objective function.The fitness function tends to the optimal The statistical results of the experiment are shown in Table 9.
Table 9 shows that compared with GA, QGA can get its smallest value in a short time; however, QGA can hardly get the optimal result.Though the evolution time of the IQGA is longer and the evolution generation of the IQGA is more, the IQGA can get the optimal result in a bigger probability.
In Figure 5, x-axis represents the evolution generations, and y-axis represents the work time.The work time gradually becomes shorter with the increase of the generation.
In Figure 6, x-axis represents the evolution algebra and y-axis represents the work time.The average work time of all individuals has a decreasing trend, but there is a gap between the optimal value and the average work time.Engineering personnel can be scheduled based on the Gantt chart of the optimal scheme.The role of the Gantt chart is to aid in allocation decisions of scheduling engineering personnel.

Conclusions
Compared with genetic algorithm and standard quantum evolutionary algorithm, the advantages of improved quantum genetic algorithm are as follows: (1) IQGA adopts directed evolution which can find the optimal solution more quickly than undirected evolution; (2) the self-adaptive quantum rotation angle with larger rotation angle at the early stage of the evolution and with smaller rotation angle in the late evolution is advantageous for exploration and exploitation; (3) quantum mutation is good to generate new quantum chromosome to increase the diversity of population to extend the search space; (4) quantum disaster can make evolution jump out of local optimal solution to increase the search probability of the global optimal solution; (5) the whole interference crossover takes effect on the level of chromosome coding generated by quantum chromosome to generate new chromosome coding.The search space is effectively expanded and the probability to find optimal solution is increased.

Figure 1 :
Figure 1: Diagram of standard scheduling personnel problem.
population Q(t 0 ) and every parameter Test every individual of Q(t 0 ) Evaluate the fitness of every individual of Q(t 0 ) Set the best individual as the evolutional goal of next generation Test every individual of Q(t 0 ) Quantum rotating door update population, get Q(t + 1) Quantum mutation, whole interference crossover Whether or not disaster t = t + 1

Figure 4 :
Figure4: Flowchart of acquiring the optimal allocated scheme and the shortest work time.

Figure 5 :Figure 6 :
Figure 5: The changing curve of work time of the best individual in the population.

Figure 7 :
Figure 7: Gantt chart of the optimal scheme.

Table 1 :
Example of scheduling engineering personnel problem.

Table 2 :
Total time of completion of every process.

Table 3 :
One result of the whole interference crossover.

Table 4 :
Work time of every work group.

Table 5 :
Work time of every engineering work and corresponding work group.

Table 6 :
The simulation results of ten rounds of experiments of GA.

Table 7 :
The simulation results of ten rounds of experiments of QGA.

Table 8 :
The simulation results of ten rounds of experiments of IQGA.

Table 9 :
The statistical results of the experiment.