#### Abstract

To verify the availability of the improved quantum genetic algorithm in solving the scheduling engineering personnel problem, the following work has been carried out: the characteristics of the scheduling engineering personnel problem are analyzed, the quantum encoding method is proposed, and an improved quantum genetic algorithm is applied to address the issue. Taking the low efficiency and the bad performance of the conventional quantum genetic algorithm into account, a universal improved quantum genetic algorithm is introduced to solve the scheduling engineering personnel problem. Finally, the examples are applied to verify the effectiveness and superiority of the improved quantum genetic algorithm and the rationality of the encoding method.

#### 1. 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 NP-hard 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.

#### 2. Description of Scheduling Engineering Operating Personnel Problem

Scheduling engineering operating personnel problem is the extension of standard scheduling personnel problem.

##### 2.1. 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:

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 .

##### 2.2. 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 . Decompose these engineering works into processes uniformly . Each process has parallel work group . 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 , three processes , 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 ; that is, the purpose of scheduling is to minimize the maximum completion time: where is the completion time of the work group , ( is the total number of work groups of each process), and is the th parallel work group of the final process.

#### 3. 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 needs cost to complete the first process of the th engineering work, the th work group of the work groups of the second process needs cost to complete the second process, and the th work group of the work groups of the third process needs cost to complete the third process. The total time the first process of the th engineering work costs is ; the total time the th work group costs on the second process of the 1th engineering work is , . Calculation of is divided into two situations:(1)when , ;(2)when , .

Take the two situations together, the formula of calculating the total time of the th work group completing the second process of the th engineering work is

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.

#### 4. 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–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.

##### 4.1. 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 (). 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 , which means that the th process of the th engineering work is completed by the th work group ( means getting the greatest integer which is not greater than ).

If , it indicates that the same processes of multiple engineering works are completed by the same work group. Use variable to record the number of engineering works every work group completes.

Accord the structure of (2) to design the chromosome of quantum genetic algorithm:

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 th 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 , which indicates that when , 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 represents the ordinal number of engineering work, represents the ordinal number of process, and 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.

##### 4.2. The Solution Based on Improved Quantum Genetic Algorithm

The solution should be solved based on the qubit coding.

###### 4.2.1. 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, is the maximal rotating angle, is the minimal rotating angle, is the maximal generation, and is the current generation. , .

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 , if , then adjust the corresponding qubits of , making the probability amplitude evolve toward the direction that is propitious to the emergence of . Conversely, if , 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 , if , then the direction of the rotating angle is −sgn(). If , the direction of the rotating angle can be either positive of negative.

###### 4.2.2. 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.

###### 4.2.3. Quantum Disaster

Add quantum disaster operation in the conventional quantum genetic algorithm. The method is to apply a large disturbance to some individuals in the population and regenerate some other new random individuals [20].

###### 4.2.4. Whole Interference Crossover

Whole interference crossover operator is utilized to realize evolution instead of the traditional crossover operator. All chromosomes are involved in the whole interference crossover. Set the number of population to be , and length of chromosome is (). is the th bit of the th individual. Then, the chromosome of the th individual of the new family through the whole interference crossover is −−−−−. 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.

##### 4.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.

*Step 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.

#### 5. 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 dimensional matrix: where , , . The corresponding qubit chromosome is

Suppose the generated matrix is

Then, the encoding section of the assigned chromosome is (2)Seek the values of time corresponding with (where , , 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 value while the evolution increases. Simulate the process of evolution. Ten rounds of experiments were presented in this paper. The simulation results of the 3 kinds of algorithm are in Tables 6, 7, and 8. The result of some time of the IQGA is shown in Figures 5, 6, and 7.

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, -axis represents the evolution generations, and -axis represents the work time. The work time gradually becomes shorter with the increase of the generation.

In Figure 6, -axis represents the evolution algebra and -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.

In Figure 7, -axis represents time; -axis represents the number of the engineering work. The length of the rectangles represents the work time of the engineering work; the number in the rectangle represents the number of the work group of the corresponding process.

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.

#### 6. 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. So, IQGA can search the optimal solution faster and more efficiently based on the above-mentioned advantages.

Application of improved quantum genetic algorithm and appropriate mathematical model can solve the complex scheduling engineering personnel problem. Through this method, we can obtain the optimal allocation scheme, and the work time of the allocation scheme is also determined. The Gantt chart of the result clearly describes the work time and work order of each engineering work. The method in this paper can provide powerful support for the scheduling engineering personnel. The proposed method in this paper not only can be applied in the scheduling engineering personnel but also can be used for similar types of problem with multistage, multiple projects, and multiple subjects and the abilities of subjects are different, such as other scheduling problems and flexible flow shop scheduling problem.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.