Effective Evolutionary Algorithm for Solving the Real-Resource-Constrained Scheduling Problem

This paper deﬁnes and introduces the formulation of the Real-RCPSP (Real-Resource-Constrained Project Scheduling Problem), a new variant of the MS-RCPSP (Multiskill Resource-Constrained Project Scheduling Problem). Real-RCPSP is an optimization problem that has been attracting widespread interest from the research community in recent years. Real-RCPSP has become a critical issue in many ﬁelds such as resource allocation to perform tasks in Edge Computing or arranging robots at industrial production lines at factories and IoT systems. Compared to the MS-RCPSP, the Real-RCPSP is supplemented with assumptions about the execution time of the task, so it is more realistic. The previous algorithms for solving the MS-RCPSP have only been veriﬁed on simulation data, so their results are not completely convincing. In addition, those algorithms are designed only to solve the MS-RCPSP, so they are not completely suitable for solving the new Real-RCPSP. Inspired by the Cuckoo Search approach, this literature proposes an evolutionary algorithm that uses the function Reallocate for fast convergence to the global extremum. In order to verify the proposed algorithm, the experiments were conducted on two datasets: (i) the iMOPSE simulation dataset that previous studies had used and (ii) the actual TNG dataset collected from the textile company TNG. Experimental results on the iMOPSE simulation dataset show that the proposed algorithm achieves better solution quality than the existing algorithms, while the experimental results on the TNG dataset have proved that the proposed algorithm decreases the execution time of current production lines at the TNG company.


Introduction
Scheduling is used to arrange the resources and tasks in many fields, where scheduling algorithms can have an important impact on the effectiveness and cost. In a logistic system, not only are cargo vehicles characterized by the factors of speed and carrying capacity, but also the skill of the driver is the most important factor in determining the quality of transportation. By taking into account all the factors, especially the driver's skill one, scheduling algorithms help manage and coordinate the transport system. An intelligent scheduling algorithm helps managers exploit the maximum potential of resources including vehicle and driver to get the project done.
In the wireless sensor networks, the node scheduling aims at selecting a set of nodes (i.e., sensors) that provide the data service.
is scheduling can effectively reduce the number of nodes and messages and at the same time extend the network lifetime [1][2][3]. e basic goal of Edge Computing [4] is finding the optimal scheduling for extending the Cloud's resources such as servers and routers from remote data centers to the edge of the Cloud where they are closer to users, thus overcoming the bottlenecks issue by cloud computing and providing higher performance.
Solving the MS-RCPSP [5][6][7] problem is to find out the schedule to execute the project in the shortest possible time without breaking any constraints. In other words, the scheduling algorithm's goal is to find a schedule with the smallest execution time while meeting any task and resource constraints. In this paper, the term "makespan" will be used to refer to the distance in time that elapses from the start of work to the end of execution time. MS-RCPSP is among the most commonly investigated optimization problems that have received a lot of attention due to their significant role in network resource scheduling and controlling.
MS-RCPSP appears in many practical situations such as logistics and cargo transportation, widely applied to military operations such as sorting missions and determining travel routes [8]. Hosseinian and Baradaran [9] used an evaluation method to make plan decisions with MS-RCPSP. Nazafzad et al. [10] employed a biobjective optimization model for the MS-RCPSP considering shift differential payments and time-of-use electricity tariffs. eir study tried to minimize the cost and the makespan of a given project. Younis and Yang [11] propose the heuristic algorithm to solve a particular case of the MS-RCPSP occurring in grid computing.
However, the MS-RCPSP has one serious defect. What often happens in practice is that a resource with a higher skill level has a shorter processing time. is paper presents a new problem, which is a more practical extension of the MS-RCPSP, called the Real-RCPSP. In other words, Real-RCPSP is a specific case of the MS-RCPSP. In the Real-RCPSP, the processing time depends on the skill level of the resource. e real-life nature of Real-RCPSP comes from production lines at the industry factory, where the higher the skill level of a worker is, the faster he can make the product.
is paper is organized as follows. e next section presents some previous algorithms for solving the Resource-Constrained Scheduling Problem. is section also briefly introduces the Cuckoo Search strategy [12], one of the most widely used metaheuristics. Section 3 formulates the Real-RCPSP. e proposed algorithm (called R-CSM) is described in the fourth section. Section 4 introduces the most important components of R-CSM, consisting of the function Reallocate, the schedule representation, and a novel schedule measurement model. To verify the performance of the proposed algorithm, in Section 5 and Section 6, we arrange the experiments on the iMOPSE dataset and TNG's dataset, respectively. In these two sections, the experimental results are analyzed to compare the performance of the proposed algorithm R-CSM with the best previous algorithms such as GreedyDO and GA. Finally, Section 7 ends the paper with the conclusion and future works.

