Intelligent Differential Evolution Scheme for Network Resources in IoT

Scheduling is a fundamental factor in managing the network resource of the Internet of things. For IoT systems such as production lines, to operate effectively, it is necessary to find an intelligent management scheme, i.e., schedule, for network resources. In this study, we focus on multiskill resource-constrained project scheduling problem (MS-RCPSP), a combinational optimization problem that has received extensive attention from the research community due to its advantages in network resource management. In recent years, many approaches have been utilized for solving this problem such as genetic algorithm and ant colony optimization. Although these approaches introduce various optimization techniques, premature convergence issue also occurs. Moreover, previous studies have only been verified on simulation data but not on real data of factories. This paper formulated the MS-RCPSP and then proposed a novel algorithm called DEM to solve it. The proposed algorithm was developed based on the differential evolution metaheuristic. Besides, we build the reallocate function to improve the solution quality so that the proposed algorithm converges rapidly to global extremum while also avoiding getting trapped in a local extremum. To evaluate the performance of the proposed algorithm, we conduct the experiment on iMOPSE, the simulated dataset used by previous authors in their research studies. In addition, DEM was verified on real dataset supported by a famous textile industry factory. Experimental results on both simulated data and real data show that the proposed algorithm not only finds a better schedule compared with related works but also can reduce the processing time of the production line currently used at the textile industry factory.


Introduction
Internet of things systems include not only sensors and automated machines like robots but also intelligent control and management algorithms [1]. Intelligent algorithms for managing network resource play a key role in controlling the operation of automated machines such as robots, enabling them to devote their full capacity to serve users.
Multiskill resource-constrained project scheduling problem (MS-RCPSP), a combinational optimization problem, has received extensive attention from the research community in recent years due to its advantages in network resources management and scheduling for Internet of things system. e main purpose of the MS-RCPSP is to find the way for assigning tasks to resources so that the execution time is minimal.
In recent years, MS-RCPSP is widely used, and this problem is found not only in critical civilian fields but also in the military setting. MS-RCPSP appears on a broad scale of military operations such as planning an onboard mission or routing an unmanned aerial vehicle (UAV) [2,3]. e rest of the paper is organized as follows. In Section 2, we present some related works such as previous approaches to solving the MS-RCPSP. Specifically, the summary of the differential evolution method is included in this section. Differential evolution is a well-known evolutionary algorithm that has been applied effectively to solve NP-hard problems. In this paper, the proposed algorithm is inspired by the differential evolution method. In Section 3, we present the system model and the statement of MS-RCPSP. e formulation of MS-RCPSP is introduced in this section. Section 4 describes the proposed algorithm, which is built on differential evolution strategy [4]. In this section, we focus on presenting the reallocate function, which is the key component that creates the strength of the proposed algorithm. Besides, this section introduces our design for schedule representation and a new measurement model for measuring the difference between two schedules. e proposed algorithm (DEM) is also introduced in this section. Simulation results examining the proposed algorithms along with computational and comparative results are given and analyzed in Section 5. Simulations conducted by using the iMOPSE dataset [5] are presented in this section. In addition, this section describes experiments conducted on the factory's dataset collected from TNG, a well-known national textile company. Finally, Section 6 concludes the paper and outlines some directions for future work.

