An Effective Hybrid Algorithm Based on Particle Swarm Optimization with Migration Method for Solving the Multiskill Resource-Constrained Project Scheduling Problem

The paper proposed a new algorithm to solve the Multiskill Resource-Constrained Project Scheduling Problem (MS-RCPSP), a combinational optimization problem proved in NP-Hard classiﬁcation, so it cannot get an optimal solution in polynomial time. The NP-Hard problems can be solved using metaheuristic methods to evolve the population over many generations, thereby ﬁnding approximate solutions. However, most metaheuristics have a weakness that can be dropping into local extreme after a number of evolution generations. The new algorithm proposed in this paper will resolve that by detecting local extremes and escaping that by moving the population to new space. That is executed using the Migration technique combined with the Particle Swarm Optimization (PSO) method. The new algorithm is called M-PSO. The experiments were conducted with the iMOPSE benchmark dataset and showed that the M-PSO was more practical than the early algorithms.


Introduction
Scheduling problems are studied to solve many cases of science and practice, especially big projects which have many tasks. Actually, each real project often has a much larger amount of tasks than the number of renewable resources: people, tools, machines, devices, etc., which can be used to do all of them. erefore, it is very important to find a good solution to assign resource-to-task efficiently, satisfying the project's preconstraints. e research to solve this problem has many useful implications such as scheduling of resource coordination in operating systems [1] and scheduling for production lines or applications in subjects of economy and finance [2], military [3], cloud computing [4], fog computing [5], wireless sensor networks [6], etc. Many research results published have shown that this problem is classified into NP-Hard [7][8][9].
Resource-Constrained Project Scheduling Problem (RCPSP) [1,10,11] is a project scheduling problem with limited resources, which has been proven to be an NP-Hard problem. e goal is to find a good schedule with minimal time in terms of resource constraints. Currently, this problem is studied and applied in many fields. According to the problem definition, it has two important constraints: (i) Each renewable resource can only perform a task at a time. Until that task completes, the resource can be used to execute another task.
(ii) When a task has started, it cannot be interrupted until it completes.
In each project, tasks have precedence constraints, which means some tasks need to be finished before others.
An important problem extended from RCPSP is MS-RCPSP [7,8,12] (multiskill RCPSP) that has a new constraint on the skill factor of implementation resources. e new characterization of this problem states that a resource may have more than one skill type, and each skill type has a specific skill level. Each task will have exact requirements about the skill type and skill level of the performing resource.
is definition makes the MS-RCPSP more appropriate to real-life projects. e problem is solved by initializing a population of many feasible schedules for the project. e population will evolve step by step through generations to find the best schedule. However, evolution methods often fall into local extremes, so the population cannot run further.
is paper proposes a new algorithm using the Migration method combined with PSO traditional to crack the disadvantage when falling into the local extremes. e innovations and main contributions of this paper are described as follows.
(i) Detecting local extremes in the population evolution. (ii) Proposing the method to escape local extremes by moving the population to a new values space using the Migration. e rest of the paper is separated into six sections. Section 2 introduces some early approaches to decoding the MS-RCPSP problem. In Section 3, we raise the mathematical statement of the MS-RCPSP problem. Section 4 presents a new efficient algorithm for finding the approximate solution based on the PSO strategy [2,13]. In this section, we focus on detailing the Migration technique, which is a major component that makes up the power of the proposed algorithm. To evaluate the algorithm, this section also introduces the particle presentation. Section 5 experiments to demonstrate the efficiency of the proposed algorithm. e examination is conducted on some instances of the iMOPSE benchmark dataset. All experimental results are compared and analyzed with other algorithms to show the effectiveness of the new algorithm. Finally, Section 6 arranges the paper and draws further research directions to enhance the quality of the MS-RCPSP problem.