Related Works
Despite the importance of the Real-RCPSP, no one to the best of our knowledge has studied this problem. is paper is the first work that mentions Real-RCPSP; thus this section introduces the existing algorithms to solve another problem that is close to the Real-RCPSP, namely, MS-RCPSP. In Section 5 and Section 6, these algorithms will be used as reference algorithms in our experiments.
Myszkowski et al. [6] proved that MS-RCPSP is an NPhard problem, so it is difficult to deal with classical optimization methods. Until now, many different solutions have been introduced for solving the MS-RCPSP; among them, the most successful metaheuristics are the GA [13] and ACO [14].
In their research, Maghsoudlou et al. [15] and Bibiks et al. [16] applied the Cuckoo Search algorithm to build multirisk project implementation schedules based on three different evaluation objectives. Zhu et al. [17] proposed an evolutionary algorithm based on the multiverse and several other heuristic algorithms.
Myszkowski et al. [6] have built a hybrid algorithm that combined the Difference Evolution and greedy heuristic for managing human and machine resources in factory production projects. e proposed hybrid algorithm tried to minimize makespan and production costs. Besides, iMOPSE [6], a dataset that was generated based on real-world data from the project scheduling problem, was introduced.
As a specific case of the MS-RCPCP problem, Real-RCPSP is researched and applied in many fields of the Internet of ings. Hosseinian and Baradaran [18] proposed a greedy heuristic for maximizing the modularity to find high-quality communities of employees and to arrange them to the tasks based on the founded communities. Younis and Yang [11] introduced a hybrid scheduling algorithm for task arrangement in grid computing environment.
Some other researchers have also studied the new extension problems of the Constrained Project Scheduling Problem and applied them in many fields of science and finance. Polo-Mejia et al. [19] developed a scheduling algorithm to manage nuclear laboratory operations. To solve the problem of the dense sensors in wireless sensor networks, Wan et al. [20] proposed an energy-saving scheduling algorithm, which arranges some redundant sensors into the sleep mode to reduce the data transmission collision and energy dissipation. Guo et al. [21] developed a PSO-based algorithm that acquired better performance than previous approaches in power efficiency. Cheng et al. [22] have formulated another PSO-based algorithm named DPSO-CA, which is based on the discrete PSO that aims at minimizing the cochannel interference in the network.
Previous studies have also been performed to address other subissues of the Constrained Project Scheduling Problem. Barrios et al. [23] and Javanmard et al. [24] studied the Multiskill Stochastic and Preemptive Scheduling Problem to minimize the execution time and proposed the mathematical models for the project's resource investment.
Cuckoo Search (CS) algorithm is a metaheuristic introduced by Yang [25] based on the cuckoo bird behavior. Previous algorithms such as Difference Evolution (DE) [26] and Particle Swarm Optimization (PSO) [21] have been proven to be special cases of the Cuckoo Search algorithm. e efficiency of CS has also been shown to be better than those of DE and PSO in some cases [27]. For the above reasons, in this paper, we have built an algorithm inspired by CS.

Problem Statement
e Real-RCPSP can be described as follows. A project represented by a graph G(V, E) has to be realized. Each node of graph G represents a task, while G's arc represents the relationship between 2 tasks ( Figure 1). Specifically, the arc(i, j) means that task i has to be finished by the time when task j is started. Each task has an execution time (or duration) that is calculated by subtracting the start time from the end time. e task must be performed continuously from start to finish and must not be stopped at all. e execution of each task requires some specific resources. Each resource can perform only one task at a time. e task's execution requires several skills, while each resource possesses its own skills; thus not every resource can perform a given task. e objective of the Real-RCPSP is to shorten the project implementation time to the smallest value while not breaking any constraints. A schedule must be found in which execution will minimize execution time while still meeting the task and resource constraints. As mentioned above, the MS-RCPSP is proved to be NP-hard [5][6][7], and no polynomial-time algorithm exists, assuming that P ≠ NP.
Real-RCPSP could be stated by using the following notations: (i) C i : the set of the parents of task i (ii) r i : the set of skills required by task i. A certain resource must have an equal or higher skill level of r j to perform task j (iii) S: the set of all skills; S i : the set of skills belonging to resource i; S i ⊆S (iv) t jk : the time it takes the resource that possesses subset of skill S k to complete task j (v) L: the set of resources; L k : the set of resources that could handle task k; L k ⊆L (vi) L i : resource i (vii) W: the set of tasks; W k : the set of tasks that could be performed by resource k, W k ⊆W (viii) W i : task i (ix) B k , E k : starting time and ending time of task k (x) A i u,v : a Boolean variable; when it equals 1 it means that task u will be executed by resource v at time I; it equals 0 in other cases (xi) h i : the level of skill i; g i : type of skill i (xii) r k : a resource must possess skill r k to perform task k (xiii) m: the period time of the schedule (xiv) P: a candidate schedule; P all : the set of candidate schedules (xv) f(P): makespan (execution time) of schedule P (xvi) y: number of tasks; z: number of resources Real-RCPSP could be defined as follows: where subject to ∀k ∈ L, ∀t ∈ m: Note the following: (i) Formulation (6) forced the parent task to must be finished before the start time of the children task (ii) Formulation (7) means that, for every task, there is always at least one resource that has enough skill level to handle that task (iii) Formulation (8) ensures that each resource (k) can only perform at most one task (j) at any time (t) (iv) Constraint (9) aims to restrict each task to only be executed at most one time. Every task must be performed continuously from start to finish and must not be stopped at all. (v) Constraint (10) means that the execution time of the higher-skill resources is smaller than the execution time of the lower-skill resources