Approximation Algorithms for MS-RCPSP.
Scheduling problem arises in many practical situations [6][7][8][9][10][11]. In the general case, the scheduling is proved to be NP-hard. e authors of [5,12,13] show that MS-RCPSP, the problem we mentioned in this paper, is an NP-hard scheduling problem. In addition, MS-RCPSP is multimodal or discontinuous and very challenging to solve with traditional optimization methods. In the past few years, various approaches have been proposed to solve MS-RCPSP, thereby finding out intelligent algorithms to allocate and manage network resources in the Internet of things systems [14][15][16][17]. Some popular metaheuristic algorithms are the genetic algorithm (GA), ant colony optimization (ACO), and particle swarm optimization [18][19][20][21][22].
Su et al. [23] used a mixed-integer model and discrete constraints to solve the problems. Maghsoudlou et al. [24] and Bibiks et al. [25] applied the cuckoo Search algorithm to plan for the multirisk project with three distinct evaluation objectives. Lin et al. [26] proposed a new solution based on GA and some other heuristic algorithms.
Myszkowski et al. [5,13] proposed the hybrid algorithm which is the combination of the differential evolution strategy and the greedy approach for arranging the human resources in product manufacturing projects and calculating time-of-use electricity tariffs and shift differential payments.
e authors aimed to achieve the shortest makespan and low cost and gave a new benchmark dataset called iMOPSE [5], an artificially created dataset based on real-world instances for the MS-RCPSP. e MS-RCPSP is studied and applied in the planning of many practical areas of the Internet of things. Some authors also study new variants of the MS-RCPSP and apply them in different fields. Mejia [3] developed a new variant of the MS-RCPSP to coordinate research activities in the nuclear laboratory. Hosseinian [27] proposed two new algorithms, P-GWO and MOFA, to solve the MS-RCPSP with the deterioration effect and financial constraints (a case study of a gas treating company). In another study, Hosseinian et al. introduced a new mixed-integer formulation for the timedependent MS-RCPSP considering the learning effect [28].
Nemati-Lafmejani et al. [29] developed an integrated biobjective optimization model to deal with multimode RCPSP. e objective of the proposed model is to minimize both the costs and the makespan of the project. Tahrir and Yang [30] proposed a hybrid metaheuristic algorithm that combined ant colony optimization and variable neighbourhood search approaches for job scheduling in grid computing.
Several prior research has also been conducted to solve other subproblems of RCPSP, the general problem of MS-RCPSP, to improve the efficiency of network resource management in specific fields of the Internet of things. Ballestin and Leus [31] and Javanmard [32] and their colleagues studied specific cases of RCPSPs such as multiskill stochastic and preemptive problem to calculate project implementation time, i.e., makespan, and build mathematical models for the project resource investment.