Approximation Methods for MS-RCPSP.
In recent years, researching good methods to solve the MS-RCPSP [7,12,14] problem has become important in deploying it into many domains. Since this is a combinatorial optimization problem belonging to the NP-Hard [11,15,16] classification, we cannot find an optimal solution in polynomial time, so the objective of methods is to find an approximate result based on metaheuristic techniques. Authors usually use evolutionary approaches as GA [17,18], PSO [19][20][21][22], Greedy, Min-Max, etc. to solve and get out the approximate solutions. Some of the outstanding related works are shown in Table 1.
Myszkowski et al. [8,9,23] have researched this problem for many years, and they have many quality publication papers presented regarding that. e authors proposed algorithms based on evaluation methods such as Tabu Search [8], Ant colony, GA [9,24,25], etc. Most of them are traditional methods, so they usually have limited effective results. However, the best contribution of Myszkowski is to build and publish the standard dataset used to experiment with the new algorithms for the MS-RCPSP. It is called the iMOPSE dataset [9].
Hosseinian and Baradaran [7,26] have many published papers about MS-RCPSP too. In 2018, Hosseinian and Baradaran published a paper [7] on the Multimode MS-RCSPSP (MMSRCPSP), a subclass of the MS-RCPSP problem. MMSRCPSP has added constraints where each task can only be executed in a few predefined modes. When the mode is selected, it cannot be changed. e authors suggested a method to make individuals in the next generation, which is built from the GA algorithm combined with the decision-making method based on Shanon-entropy data measure. Experiments were carried out on randomly generated datasets by ProGen software. After that, in 2019, the authors published a paper [26] on the Dandelion Algorithm [27]. In 2020, this group of authors continued to publish an article that solves the multiobjective MS-RCPSP problem with two objectives: total time and cost to complete a project. e authors use the Pareto-based Gray Wolf Optimizer algorithm and continue to test the results on the iMOPSE standard dataset [9].
In 2017, Javanmard et al. used two traditional evolutionary algorithms, GA and PSO, to schedule multiskill resources (actually workers and engineers) to minimize the total cost in the chemical industry [28]. e proposed algorithms are tried on the PSPLIB dataset [29] not fully suitable for scheduling problems because of no cost parameter objectives. Moreover, the authors cannot compare their traditional algorithms with newer ones at the experimental stage but only compare them.
Also studying multiobjective problems such as Hosseinian et al., Davari-Ardakani [30] proposed a multiobjective variant of the MS-RCPSP problem to minimize the time and cost of the current project. e proposed issue is called MSPSP, which is limited to projects with the following two characteristics: (i) e timing of implementation is arbitrary; for example, the project can be done in the evenings or on weekends (ii) Energy costs are very high, comparable to wages paid to employees.
However, the authors only gave the problem model without any new solution method to solve it. ey only conducted experiments with the Max-Min method, a very traditional method.

PSO Method.
Particle Swarm Optimization (PSO) [31][32][33][34][35] is an evolutionary algorithm. Similar to other evolutionary algorithms, PSO will perform a populationbased search; initially the population is randomly initialized with a certain number of individuals. However, PSO differs from other evolutionary algorithms in that each individual in the population is determined by two basic parameters, the position vector (representing the individual's experience over generations) and the velocity vector (representing the population's experience over generations). Each individual will move in the solution space at a particular velocity. After each generation, the individuals will move towards the best position of the individual in the past and the best position of the population and after each generation, the instances will move towards better search regions in the search space. In the process of finding individuals, the displacement vector and the position vector will be updated according to the best value of that individual in the past and the best position of the population according to the following formula.
An effective algorithm suggested by Kennedy and Eberhart [32] in 1995 in the evaluation optimization method is PSO (Particle Swarm Optimization). In the PSO, each particle in each generation is evaluated from two values containing position and velocity where the position is calculated as follows: where i are velocity of particle i at generation k and k + 1.
i are position of the particle i at generation k and k + 1. (iii) ω is inertia weight; c 1 , c 2 are speedup coefficients. (iv) rand 1 , rand 2 are the values between 0 and 1 randomly generated. (v) pbest i is the best position of particle i. (vi) gbest: the best particle position in a population.