Schedule Representation.
We represent a schedule as a row that consists of several elements, and the number of elements denotes the number of tasks. Each element of the row represents the resource that will perform the respective task.  (i) S k � S, ∀k ∈ L; every resource has an equal skill set (ii) L k � L, ∀k ∈ W; any resource can perform any task (iii) e execution times of the tasks are presented in Table 1 We also assume that the constraint to prioritize the performance of the tasks is shown in Figure 1, specifically: (i) Task 1 has to be performed firstly (ii) Task 6 has to be performed after task 2 (iii) Tasks 7 and 9 have to be performed after task 3 (iv) Task 5 has to be performed after task 4 (v) Task 8 has to be performed after task 5 (vi) Task 10 has to be performed after tasks 6, 7, and 9 With the above assumptions and constraints, a possible schedule is shown in Figure 2. Table 2 shows how that schedule assigns 3 resources to perform 10 tasks in detail.

Measurement Model.
Cuckoo Search algorithm is an optimization scheme dealing with real functions such as the Gaussian probability distribution function, whereas Real-RCPSP is the optimization problem of discrete functions. erefore, in order to apply the Cuckoo Search algorithm to the Real-RCPSP, it is necessary to build a model for schedules measuring. e following will present our proposed measurement model in detail: : z i is the number of resources that possess set of skills q i . (ii) Vector K � k 1 , k 2 , . . . , k n is the distance between schedule P � p 1 , p 2 , . . . , p n and schedule Q � q 1 , q 2 , . . . , q n . is leads to K � P − Q.

Proposed Algorithm R-CSM.
e proposed Algorithm 1 R-CSM is represented as follows.
f is objective function. Note that, in line number 16, function Reallocate() improves the quality of b_plan, as analyzed in the next subsection.

Function
Reallocate. c_plan is the most appropriate feasible schedule until now. L b is the last resource to finish. Function Late() will find out the value of R b .Size() is the size of a set or an array.N_makespan is execution time of the new resource-task arrangement  Execution  time  3  2  3  4  3  4  3  6   Task Table 3: e order of resources.
Journal of Advanced Transportation Line 12 and line 13 show that the new schedule (n_plan) is always equal to or better than the old schedule (c_plan) in terms of the makespan. e function Reallocate() (Figure 3) generates the new schedule from the best schedule, so it inherits and promotes the advantages of the current population (Algorithm 2).
e results point out that function Reallocate decreases the makespan from 18 to 17, as described in Figure 4.

Simulation Settings.
To verify the performance of the R-CSM, the simulations are conducted by using iMOPSE dataset [6], which has been used by previous studies to examine algorithms such as GreedyDO and GA [28]. iMOPSE's instances have the following fields: Table 4: e assignment of schedules P and Q.
Each simulation was set up with parameters as follows: (i) Dataset: 30 iMOPSE's instances that are described above (ii) Number of individuals in population N p � 100 (iii) e program execution process consists of 50,000 generations (N g � 50, 000) (iv) Each instance was repeatedly executed 30 times