Differential Evolution
Method. Differential evolution (DE) is a population-based stochastic optimization algorithm introduced by Storn and Price [4]. e advantages of DE lies in its simplicity, efficiency, and speed thanks to the local search method. DE deals with the old generation of the original population by using the mutation operator to create better solutions in the new generation. Until now, DE is clearly recognized to be the approach that has the potential to solve NP-hard [4,33] problems.
Tanabe et al. and Ghosh and Das [34,35] proposed a DE-based method for scheduling problems in grid computing environment whose purpose is to minimize the execution time and add more parameter adjustment to get high effects.
Like other evolutionary approaches, DE performs the evolution of a population by using three kinds of the operator: crossover (recombination), mutation, and selection. e major difference between DE and genetic algorithm, a classical evolutionary algorithm, is due to the mutation operator. DE's mutation operator uses orientation information to change solutions of the current population as follows.
Given the population that is composed of solutions, each of them consists of D components, and thus a particular solution is represented by a vector To create the mutated solution v i of a given solution x i , DE picks out three random different solutions from the current population: x r1 ≠ x r2 ≠ x r3 ≠ x i , and then the mutation solution v i is determined as follows: where the value of the constant F, which plays the role of the mutant factor, is in the range [0, 1]. Because the mutant factor F is used to adjust the size of the directional vector, it is also called the directional hop length. After executing the mutation step, the crossover operation is carried out by combining the parent solution x i and the mutation solution v i . e crossover operator is performed by selecting a random number CR (CR ∈ [0, 1]) as the probability of crossover. e result of the crossover step is represented by the vector (u 1,1 , u 1,2 , ... (ii) rand i,j : mutant factor. (iii) I rand : a random number varies within the range [1,D]. anks to I rand , the mutation solution v i is always different from the parent solution x i .
Finally, the next generation is created from the x i and the u i as follows: Since 1997, various versions of DE have been developed by researchers.
is paper proposes a variant of the DE algorithm which uses the following terminologies and conventions: (i) A solution represents a schedule, that is, a plan for performing given tasks (ii) e number of search space's dimensions is equal to the number of tasks

RCPSP. MS-RCPSP is just a special case of RCPSP.
Before the outline of the multiskill RCPSP, the description of the classical RCPSP would be introduced as follows.
(i) Assume a given project represented by a directed noncyclical graph G (V, E), where each node depicts a task and the arc represents finish-to-start precedence relationship between two tasks. e arc (u, v) ∈ E shows that the task u must be completed before task vbegins ( Figure 1). (ii) Without any difference, two empty tasks were added to the project. e first one is placed at the beginning of the project as the predecessor of every other task, whereas the second empty task is placed at the end of the process as the successor of other tasks. (iii) e duration (also called execution time) of a certain task is calculated from the beginning time to the ending time of that task.
(iv) e execution progress of every task cannot be stopped until it is done. (v) Each task needs an amount of resources for its execution.
e goal of the RCPSP is to find out a schedule of the task such that the precedence and resource constraints are satisfied and the makespan is minimized. RCPSP has been proved to be NP-hard [12]. roughout the paper, we use the term "makespan" to refer to the execution time of the project, also called project duration. In the process of looking for the optimal schedule, both priority constraint between operations and resource constraint have to be met.

MS-RCPSP Formulation.
In this paper, MS-RCPSP [5,13,36] was chosen because it is more practical than its general problem, RCPSP. MS-RCPSP uses the additional attribute, skill, in the problem formulation. Each task requires particular skills at the given levels to be executed, whereas each resource has some skills with given levels.
us, the resource A is capable of performing the task B if A has skills required by B at the identical or higher level.
Before deepening the study of MS-RCPSP, we take a look at some notations as follows: (i) d j : the duration of task j; P j : subset of the predecessors of task j (ii) q j : subset of skills required by task j (iii) Q k : the subset of skills owned by the resource k (iv) Q: the set of skills, Q k ⊆ Q (v) RS: the set of resources (vi) T: the set of tasks (vii) T k : the set of tasks that resource k can perform, T k ⊆ T (viii) RS k : the set of resources that can perform task k, RS k ⊆ RS (ix) S j , F j : start time and finish time of task j (x) U j,k t : U j,k t � 1 in case of resource k is assigned to task j at given time t; U j,k t � 0 in other cases (xi) l q : the level of the given skill q; h q : type of the skill q (xii) q j : the skill required by task j (xiii) τ: duration of a schedule Formally, MS-RCPSP could be stated as follows: where ∀k ∈ RS, ∀t ∈ τ:

Schedule Representation.
In this study, every schedule or solution is represented by a vector that consists of elements; the number of elements (size of the vector) and the number of tasks are the same. e value of a certain element depicts the resource that can execute the corresponding task.  Figure 1, whereby task 1 is the predecessor of task 2, and thus task 2 cannot be performed until task 1 is finished: S 2 ≥ F 1 . ere is no relation between task 3 and task 4; therefore, they are executed concurrently or sequentially.
Besides, in this example, we assume that e duration of the tasks is given in Table 1.
A feasible schedule for the project is demonstrated in Figure 2, where it can be seen that the makespan is 15. e above schedule is demonstrated in Table 2, where resource 1 performed tasks number 1, 2, 6, 8, and 9; resource 2 is assigned to execute tasks number 3 and 7; resource 3 deals with the remaining tasks.

Measurement Model.
e differential evolution algorithm was primarily designed for real-valued data. However, like most of the other scheduling problems, MS-RCPSP deals with discrete values, and thus there is a need for the discrete variant of DE. In addition, this discrete DE algorithm needs a model for representing the MS-RCPSP's factors such as the difference between two schedules. In this paper, we build a new measurement model for measuring the difference between the two schedules as follows: order (x i ): the position of the resource (x i ) in the RS i (iii) e sum of the schedule Y and differential vector D is the schedule X � (x 1 , x 2 , ..., x n ) where  Table 3.

Proposed DEM Algorithm.
e proposed algorithm (differential evolution multiskill, or DEM) is described in Algorithm 1: R b : According to the arrangement of schedule newbest (line 3), R b is the last resource that finishes its job. In Figure 3, before the reallocate function was called, R b is resource 1. maxResource(): the function which returns the last resource to finish (line 3). size(): the function which returns the number of elements of the given set or array (line 5). newmakespan: makespan of the new schedule (line 11), which is obtained from the old schedule by reassigning task i. e task i is moved from resource R b (line 9) to resource R i [j] (line 10).

Function
Reallocate. Line 12 and 13 demonstrate that the new schedule (newbest) is better than the old schedule (cur-rentBest) in terms of makespan, which means that the function Reallocate certainly returns a better schedule. Moreover, the function Reallocate guides DEM algorithm in the right direction by finding a new schedule (newbest) based on the best solution (currentBest); therefore, it inherits the advanced genomes of the population as well as the old schedule.  Figure 1, and the duration of the tasks is given in Table 1.
Consider a schedule (PS) as shown in Table 6. From observation, Figure 4 shows that makespan f(PS) � 17.
New schedule, the result of the function Reallocate, is described in Table 7. Figure 4 illustrates that function Reallocate converts the schedule PS into the new schedule by assigning task 9 to resource 2 instead of resource 1 as before. anks to this allocation, the new schedule achieves better makespan (15) compared to the old schedule (17).

Experiment
Experiments were conducted on the simulated dataset and the real dataset to evaluate the performance of proposed algorithms in comparison with previous algorithms such as GreedyDO and GA. We first utilize the simulated iMOPSE dataset, a collection of project instances that are artificially created based on a database obtained from the international company, to evaluate the performance of the proposed algorithm.

iMOPSE Dataset.
e simulated dataset iMOPSE [5] has been used to investigate existing algorithms GreedyDO and GA [13,36]; therefore, we conduct simulations on iMOPSE dataset to fairly compare between DEM and those algorithms.
Input: currentBest //the best schedule among the current population Output: //the improved schedule (1) Begin (2) makespan � f(best) (3) newbest � currentBest; (4) R b ⟵ maxResource (newbest) //the last resource to finish its job (5) Tb ⟵ set of tasks is performed by resource Rb (6) For i � 1 to size(Tb) // Consider each task in T b , the set of tasks performed by resource R b (7) T R i ⟵ set of resource that are skilled enough to execute the task i except R b (9) For j � 1 to size (R i ) // Consider each resource in turn (10) (12) newmakespan � f(newbest) // e makespan of the new schedule (13) If newmakespan < makespan (14) makespan � newmakespan (15) Return newbest; // Successful Reallocate, return the new and better schedule (16) End if (17) newbest � currentBest; // Unsuccessful Reallocate, reuse the original schedule for the next iteration (18) End for (19) End for (20) Return best (21) End Function ALGORITHM 2: Function reallocate. 6 Scientific Programming (i) e number of tasks and resources (ii) e number of precedence relations between tasks (iii) e number of skills All simulations were run on a PC with Intel Core i5-CPU 2.2 GHz, 6 GB RAM, and operating system Windows 10. All of iMOPSE instances used by our simulations are listed in Table 8.

Parameters and System Settings.
e simulation is conducted by using the following: (i) Simulation environment: Matlab ver. 2014 (ii) Simulation tool: the performance of previous algorithms such as GA is fairly evaluated by using GARunner [13]; the simulation tool was provided by the author of those algorithms (iii) Input data: 15 iMOPSE instances that are described in  Tables 9 and 10, where the makespan of the best solutions found by GreedyDO, GA, and the proposed algorithm (DEM) is illustrated (in hours). Table 9 shows that the makespans acquired by GA are always better than those acquired by GreedyDO. Table 10 illustrates the average value, the best value, and the standard deviation of the makespan found by GA and the proposed DEM algorithm.
From the observation, the result in Tables 9 and 10 shows that (i) e solutions found by DEM are better than Greedy from 16% to 78% and GA from 0% to 21%. (ii) Regarding the average value (Table 9): DEM is better than Greedy from 15% to 77.5% and GA from 0.7% to 20.8%. (iii) Inspired by the differential evolution strategy, the proposed algorithm uses two parameters to guide the generation of the solution generated in the next generation: (i) the experience vector of both the population and (ii) the experience vector of the solution across different generations. DEM not only inherits those advantages of differential evolution approach but also utilizes the function reallocate, which improves its performance. erefore, DEM has faster convergence and greater stability, which is shown by the standard deviation in Table 9 (column Std). e total standard deviation of DEM is 19.5 while the value of GA is 55.7; this result proves that the stability of DEM algorithm is better than GA. (iv) In addition, the use of a scale to represent solutions helps DEM calculate the deviations between solutions more accurately and create better solutions in the next generations.    Task  1  2  3  4  5  6  7  8  9  10  Resource  1  1  2  3  3  1  2  1  3  3   Scientific Programming  7 known national textile company. TNG dataset instances have the following characteristics and parameters:

Simulation on Real
(i) e company has product sewing contracts under the business partners' contracts; each order places a sample of a product in large quantities (ii) Each product has a certain number of stages, each of which requires a certain time to complete (iii) Each order will be assigned to a group of workers (iv) Each group consists of many workers (v) Each worker's skills are rated based on his rank e above parameters of the dataset have been converted to a suitable format as shown in Table 11. Table 11 demonstrates that the TNG dataset parameters will be represented as follows: (i) e order from the business partners' is represented by a project (ii) e stage of the product is represented by a task (iii) A worker in the factory is represented by a resource in the problem formulation (iv) e worker grade is represented by the skill level of the resource (v) e order in which the tasks are executed is represented by the priority of the tasks (vi) Order execution time is represented by the total time of project implementation, i.e., the makespan After the conversion, the dataset is shown in Table 12 5.2.2. Parameters and System Settings. Experiment setting: (i) Input data: 8 instances that are listed in Table 12 (ii) Number of the solution in the population N p : 100 (iii) Number of generations N g : 50,000    To prove the effectiveness of the proposed algorithm (DEM), we carry out experiments by using the real-world dataset collected from the TNG company. DEM will be compared with other algorithms from previous research studies, GreedyDO and GA. e performance of these algorithms is recorded and observed by using GARunner, the tool created by Myszkowski et al. [13]. Table 13 contains the makespan (measured in hours) of the best solution achieved by GreedyDO, GA, and DEM. In addition, the performing intervals of the actual projects at the TNG factory are shown in column TNG. Table 13 proves that schedules found by DEM are better than those acquired by GA and GreedyDO. Table 13 and Figure 5 also highlight that the schedules found by evolutionary algorithms are always shorter than the execution time of the actual projects at the TNG factory.
anks to the directed nature, DEM not only ensures fast convergence but also averts getting trapped in local extrema. In experiments conducted on the TNG dataset, DEM reduces the makespan from 16% to 61% compared to the current factory schedule.

Conclusion and Future Work
is paper proposes to investigate the MS-RCPSP, one of the combinatorial optimization problems that have a wide range of practical applications in science, technology, and life. e MS-RCPSP is formulated and presented as a mathematical model, and then a novel algorithm called DEM which is based on differential evolution strategy is proposed. e MS-RCPSP, which is the subject of the investigation in this paper, has significant meaning for network resource management in the Internet of things. e MS-RCPSP we study takes into account the resource's skill level, an important factor of the practical projects. Inspired by differential evolution metaheuristic, we have devised a new evolutionary algorithm that has the ability to outperform all the previous approaches. We build a function called reallocate, which is the key component that creates the strength of the proposed algorithm. is function avoids the idle time intervals in a given schedule, improving the solution quality.
To analyze the efficiency of the proposed algorithm, various simulations are conducted and compared with the previous algorithms. Besides the simulated dataset, the real dataset supported by the TNG company has also been utilized for the assessment. e simulation result shows that our developed algorithm is more effective than existing algorithms. DEM achieves not only better quality solution but also faster convergence to global extremum in comparison with the prior algorithms.
In the next steps, we are planning to improve DEM algorithm by using a blended random walk and the Gauss statistical function. We will implement local search operations to further improve the quality of the solutions. At the same time, we will integrate the Gaussian probability distribution to improve the search direction modification in the solution space. anks to that improvement, we expect that the proposed algorithm will not fall into the local extreme trap.
In the future, we will utilize the DE metaheuristic with the integration of the Gauss distribution and Gauss statistical function [38,39] to improve the effectiveness of the searching for the optimum solution and avoid the local extreme trap .   TNG1  TNG2  TNG3  TNG4  TNG5  TNG6  TNG7  TNG8   1200 GreedyDO  GA  DEM  TNG1  409  236  201  165  TNG2  325  243  198  166  TNG3  296  258  212  166  TNG4  392  248  176  165  TNG5  1174  972  751  712  TNG6  1052  963  791  712  TNG7  871  834  810  728  TNG8  996  906  720  675 10 Scientific Programming 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, we also tested the algorithm with TNG's garment manufacturing dataset. We have obtained permission from TNG to use these data.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.