Problem Definitions
e MS-RCPSP [7,8,12,14] is a subproblem of RCPSP (Resource-Constrained Project Scheduling Problem) that added the skill domain to the renewable resources. e objective of this problem is to find the minimum makespan, i.e., the minimum time to complete the full project. In the running time, each task requires a particular skill, where skill level is equal to or greater than the task's requirement.
To define formulations of the MS-RCPSP, we need a notation system presented in Table 2.
Using the notations presented in Table 2, we can construct the mathematical model for the MS-RCPSP as follows.
subject to where we have the following: (i) Constraint (3): a resource must have one or more skills. (ii) Constraints (4) and (5): the duration of any task must be equal to or greater than zero (in fact, any real task's duration is a positive number; only two dummy tasks have the duration equal to 0, which shows the start and finish time of the project). (iii) Constraint (6): the parent task (task i) must be finished before the child task (task j) starts. When task i ends are denoted E i , the time when subtask j starts is E j − t j . (iv) Constraint (7): any task i ∈ W k , having skill S ∈ S k satisfied to g S � g S i shows that the skill of r is the save with skill of L i . h S q ≥ h r i : skill level of using the resource is equal to or greater than the task's requirement. (v) Constraint (8): at any time, each resource can execute only one task. To check the availability of the resource, we use the expression n i�1 A q i,k ; if it results in 0 value, the k resource cannot be assigned to do any task, else k is used. (vi) Constraint (9): each task is executed by only one resource.
In the MS-RCPSP problem, the resource must meet the skill type and skill level to perform a task. Accordingly, a Hosseinian [4], [5], [6], [7] GA, PSO ProGen, iMOPSE 4 2019 H. Davari-Ardakani [21] Min-Max iMOPSE resource can commit the task if its skill is the same as the task's required, and the skill level must be equal to or greater than the tasks needed. e resource-to-task assignment can be presented as a matrix illustrated in Figure 1.
In Figure 1, S i.j denotes S i skill type and it has j skill level. Tasks that require execution resources must meet a specific skill type and skill level. e feasible resource should have the same skill type and skill level greater than or equal to the required skill level. Example 1. Figure 1 presents a project with four tasks and four renewable resources. e resources have skill types from S 1 to S 2 , and each of them can have a skill level from 1 to 3. According to MS-RCPSP constraint, to do task W 1 , the resource must meet the task's requirement that means the resource has to have skill type S 2 and skill level equal to or greater than 2. Looking into the resource list, we determine that resource L 1 has skill type S 2 and skill level is 2, so L 1 can be allocated to execute W 1 .

Schedule Representation.
In the scheduling algorithm, a schedule is represented as a vector and the vector's item number is equal to the task number of the project. e value of each item shows the resource index to perform it. e corresponding resource has to meet the requirement constraint of the task.  e priority graph of the tasks is shown in Figure 2. e duration of tasks (in hours) is shown in Table 3. Figure 3 shows the assigning of resources to execute tasks of the project. e resource to perform the task needs to meet the priority constraints of the problem containing the skill requirements and skill level.    Can be assigned Can not be assigned Tasks Resources Figure 1: e relation matrix of resources-tasks assignment.

Applied Computational Intelligence and Soft Computing
A vector can present the schedule shown in Figure 3 as Table 4. Table 4 presents the task-resource assignment of the project, where the resource L 1 performs tasks: W 1 , W 4 , W 5 , W, W 7 , W 10 ; the resource L 2 is assigned to execute tasks: W 2 , W 3 , W 8 , W 9 .

Migration Method.
To find a feasible solution with the minimum makespan for the MS-RCPSP problem, we study the Migration method combined with the PSO [32][33][34]; the new algorithm is named M-PSO.

Migration Method.
e PSO algorithm tends to fall into the local extreme when performing evolution. e Migration method moves the population from the local extreme to new space while expanding the search space.

Definition 1.
A population is said to be not successfully evaluated if the makespan of the population is still fixed between two continuous generations. e Migration method runs over steps as follows: Step 1: detecting the local extremes: To detect local extremes, we use a variable n f to count the number of times the population has failed to evolve consecutively; if this value is greater than a specified threshold (n max ), then the population has fallen into the local extreme. Equation (10) shows how to evaluate n f .
Step 2: moving the population to a new space: To move the population staying local extreme to new space, we continue with some next steps: (i) Consider each particle of the population. (ii) For each task i of the particle, find the set L i of resources that can perform task i, sorting the resources in L i by the index of each resource.
(iii) Replace the current resource used to do i task by resource staying at the opposite position in L i sorted. Equation (11) represents this step. Figure 4 illustrates the Migration method by changing execution resources. Specifically, the task being performed by resource L 2 will be assigned to L m − 1 and the task being performed by resource L m will be allocated to L 1 .
e new assigning resource-to-task has to ensure the problem's constraints. After all the particles of the population are moved, we will get a new population that is migrated to a new space, which means the population is escaping to the local extreme.
e Migration pseudocode is implemented as follows (Algorithm 1):

e M-PSO Algorithm.
e M-PSO algorithm is improved from the PSO algorithm integrated with the Migration method to improve the efficiency of results. e detail of M-PSO is described in Algorithm 2 as follows: Lines 21 to 25 show the way to find out the local extreme. Lines 31 to 34 check the threshold and call Migration function to move the population to a new space, making the population escape the current local extremum area and expand finding space.

Experiment
To estimate the efficiency of our proposed method, we developed the simulator on the Matlab environment conducted on the benchmark iMOPSE dataset. e test results are compared with GA-M [9] and GRASP [9,23], showing that M-PSO has a positive effect.

e Benchmark Dataset.
In the simulated program, we use the iMOPSE [9] installers to investigate many existing algorithms as GRASP, GA-M, etc. e iMOPSE dataset has the following characteristics:      For j � 1 to n (5) L i ← the subset of resource can be performed the task L i (6) L i ← Sort(L i ) (7) idx ← index of resource executed the task i End for // j (11) End Function ALGORITHM 1: Migration.
Input: n max: the threshold to find local extremal, t max: number of evolution generations. Output: the best solution g best (1) Begin (2) P all ← Init data from iMOPSE dataset and create population.
(ii) Data: 30 iMOPSE installers that are shown in Table 5. (iii) Number of particles in the population N p : 100. (iv) Number of evolutionary generations N g : 50,000.
(v) Number of executing times for a data install: 35.
All result data contains average, standard deviation, and best values.

Experiment Results.
e results of the M-PSO are presented in Table 6; this table also shows the values of GA-M and GRASP algorithms published together with the iMOPSE dataset.
In Table 6 Comparing the M-PSO with GRASP, we have the following: (i) e results of M-PSO have better results than GRASP in most cases, specifically better than GRASP 27/30 instances (from 0.6% to 15.8%) with the BEST value and 27/30 instances data with AVG value (from 0% to 16.9%).
e M-PSO can detect local extremes and escape them using the Migration technique, achieving higher efficiency than other comparison algorithms. e experiment results also show that the more the tasks in the project are, the more the M-PSO becomes satisfactory. e superiority of M-PSO      100_5_22_15  100_5_46_15  100_5_64_15  100_5_64_9  100_10_64_9  100_10_65_15  100_20_22_15  100_20_46_15  100_20_47_9  100_20_65_15  100_20_65_9  100_10_26_15 100_10_47_9 100_10_48_15 100_5_48_9

Conclusion and Future Work
In this paper, we have presented the MS-RCPSP problem, a combinatorial optimization problem with many scientific and practical applications. It has described the mathematical model of the problem and proposes a new algorithm to find a feasible solution for the MS-RCPSP problem. e proposed algorithm is M-PSO, which is improved from the PSO algorithm combined with the migration method to escape the local extremes and expand the searching space. e conduction evaluated the effectiveness of our proposed algorithm on the iMOPSE dataset (standard dataset used for MS-RCPSP problem). All experiment results were collected and compared with other algorithms such as GA-M and GRASP. Experimental results show that M-PSO's results are better than previous algorithms, specifically better than GA-M from 6.2% to 32.97% and GRASP from 0.6% to 15.8%.
In the future, the authors will continue to research and improve the algorithm based on other approximation methods, using random moves based on Gauss, Cauchy, etc. to improve the suggested effectiveness of the algorithm.
Data Availability e paper uses the standard iMOPSE dataset to test the efficiency of the algorithm. is dataset is publicly available at https://imopse.ii.pwr.wroc.pl/ and is free of charge.

Conflicts of Interest
e authors declare that they have no conflicts of interest.