Simulation Results.
To show the efficiency of the proposed algorithm, we compare R-CSM with two existing algorithms, which are GreedyDO and GA [28]. Myszkowski did not provide the tool for GreedyDO; thus Table 9 just lists the best value of the algorithm GreedyDO that was published in the author's literature. Meanwhile algorithm GA is reprogrammed using the GARunner, the tool provided by the authors in [6,28]; thus Table 9 lists the average value, the best value, and the standard deviation value of the algorithm GA's makespan. n_plan ← b_plan; makespan ← f (b_plan)   Figure 5 demonstrated that the makespan of the R-CSM's schedules is smaller than the makespan of GreedyDO and GA. e comparison between algorithms is discussed as follows in detail: (i) Compared with the original CS, the R-CSM algorithm is equipped with function Reallocate, which makes R-CSM capable of fast convergence. is ability is clearly demonstrated by the comparison of Input: b_plan//the best feasible schedule that the algorithm has found until now Output://the feasible schedule which is better than the input (1) Begin (2) makespan � f(b_plan) (3) n_plan � b_plan;//the best resource-task assignment plan so far (4) L b ← Late(n_plan)//the resource finish its execution latest (5) W b ←set of tasks is performed by resource L b (6) For i � 1 to size(W b )//examine the set of tasks performed by resource L b (7) (12) n_makespan � f(n_plan) (13) If n_makespan < makespan (14) Makespan � n_makespan (15) Return b_best; (16) End if (17) b_plan � n_plan; (18) End for (19) End for (20) Return n_plan (21) End Function ALGORITHM 2: Function Reallocate. Table 6: Resource-task assignment of P.
Journal of Advanced Transportation 7 R-CSM with the previous most powerful algorithms. R-CSM's best value is smaller than GreedyDO from 21% to 85% and faster than GA from 6% to 33%. e average value of the R-CSM's makespan is better than the GA from 6% to 33%. (ii) anks to the function Reallocate and the proposed measurement model, the process of finding the optimal schedule of the R-CSM is not only fast but also stable. is is demonstrated by the experimental results in Table 9.
e total value of R-CSM's standard deviation is 92.52 only, whereas the total value of GA's standard deviation is equal to 180.
is result shows that the R-CSM algorithm is more stable than the GA algorithm.

Experiment with TNG Dataset
6.1. Experimental Setting. In general, the major disadvantage of verifying on simulation datasets, such as iMOPSE, is that sometimes the results do not match what is actually happening. In order to make the experiment more convincing, we have collected and used the dataset of Investment and Trading Joint Stock Company (TNG) [29]. At TNG textile factory, the dataset construction is carried out as follows: (i) e company TNG contracts with business partners, whereby each order corresponds to a product sample with a large quantity (ii) A given order will be performed by a subset of employees (iii) A product consists of several components, and each component takes an execution time (iv) e skills of each worker are evaluated based on that worker's rank Conducting experiments on a simulation dataset is always convenient because the parameters of the dataset are set by the experimenter; therefore these parameters are completely consistent with the problem formulation.
In contrast, the parameters of a real dataset are factorydefined, so they are not compatible with the conventions in the problem formulation. For this reason, before conducting experiments with TNG's dataset, the parameters of this dataset need to be converted to a format that matches the Real-RCPSP formulation.
is conversion is conducted as follows: (i) Order is demonstrated by the project (ii) Product's stage is depicted by a task (iii) An employee is depicted by a resource   Table 10. Experiment setting is as follows: (i) Dataset: 8 TNG's instances that are listed in Table 10 (ii) Number of individuals in population N p � 100 (iii) e program execution process consists of 50,000 generations (N g � 50, 000) (iv) Each instance was repeatedly executed 35 times

Experimental Results.
e experiments in this section were conducted on the TNG dataset to prove that the proposed algorithm is more efficient than existing algorithms not only when they are operating on the simulated dataset such as iMOPSE but also when operating on the actual dataset.
Experimental results (listed in Table 11) demonstrated that the proposed algorithm R-CSM is not only more efficient than previous algorithms such as GreedyDO and GA but also more efficient than the actual production plan at the TNG factory, which is presented in column TNG.
Applying the R-CSM algorithm on the data from table  Table 11 to solve the Real-RCPSP, we get the results shown in Table 12.
Experimental results in Table 12 show that, thanks to the application of the R-CSM algorithm to the actual problem with data on the textile production of TNG, the production time is reduced from 12.4% to 27%. ese results also show that the greater the difference between the skill levels of workers, the more efficient the R-CSM algorithm. Figure 6 shows the effectiveness of algorithm R-CSM when it is applied to solve the MS-RCPSP and the Real-RCPSP on the textile dataset of TNG textile company.

Conclusion
is article aims to announce and survey Real-RCPSP, a new combinatorial optimization problem that appears in many fields such as Edge Computing, industrial production, and IoT systems. e new problem is stated, and then a new algorithm named R-CSM is proposed. Inspired by the Cuckoo Search strategy, the proposed algorithm has been upgraded by using function Reallocate; thus it achieved high performance.
e experimental results show that the proposed algorithm R-CSM is better than the previous algorithms such as GreedyDO and GA at 21%-85% and 6%-33%, respectively. At the same time, the proposed algorithm converged to the optimal solution faster than previous approaches.
In the near future, we are going to continue researching on Real-RCPSP in order to improve the solution quality and the speed of the convergence. Multifactorial optimization seems to be one of the promising approaches to this problem.
Data Availability e paper uses the standard iMOPSE dataset to test the efficiency of the algorithm. is dataset is publicly available at http://imopse.ii.pwr.wroc.pl/and is free of charge. In addition, the authors also tested the algorithm with TNG's garment manufacturing dataset. ey have obtained permission from TNG to use these data.

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