# Energy-Saving Production Scheduling in a Single-Machine Manufacturing System by Improved Particle Swarm Optimization

Authors: Qingquan Jiang; Xiaoya Liao; Rui Zhang; Qiaozhen Lin
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

A single-machine scheduling problem that minimizes the total weighted tardiness with energy consumption constraints in the actual production environment is studied in this paper. Based on the properties of the problem, an improved particle swarm optimization (PSO) algorithm embedded with a local search strategy (PSO-LS) is designed to solve this problem. To evaluate the algorithm, some computational experiments are carried out using PSO-LS, basic PSO, and a genetic algorithm (GA). Before the comparison experiment, the Taguchi method is used to select appropriate parameter values for these three algorithms since heuristic algorithms rely heavily on their parameters. The experimental results show that the improved PSO-LS algorithm has considerable advantages over the basic PSO and GA, especially for large-scale problems.


---

## Body

## 1. Introduction

Manufacturing is an important industry that consumes about one-third of the world’s energy [1] and 56% of China’s energy [2]. Saving energy not only reduces production cost but also protects the environment. Achieving energy savings through low-cost production scheduling is important [3] although it is possible to replace old machines with higher-priced and energy-efficient ones.Energy-saving scheduling has received increasing attention in recent years. The literature on energy-efficient scheduling has considerably expanded since 2013 [4].Lee et al. [5] studied single-machine scheduling with energy efficiency under a policy of time-varying electricity price and solved the problem using a dynamic control approach. Módos et al. [6] studied robust single-machine scheduling to minimize release times and total tardiness with periodic energy consumption limits. They proposed an efficient algorithm to obtain the optimal robust solution of given processing orders and used it in two exact algorithms and Tabu search. Che [7] focused on biobjective optimization to minimize total energy consumption and maximum tardiness in a single-machine scheduling problem considering a power-down mechanism. The problem was built as a mixed integer linear programming (MILP) model. They developed exact and approximate algorithms for small- and large-scale problems accordingly. Che et al. [8] established a new continuous-time mixed integer programming model for an energy-sensitive single-machine scheduling problem and proposed a greedy insertion algorithm to reduce the total electricity cost of production, which provided energy-saving solution for a large-scale single-machine scheduling problem, such as 5000 jobs, in a few tens of seconds. Chen et al. [9] studied the energy consumption of production activities from the point of view of machine reliability. They examined the actual problem in a rotor production workshop. The problem was a single-machine scheduling problem that optimized delay costs and energy costs. The ant colony algorithm embedded with a modified Emmons rule was used to solve this problem. In addition, they used sensitivity analysis to discuss special cases. By determining the start time of job processing, the idle time, and the time when the machine must be shut down, Shrouf et al. [10] aimed to minimize the cost of the energy consumption in a single-machine scheduling problem in the production process, and the energy price was varied throughout a day. For large-scale problems, a genetic algorithm (GA) was used to obtain a satisfactory solution.Interval number theory was used to describe the uncertainty of renewable energy such as wind energy and solar energy [11], and two new biobjective optimization problems for interval single-machine scheduling were studied. Through parameter analysis, the authors provided decision-makers with guidelines for practical production environment. In [12], a memetic differential evolution (MDE) algorithm with superior performances to strength Pareto evolutionary algorithm II (SPEA-II) and nondominated sorting genetic algorithm II (NSGA-II) was proposed to solve an energy-saving biobjective unrelated parallel-machine scheduling problem to minimize maximum completion time and total energy consumption. The MDE algorithm was enhanced by integrating the combination of list scheduling heuristic and local search.Given the difficulty in the energy-concerned production scheduling problem, solving most of them by exact algorithms is unrealistic, especially for large-scale instances. Heuristic algorithms are popular for solving these problems [4].Particle swarm optimization (PSO) is one of the heuristic algorithms, and it has been widely used in many fields. A new bare-bones multiobjective particle swarm optimization algorithm was firstly proposed by Zhang et al. [13] in order to deal with environmental/economic multiobjective optimization problems. There were three innovations in an updating method for particles which do not need to adjust parameters, a dynamic mutation operator to improve search ability, and a global particle leader updating method based on particle diversity. The results of experiments demonstrated that the algorithm can obtain a good approximation of the Pareto front.Song et al. [14] proposed a variable-size cooperative coevolutionary particle swarm optimization algorithm (VS-CCPSO) for evolutionary feature selection (FS) methods to deal with “curse of dimensionality” on high-dimensional data. The idea of “divide and conquer” was used to cooperative coevolutionary approach, and several strategies tailored according to properties of problems were developed including a space division strategy, an adaptive adjustment mechanism of subswarm size, a particle deletion strategy, and a particle generation strategy. The experimental results illustrated that VS-CCPSO can obtain a good subset of features, which indicated that vS-CCPSO is competitive in dealing with high-dimensional FS problems.The paper by Zhang et al. [15] presented the first study of multiobjective particle swarm optimization (PSO) for cost-based feature selection in classification in order to obtain nondominated solutions. Some adjustments, including a probability-based encoding method, a hybrid operator, ideas of the crowding distance, the external archive, and the Pareto domination relationship, were embedded in PSO to improve its search capability. Experimental results illustrated that this algorithm can automatically evolve a Pareto front, and it is a competitive feature selection method to solve the cost-based feature selection problem.A fuzzy multiobjective FS method with particle swarm optimization, called PSOMOFS, was developed in the literature by Hu et al. [16], aiming at the feature selection (FS) problem with fuzzy cost. Specifically, a fuzzy dominance relationship, a fuzzy crowding distance measure, and a tolerance coefficient were used in the algorithm. Compared with other evolutionary methods and classical multiobjective FS methods, experimental results indicated that the proposed algorithm can obtain feature sets with better performances in approximation, diversity, and feature cost.In our earlier work [17], we studied a biobjective optimization problem. The drawbacks of the biobjective approach can be identified from two aspects. Firstly, it is difficult and sometimes puzzling for practitioners to choose the most suitable solution from the set of nondominated solutions output by the scheduling algorithm. Secondly, the optimization capability of multiobjective evolutionary algorithms is often not robust enough, which means the obtained nondominated solutions can be far from the true optimum.In this paper, a single-machine scheduling problem considering energy consumption based on real production environment is studied. Numerous industries involving continuous production processes (e.g., continuous casting and hot rolling in the steel industry) are limited in their energy consumption over time by contracts with power suppliers. In particular, the amount of energy expended in each successive period must not exceed a certain limit. Production scheduling under such constraints is much more complex than under normal production conditions. Therefore, we focus on minimizing total weighted tardiness with energy consumption constraints. The total weighted tardiness captures the requirement of meeting the delivery time specified by customers. In other words, we are treating the problem as a single-objective optimization model, with energy-saving goals defined as constraints. This approach is closer to reality because energy considerations are usually expressed as constraints.In order to solve our problem, a local search strategy was designed to be embedded in the basic particle swarm optimization (PSO) algorithm [18] as the proposed PSO-LS. Besides, a constraint handling process was tailored for this problem, which was used to determine the start processing time and completion time of each job to obtain total weighted tardiness as an objective function value. To make the problem more realistic, the starting time of each job is as low as seconds without violation of constraints. The experimental results show that our enhanced algorithm PSO-LS is statistically superior than that of the basic PSO and GA algorithms especially for large-scale problems.The remainder of this paper is arranged as follows: inSection 2, we define the problem and analyze its difficulty and then provide a small-scale example to facilitate understanding. Then, a PSO embedded with a local search strategy (PSO-LS) algorithm with design details, such as the decoding method, is proposed to solve this problem in Section 3. In Section 4, many computational experiments are executed using PSO-LS, basic PSO, and GA to evaluate PSO-LS. At last, we outline the conclusion and a prospect for future studies in Section 5.


## 2. Problem Definition

### 2.1. Problem Statement

At the beginning, there aren jobs marked as 1,2,3,…,n waiting to be processed on one machine. Job i requires a processing time of pi (h) and consumes Ai (kWh) per hour, and it cannot start to be processed before the former job is finished. The total energy consumption of the jobs processed in the same processing time window shall not exceed Z (kWh). Time window Θ’s time interval is Θ−1T,ΘT, where Θ∈1,2,…,Θmax is the label of time window and T is the length of processing time window.Jobi also has due date dih and importance wi due to customer requirements. We need to decide the starting time sti of job i so that we can determine completion time Ci=sti+pi and the weighted tardiness wti=wi×max0,Ci−di. Our target is to minimize the sum of weighted tardiness of all the jobs, i.e., ∑i=1nwti, which is called total weighted tardiness (TWT).The following assumptions are considered in this problem:(i)
There are no uncertainties.(ii)
The length of processing time windowT≥maxpi so that the time window is reasonable.(iii)
The electricity limitZ≥0.5×maxAi×pi guarantees the problem is solvable.The following mathematical model can be built to describe the problem in detail:(1)min∑i=1nwti,(2)∑i=1nmaxminΘ×T−sti,sti+pi−Θ−1×T,0×Ai≤Z,Θ=1,2,3,…,2n,(3)sti+pi−stj×stj+pj−sti≤0,i≠j,i=1,2,…n,j=1,2,…n,(4)wi×sti+pi−di≤wti,i=1,2,…n,(5)0≤sti≤2n−1T+pi/2,i=1,2,…n,(6)wti≥0,i=1,2,…,n.Expression (1) is the objective function used to minimize TWT. Expression (2) is for the energy constraint. Expression (3) is used to express the constraint that one job at most is being processed at a time. Expression (4) calculates the weighted tardiness of each job. Expressions (5) and (6) are the ranges of the starting time and weighted tardiness, respectively.Noticing that Expression (2) is a max-min constraint and Expression (3) is a quadratic constraint, this model is nonlinear.


### 2.2. Analysis of the Problem

According to Graham et al. [19], our problem can be expressed as 1Z TWT. If the energy consumption constraint is not considered, the problem can be relaxed to 1‖ TWT, which is nondeterministic polynomial-time hardness (NP-hard) [20]. This means an NP-hard problem can be reduced to our problem. So, in this paper, the problem 1Z TWT is at least NP-hard.There are an infinite number of possible solutions to this problem. Due to energy consumption limits in each time window, some jobs may have to wait for some time after the previous job has been completed. Therefore, during certain time windows, the machine may need to be idle for a period of time. Jobs to be fully processed in such time windows have an infinite number of starting times to choose from because there are an infinite number of points on a line segment.When jobs are processed as early as possible without violating the constraint conditions, one permutation can only represent one feasible solution. Considering the objective function with the minimum TWT, i.e.,∑i=1nmax0,sti+pi−di, the value of the objective function at an early starting time must not be worse than that at a late starting time in the same situation. Therefore, the optimal solution to the scheduling problem can be included in the permutations.Based on the above analysis, the job processing sequences are used to represent the solutions of the single-machine scheduling problem with energy consumption constraints. When the order of jobs is determined, the starting time of each job is also determined based on the principle of as early as possible. For a problem withn jobs, there are n! possible solutions in the solution space.


### 2.3. A Small-Scale Example

A simple example is used to facilitate understanding of the solution. Considering 6 jobs at hand needing to be scheduled, the length of time window equals 30 and the energy consumption limit per hourT is equal to 189. Other figures are provided in Table 1.Table 1
Job data in an instance.
ipiAidiwi181228324715231071524411286591210361011106To facilitate the actual production operation, the time value of starting machining operation is accurate to the second. Since the processing time is measured in hours, we need to reserve the starting processing time to two decimal places without violating production constraints.To find the optimal solution, recursion and backtracking are used to enumerate all the permutations of the job processing order. Then, we have6!=720 solutions that are labelled from 1 to 720, as shown in Figure 1. The elbow points are captured during the enumeration process.Figure 1
The feasible solutions of an instance.The optimal solution whose objective function value is 262.63 appears at the 637th feasible solution, whose processing order is (6, 2, 4, 1, 3, 5) and the starting processing time for each job is (0, 10, 14, 29.42, 37.42, 57.51).The schedule and energy consumption of the optimal solution are shown in Figures2(a) and 2(b).Figure 2
The optimal solution: (a) the schedule; (b) electricity consumption.
(a)(b)


## 2.1. Problem Statement

At the beginning, there aren jobs marked as 1,2,3,…,n waiting to be processed on one machine. Job i requires a processing time of pi (h) and consumes Ai (kWh) per hour, and it cannot start to be processed before the former job is finished. The total energy consumption of the jobs processed in the same processing time window shall not exceed Z (kWh). Time window Θ’s time interval is Θ−1T,ΘT, where Θ∈1,2,…,Θmax is the label of time window and T is the length of processing time window.Jobi also has due date dih and importance wi due to customer requirements. We need to decide the starting time sti of job i so that we can determine completion time Ci=sti+pi and the weighted tardiness wti=wi×max0,Ci−di. Our target is to minimize the sum of weighted tardiness of all the jobs, i.e., ∑i=1nwti, which is called total weighted tardiness (TWT).The following assumptions are considered in this problem:(i)
There are no uncertainties.(ii)
The length of processing time windowT≥maxpi so that the time window is reasonable.(iii)
The electricity limitZ≥0.5×maxAi×pi guarantees the problem is solvable.The following mathematical model can be built to describe the problem in detail:(1)min∑i=1nwti,(2)∑i=1nmaxminΘ×T−sti,sti+pi−Θ−1×T,0×Ai≤Z,Θ=1,2,3,…,2n,(3)sti+pi−stj×stj+pj−sti≤0,i≠j,i=1,2,…n,j=1,2,…n,(4)wi×sti+pi−di≤wti,i=1,2,…n,(5)0≤sti≤2n−1T+pi/2,i=1,2,…n,(6)wti≥0,i=1,2,…,n.Expression (1) is the objective function used to minimize TWT. Expression (2) is for the energy constraint. Expression (3) is used to express the constraint that one job at most is being processed at a time. Expression (4) calculates the weighted tardiness of each job. Expressions (5) and (6) are the ranges of the starting time and weighted tardiness, respectively.Noticing that Expression (2) is a max-min constraint and Expression (3) is a quadratic constraint, this model is nonlinear.


## 2.2. Analysis of the Problem

According to Graham et al. [19], our problem can be expressed as 1Z TWT. If the energy consumption constraint is not considered, the problem can be relaxed to 1‖ TWT, which is nondeterministic polynomial-time hardness (NP-hard) [20]. This means an NP-hard problem can be reduced to our problem. So, in this paper, the problem 1Z TWT is at least NP-hard.There are an infinite number of possible solutions to this problem. Due to energy consumption limits in each time window, some jobs may have to wait for some time after the previous job has been completed. Therefore, during certain time windows, the machine may need to be idle for a period of time. Jobs to be fully processed in such time windows have an infinite number of starting times to choose from because there are an infinite number of points on a line segment.When jobs are processed as early as possible without violating the constraint conditions, one permutation can only represent one feasible solution. Considering the objective function with the minimum TWT, i.e.,∑i=1nmax0,sti+pi−di, the value of the objective function at an early starting time must not be worse than that at a late starting time in the same situation. Therefore, the optimal solution to the scheduling problem can be included in the permutations.Based on the above analysis, the job processing sequences are used to represent the solutions of the single-machine scheduling problem with energy consumption constraints. When the order of jobs is determined, the starting time of each job is also determined based on the principle of as early as possible. For a problem withn jobs, there are n! possible solutions in the solution space.


## 2.3. A Small-Scale Example

A simple example is used to facilitate understanding of the solution. Considering 6 jobs at hand needing to be scheduled, the length of time window equals 30 and the energy consumption limit per hourT is equal to 189. Other figures are provided in Table 1.Table 1
Job data in an instance.
ipiAidiwi181228324715231071524411286591210361011106To facilitate the actual production operation, the time value of starting machining operation is accurate to the second. Since the processing time is measured in hours, we need to reserve the starting processing time to two decimal places without violating production constraints.To find the optimal solution, recursion and backtracking are used to enumerate all the permutations of the job processing order. Then, we have6!=720 solutions that are labelled from 1 to 720, as shown in Figure 1. The elbow points are captured during the enumeration process.Figure 1
The feasible solutions of an instance.The optimal solution whose objective function value is 262.63 appears at the 637th feasible solution, whose processing order is (6, 2, 4, 1, 3, 5) and the starting processing time for each job is (0, 10, 14, 29.42, 37.42, 57.51).The schedule and energy consumption of the optimal solution are shown in Figures2(a) and 2(b).Figure 2
The optimal solution: (a) the schedule; (b) electricity consumption.
(a)(b)


## 3. Heuristic Algorithms

Due to the difficulty in the single-machine scheduling problem with energy consumption constraints, it is impossible to quickly obtain an exact solution with the increase in the number of jobs.To solve this problem, it is necessary to use a fitting algorithm based on a heuristic algorithm to obtain satisfactory solutions. There are many heuristic algorithms but we choose PSO from them as our framework for three reasons. Firstly, PSO relies on only a few parameters. Secondly, it has good performance in both the convergence speed and the diversity of solutions. Thirdly, its process is simple and effect is good.In this section, the basic PSO algorithm is first introduced. Then, the encoding and decoding algorithms for this problem are designed in detail. To improve the PSO algorithm, a local search based on the nature of the problem is proposed. Finally, the PSO-LS framework is described.


### 3.1. Basic PSO Algorithm

There are a bunch of particles in the solution space looking for a target. Every particle from the beginning has a position (pos) and a velocity (vel). The best previous location in its memory is called pbest. The best particle in the swarm is called gbest. During each flight, as the particles reach their target, they need to determine their speed based on the speed of the last flight, the previous pbest, and the previous gbest. Their pbest and gbest are reselected based on new locations. This iteration runs until the end of time. The gbest resulting from the final iteration will be the result of the problem produced by PSO:(7)velite=weight×velite−1+c1×r1×pbestite−1−posite−1+c2×r2×gbestite−1−posite−1,(8)posite=posite−1+velite.The PSO algorithm can be described in detail as follows:(1)
Initialize the particle swarm. Specifically, initialize the position and velocity of each particle.(2)
Evaluate all the particles in the swarm according to their own positions.(3)
Initialize pbest and gbest. Assign thepos value of each particle to its own pbest, and the best one of all the particles is used to assign gbest as its initial value.(4)
Repeating steps 5 to 8 until the stop criteria are satisfied.(5)
Update particle swarm. The new velocity and new position of each particle can be calculated by Expressions (7) and (8), respectively, where weights c1 and c2 are parameters that need to be set in advance and r1andr2 are two different random real numbers with values ranging from 0.0 to 1.0. ite is the number of the current iteration.(6)
Adjust the particle swarm. The position of the particle is in the range ofposmin,posMax, where both are parameters of the PSO. Particles beyond this limit are adjusted to meet this constraint.(7)
Evaluate the swarm like in step 2.(8)
Obtain new pbest and gbest.(9)
Obtain the gbest of the last iteration as the result of the problem by PSO.


### 3.2. Encoding and Decoding

To apply the particle swarm algorithm to our problem, for each particle, the position and velocity haven dimensions according to the number of jobs to be processed. In addition, the position and velocity of each particle are calculated by formulas (9) and (10), respectively, where k is the dimension index:(9)velitek=weight×velite−1k+c1×r1×pbestite−1k−posite−1k+c2×r2×gbestite−1k−posite−1k,(10)positek=posite−1k+velitek.Since the basic PSO algorithm was originally designed to solve continuous problems, the smallest position value (SPV) was used to convert the positions into integer sequences as the decoding method, which can be expressed as job processing sequences.The core of SPV process is a sorting algorithm. It is simple, effective, and easy to implement, so we use it as the decoding method.For example, given a 5-dimensional position [3.1, 4.3, 2.7, 2.2, 1.9], [1.9, 2.2, 2.7, 3.1, 4.3] can be obtained by placing the values of the different dimensions in ascending order. The values on each dimension correspond to the original dimension indexes that are extracted to produce sequences (5, 4, 3, 1, 2).The decoding method (SPV) is shown in Algorithm1.Algorithm 1:The decoding method (SPV).
Require: position, nEnsure: order(1)
order⟵∅(2)
multimap<double,int>⟵∅(3)
for each i:=1,2,…,ndo(4)
pair⟵makepairpositioni,i(5)
multimap⟵multimap∪pair(6)
end for(7)
for each i:=1,2,…,ndo(8)
order⟵order∪multimapi.second(9)
end for(10)
return order


### 3.3. Constraint Handling and Solution Obtaining

To ensure these permutations have the probability of containing optimal solutions, jobs are scheduled as early as possible according to processing orders in compliance with the energy consumption constraint.Specifically, we need to decide where to place the jobπ in a given processing order Π on the processing schedule in the current processing time window Θ. The jobs π−1, π−2, etc., are scheduled before job π.To make the problem easier to solve, we only need to decide how long the jobπ costs in the current time window Θ and the next time window Θ+1. Each job only needs to make this decision, then the starting processing time of each job can be determined, and finally, the objective function value of this processing sequence can be used to evaluate the quality of this given processing sequence.The time the job costs in the current time windowΘ and the next time window Θ+1, expressed as tpc and tpn, respectively, can be calculated by formulas (11) and (12), respectively, where rZ is the rest energy that can be used in the current time window, Aπ is the energy consumption per hour to process the job π, and pπ is the processing time of job π:(11)tpc=minrZAπ,rT,pπ,(12)tpn=minZAπ,T,pπ−tpc.We enumerate all the meaningful situations based on Expressions (11) and (12) to obtain the rest T and rest Z, which are expressed as rZ′ and rT′ for the job in the next position, respectively, and to determine the completion time of the current job.All the cases are shown in Figure3.(1)
tpc=pπ and tpn=0. This means the job π will be scheduled to be processed entirely in the current time window. The completion time of the current job can be calculated by Θ×T−rT+tpc.(a)
tpc=pπ<minrZ/Aπ,rT. rZ′=rZ−pπ×Aπ and rT′=rT−pπ are for the next job. This situation is shown in Figure 3(a).(b)
tpc=pπ=rZ/Aπ<rT. The energy consumption runs out after processing job π. So, the next job must be scheduled in the next time window, and rZ′=ZandrT′=T are included in the next job. Figure 3(b) displays this case.(c)
tpc=pπ=rT<rZ/Aπ. So, the job π+1 has to be processed in the next time window Θ+1, and rZ′=ZandrT′=T are for the next job. Figure 3(c) demonstrates this situation.(d)
tpc=pπ=rZ/Aπ=rT. The next job is scheduled to be processed in the next time window with rZ′=Z and rT′=T. This case is described in Figure 3(d).(2)
tpc<pπ and tpn=pπ−tpc. The job π cannot be scheduled entirely in the time window Θ. The completion time of the current job can be calculated by Θ×T+tpn. This current job takes tpn hours to be processed in the next time window. We can obtain rT′=Z−tpn and rZ′=Z−tpn×Aπ for the next job.(a)
tpc=rZ/Aπ<rT. After producing the job π, the electricity in time window Θ runs out. There is a gap between the starting time of job π and the completion time of job π−1. This situation is shown in Figure 3(e).(b)
tpc=rT<rZ/Aπ. The current job can begin processing when the production of job π−1 is complete. Figure 3(f) displays this case.(c)
tpc=rZ/Aπ=rT. This is similar to 2(b). The energy in the current time window runs out. Figure 3(g) shows this situation in detail.(3)
tpc<pπ and tpn=Z/Aπ<pπ−tpc. The job π has to start being processed in the time window Θ+1 with rZ=Z and rT=T. Then, we need to reschedule the job π in the next iteration, which may be consistent with situation 2(a) discussed above. An example of this situation is shown in Figure 3(h).Figure 3
Energy constraint handling cases: (a) case 1; (b) case 2; (c) case 3; (d) case 4; (e) case 5; (f) case 6; (g) case 7; (h) case 8.
(a)(b)(c)(d)(e)(f)(g)(h)The procedure above repeats fromπ=1 until π=n for the number of jobs. We can determine the completion time of each job so that TWT can be calculated as the fitness of a particle.Based on the above description, the constraint handling process is described in Algorithm2. To determine the completion time precision down to seconds, lines 7 and 17 to 22 were added to handle the tpn with more than two decimals. In line 7, we leave tpn with 2 decimal places to obtain tpnround. For example, if tpn=3.91+1×10−100, then we have tpnround=3.92. In lines 17 through 22, rZ and rT are calculated based on tpnround instead of tpn, and the schedule is adjusted as well.Algorithm 2:Constraint handling process to obtain a solution.
Require: position and problemDataEnsure: schedule, starting time st, completion time C, and TWT(1)
p,A,w,d,T,Z,n⟵problemData(2)
order⟵SPVposition,n(3)
schedule⟵∅(4)
Θ⟵1,rT⟵T,rZ⟵Z,schedulep⟵∅,scheduleporder⟵0,0,TWT⟵0(5)
if each i≔1,…,ndo(6)
reschedule:(7)
k⟵orderi(8)
tpc⟵minrZ/Ak,rT,pkk;tpn⟵minZ/Ak,T,pk−tpc(9)
tpnround⟵uproundtpn,0.01(10)
ifpk−tpc−tpn=0andZ=tpnround×Akthen(11)
rZ⟵rZ−Ak×tpc;rT⟵rT−tpc(12)
scheduleporder0⟵i;scheduleporder1⟵tpc/pk(13)
schedulep∪scheduleporder(14)
Ci⟵Θ×T−rT(15)
ifrZ=0orrT=0then(16)
schedule∪schedulep;schedulep⟵∅;Θ⟵Θ+1(17)
rZ⟵Z−tpn×Ak;rT⟵T−tpn(18)
iftpn>0then(19)
iftpn≠tpnroundthen(20)
rZ⟵Z−tpnround×Ak;rT⟵T−tpnround(21)
scheduleporder0⟵i;scheduleporder1⟵tpnround/pk(22)
schedulep∪scheduleporder(23)
Ci⟵Θ×T−rT(24)
∗scheduleΘ−2.end−1.at1⟵1.0−scheduleporder1(25)
else(26)
scheduleporder0⟵i;scheduleporder1⟵tpn/pk;schedulep∪scheduleporder(27)
Ci⟵Θ×T−rT(28)
end if(29)
end if(30)
end if(31)
TWT⟵TWT+wk×max0.0,Ci−dk;(32)
sti⟵Ci−pk(33)
else(34)
schedulep∪scheduleporder;schedulep⟵∅;Θ⟵Θ+1;(35)
rZ⟵Z;rT⟵T(36)
go to reschedule(37)
end if(38)
end for(39)
ifΘ>schedule.sizethen(40)
schedulep∪scheduleporder(41)
end if(42)
return schedule, st, C and TWT


### 3.4. Local Search

To improve the searching ability of the basic PSO, an insertion operator is used in the gbest of the particle swarm in each iteration. This insertion operator can considerably increase the diversity of solutions, thus increasing the probability of significantly improving gbest. In addition, it is simple to implement and has low time and memory overhead.The insertion operator for the processing order of gbest is described in Figure4. It aims to insert the job π1 from the time window Θ1 immediately after the job π2 in time window Θ2.Figure 4
An example for insertion operator for job processing order.This insertion operator can be easily applied to the job processing order.Firstly, we need to select two different time windows. Time windowsΘ1 and Θ2 are random integers selected from the range of 1,Θmax−1 and Θ1+1,Θmax. Then, two jobs need to be chosen from those two time windows. Jobs π1 and π2 are chosen randomly from the jobs processed in the selected time windows. At this moment, job π1 must be processed before job π2 because time window Θ1 is in front of time window Θ2. Thirdly, for jobs from job π2 to the job immediately after job π1, their ordinal numbers need to be subtracted by 1 in this processing sequence. Finally, we change the ordinal number of job π1 in the processing order. The only task to perform is to place job π1 after job π2.Because the position of gbest is used to update particles in the next iteration, we need to change the position of gbest to maintain the consistency of the position and processing order of gbest. A small example is provided in Table2 to illustrate the process of adjusting the position of gbest according to the insertion operator.Table 2
Insertion operation example for position of gbest.
Originalorder0(5,π1=4,3,1,π2=2Step 1Target(5,3,1,π2=2,π1=4Dimension12345pos0[3.1,4.3,2.7,2.2,1.9]Swapπ1=43Dimension12345pos1[3.1,4.3,2.2,2.7,1.9]order1(5,3,4,1,2)Step 2Swapπ1=41Dimension12345pos2[2.7,4.3,2.2,3.1,1.9]order2(5,3,1,4,2)Step 3Swapπ1=4π2=2Dimension12345pos3[2.7,3.1,2.2,4.3,1.9]order3∗=target(5,3,1,2,4)Assume that the original gbest has a 5-dimensional positionpos0=3.1,4.3,2.7,2.2,1.9 and the original order order0=5,4,3,1,2. If π1=4 and π2=2, we can determine the changed order target=5,3,1,2,4 according to insertion operator for order, as shown in Figure 4. For this instance, step 1 shown in Table 2 involves exchanging the job π1 to the job to the right. So we need to swap jobs 4 and 3, and we can obtain pos1 by swapping the value of dimensions 3 and 4 of pos0. At this moment, we have pos1=3.1,4.3,2.2,2.7,1.9 and order1=5,3,4,1,2. In step 2, we also swap the job π1 to the right job. This time, we need to exchange job 4 with job 1 according to order1 so that order2 can be obtained. To obtain pos2, we can swap the value of dimensions 4 and 1 of pos1, that is, exchanging 3.1 with 2.7. Step 3 is also based on its previous step; this time, we need to exchange job π1 and job π2 because job π2 is to the right of job π1 in order2. Similar with step 1 and step 2, pos3 is obtained by swapping the values of dimensions 4 and 2 of pos2. Finally, we get pos3=2.7,3.1,2.2,4.3,1.9. To verify its correctness, we can decode pos3 using SPV so that we can determine its order (5, 3, 1, 2, 4), which is equal to the target order.Based on all descriptions above, for each iteration, we applied the insertion operator shown in Algorithm3 to the original gbest five times to obtain five different new gbests. The original gbest was replaced by the best gbest among these five gbests with the smallest objective function value if it was better than the original gbest. Based on the above, the local search process is described in Algorithm 4.Algorithm 3:Insertion operator for gbest.
Require: gbest, problemDataEnsure:gbestnew(1)
time windowΘ1⟵random1,gbest.schedule.size−1(2)
time windowΘ2⟵randomΘ1+1,gbest.schedule.size(3)
temp1⟵random1,gbest.scheduleΘ1.size(4)
temp2⟵random1,gbest.scheduleΘ2.size(5)
π1⟵gbest.scheduleΘ1temp1(6)
π2⟵gbest.scheduleΘ2temp2(7)
initializegbestnew⟵gbest(8)
for each ite:=π2,π2−1,…,π1+1do(9)
swapgbestnew.posgbest.orderite,gbestnew.posgbest.orderite−1(10)
end for(11)
for each ite:=π1,π1+1,…,π2−1do(12)
swapgbestnew.orderite,gbestnew.orderite+1(13)
end for(14)
evaluategbestnew,problemData(15)
returngbestnewAlgorithm 4:Local search process.
Require: gbest, problemDataEnsure: gbest(1)
arrgbestnew⟵∅(2)
for each ite:=1,2,…,maxitedo(3)
apply insertion operator to gbest to get agbestnew(4)
arrgbestnew⟵arrgbestnew∪gbestnew(5)
end for(6)
obtain the bestgbestnew from arrgbestnew as bestgbestnew(7)
ifbestgbestnew is better than gbest then(8)
gbest⟵bestgbestnew(9)
end if(10)
return gbestAlgorithm 5:PSO-LS framework.
Require: parameter, problemDataEnsure: solution(1)
initializeSwarm (swarm, parameter,n)(2)
evaluateSwarm (swarm, problemData)(3)
initialize pbest and gbest(4)
while parameter.stopCriteria is not satisfied do(5)
updateSwarm (swarm, parameter)(6)
adjustSwarm (swarm, parameter)(7)
evaluateSwarm (swarm, problemData)(8)
localSearch (swarm.gbest, problemData)(9)
end while(10)
solution = swarm.gbest.solution(11)
return solution


### 3.5. PSO-LS Framework

The PSO-LS framework structure is shown in Algorithm5. As described in the previous sections, the state of the swarm is initialized by the first three lines. The main loop of the PSO algorithm consists of lines from 4 through 9. Based on the fact that the behavior of each particle depends heavily on the global leader gbest, the eighth line which aims to improve the quality of the global optimal particle is added before the end of each iteration by calling Algorithm 4.


## 3.1. Basic PSO Algorithm

There are a bunch of particles in the solution space looking for a target. Every particle from the beginning has a position (pos) and a velocity (vel). The best previous location in its memory is called pbest. The best particle in the swarm is called gbest. During each flight, as the particles reach their target, they need to determine their speed based on the speed of the last flight, the previous pbest, and the previous gbest. Their pbest and gbest are reselected based on new locations. This iteration runs until the end of time. The gbest resulting from the final iteration will be the result of the problem produced by PSO:(7)velite=weight×velite−1+c1×r1×pbestite−1−posite−1+c2×r2×gbestite−1−posite−1,(8)posite=posite−1+velite.The PSO algorithm can be described in detail as follows:(1)
Initialize the particle swarm. Specifically, initialize the position and velocity of each particle.(2)
Evaluate all the particles in the swarm according to their own positions.(3)
Initialize pbest and gbest. Assign thepos value of each particle to its own pbest, and the best one of all the particles is used to assign gbest as its initial value.(4)
Repeating steps 5 to 8 until the stop criteria are satisfied.(5)
Update particle swarm. The new velocity and new position of each particle can be calculated by Expressions (7) and (8), respectively, where weights c1 and c2 are parameters that need to be set in advance and r1andr2 are two different random real numbers with values ranging from 0.0 to 1.0. ite is the number of the current iteration.(6)
Adjust the particle swarm. The position of the particle is in the range ofposmin,posMax, where both are parameters of the PSO. Particles beyond this limit are adjusted to meet this constraint.(7)
Evaluate the swarm like in step 2.(8)
Obtain new pbest and gbest.(9)
Obtain the gbest of the last iteration as the result of the problem by PSO.


## 3.2. Encoding and Decoding

To apply the particle swarm algorithm to our problem, for each particle, the position and velocity haven dimensions according to the number of jobs to be processed. In addition, the position and velocity of each particle are calculated by formulas (9) and (10), respectively, where k is the dimension index:(9)velitek=weight×velite−1k+c1×r1×pbestite−1k−posite−1k+c2×r2×gbestite−1k−posite−1k,(10)positek=posite−1k+velitek.Since the basic PSO algorithm was originally designed to solve continuous problems, the smallest position value (SPV) was used to convert the positions into integer sequences as the decoding method, which can be expressed as job processing sequences.The core of SPV process is a sorting algorithm. It is simple, effective, and easy to implement, so we use it as the decoding method.For example, given a 5-dimensional position [3.1, 4.3, 2.7, 2.2, 1.9], [1.9, 2.2, 2.7, 3.1, 4.3] can be obtained by placing the values of the different dimensions in ascending order. The values on each dimension correspond to the original dimension indexes that are extracted to produce sequences (5, 4, 3, 1, 2).The decoding method (SPV) is shown in Algorithm1.Algorithm 1:The decoding method (SPV).
Require: position, nEnsure: order(1)
order⟵∅(2)
multimap<double,int>⟵∅(3)
for each i:=1,2,…,ndo(4)
pair⟵makepairpositioni,i(5)
multimap⟵multimap∪pair(6)
end for(7)
for each i:=1,2,…,ndo(8)
order⟵order∪multimapi.second(9)
end for(10)
return order


## 3.3. Constraint Handling and Solution Obtaining

To ensure these permutations have the probability of containing optimal solutions, jobs are scheduled as early as possible according to processing orders in compliance with the energy consumption constraint.Specifically, we need to decide where to place the jobπ in a given processing order Π on the processing schedule in the current processing time window Θ. The jobs π−1, π−2, etc., are scheduled before job π.To make the problem easier to solve, we only need to decide how long the jobπ costs in the current time window Θ and the next time window Θ+1. Each job only needs to make this decision, then the starting processing time of each job can be determined, and finally, the objective function value of this processing sequence can be used to evaluate the quality of this given processing sequence.The time the job costs in the current time windowΘ and the next time window Θ+1, expressed as tpc and tpn, respectively, can be calculated by formulas (11) and (12), respectively, where rZ is the rest energy that can be used in the current time window, Aπ is the energy consumption per hour to process the job π, and pπ is the processing time of job π:(11)tpc=minrZAπ,rT,pπ,(12)tpn=minZAπ,T,pπ−tpc.We enumerate all the meaningful situations based on Expressions (11) and (12) to obtain the rest T and rest Z, which are expressed as rZ′ and rT′ for the job in the next position, respectively, and to determine the completion time of the current job.All the cases are shown in Figure3.(1)
tpc=pπ and tpn=0. This means the job π will be scheduled to be processed entirely in the current time window. The completion time of the current job can be calculated by Θ×T−rT+tpc.(a)
tpc=pπ<minrZ/Aπ,rT. rZ′=rZ−pπ×Aπ and rT′=rT−pπ are for the next job. This situation is shown in Figure 3(a).(b)
tpc=pπ=rZ/Aπ<rT. The energy consumption runs out after processing job π. So, the next job must be scheduled in the next time window, and rZ′=ZandrT′=T are included in the next job. Figure 3(b) displays this case.(c)
tpc=pπ=rT<rZ/Aπ. So, the job π+1 has to be processed in the next time window Θ+1, and rZ′=ZandrT′=T are for the next job. Figure 3(c) demonstrates this situation.(d)
tpc=pπ=rZ/Aπ=rT. The next job is scheduled to be processed in the next time window with rZ′=Z and rT′=T. This case is described in Figure 3(d).(2)
tpc<pπ and tpn=pπ−tpc. The job π cannot be scheduled entirely in the time window Θ. The completion time of the current job can be calculated by Θ×T+tpn. This current job takes tpn hours to be processed in the next time window. We can obtain rT′=Z−tpn and rZ′=Z−tpn×Aπ for the next job.(a)
tpc=rZ/Aπ<rT. After producing the job π, the electricity in time window Θ runs out. There is a gap between the starting time of job π and the completion time of job π−1. This situation is shown in Figure 3(e).(b)
tpc=rT<rZ/Aπ. The current job can begin processing when the production of job π−1 is complete. Figure 3(f) displays this case.(c)
tpc=rZ/Aπ=rT. This is similar to 2(b). The energy in the current time window runs out. Figure 3(g) shows this situation in detail.(3)
tpc<pπ and tpn=Z/Aπ<pπ−tpc. The job π has to start being processed in the time window Θ+1 with rZ=Z and rT=T. Then, we need to reschedule the job π in the next iteration, which may be consistent with situation 2(a) discussed above. An example of this situation is shown in Figure 3(h).Figure 3
Energy constraint handling cases: (a) case 1; (b) case 2; (c) case 3; (d) case 4; (e) case 5; (f) case 6; (g) case 7; (h) case 8.
(a)(b)(c)(d)(e)(f)(g)(h)The procedure above repeats fromπ=1 until π=n for the number of jobs. We can determine the completion time of each job so that TWT can be calculated as the fitness of a particle.Based on the above description, the constraint handling process is described in Algorithm2. To determine the completion time precision down to seconds, lines 7 and 17 to 22 were added to handle the tpn with more than two decimals. In line 7, we leave tpn with 2 decimal places to obtain tpnround. For example, if tpn=3.91+1×10−100, then we have tpnround=3.92. In lines 17 through 22, rZ and rT are calculated based on tpnround instead of tpn, and the schedule is adjusted as well.Algorithm 2:Constraint handling process to obtain a solution.
Require: position and problemDataEnsure: schedule, starting time st, completion time C, and TWT(1)
p,A,w,d,T,Z,n⟵problemData(2)
order⟵SPVposition,n(3)
schedule⟵∅(4)
Θ⟵1,rT⟵T,rZ⟵Z,schedulep⟵∅,scheduleporder⟵0,0,TWT⟵0(5)
if each i≔1,…,ndo(6)
reschedule:(7)
k⟵orderi(8)
tpc⟵minrZ/Ak,rT,pkk;tpn⟵minZ/Ak,T,pk−tpc(9)
tpnround⟵uproundtpn,0.01(10)
ifpk−tpc−tpn=0andZ=tpnround×Akthen(11)
rZ⟵rZ−Ak×tpc;rT⟵rT−tpc(12)
scheduleporder0⟵i;scheduleporder1⟵tpc/pk(13)
schedulep∪scheduleporder(14)
Ci⟵Θ×T−rT(15)
ifrZ=0orrT=0then(16)
schedule∪schedulep;schedulep⟵∅;Θ⟵Θ+1(17)
rZ⟵Z−tpn×Ak;rT⟵T−tpn(18)
iftpn>0then(19)
iftpn≠tpnroundthen(20)
rZ⟵Z−tpnround×Ak;rT⟵T−tpnround(21)
scheduleporder0⟵i;scheduleporder1⟵tpnround/pk(22)
schedulep∪scheduleporder(23)
Ci⟵Θ×T−rT(24)
∗scheduleΘ−2.end−1.at1⟵1.0−scheduleporder1(25)
else(26)
scheduleporder0⟵i;scheduleporder1⟵tpn/pk;schedulep∪scheduleporder(27)
Ci⟵Θ×T−rT(28)
end if(29)
end if(30)
end if(31)
TWT⟵TWT+wk×max0.0,Ci−dk;(32)
sti⟵Ci−pk(33)
else(34)
schedulep∪scheduleporder;schedulep⟵∅;Θ⟵Θ+1;(35)
rZ⟵Z;rT⟵T(36)
go to reschedule(37)
end if(38)
end for(39)
ifΘ>schedule.sizethen(40)
schedulep∪scheduleporder(41)
end if(42)
return schedule, st, C and TWT


## 3.4. Local Search

To improve the searching ability of the basic PSO, an insertion operator is used in the gbest of the particle swarm in each iteration. This insertion operator can considerably increase the diversity of solutions, thus increasing the probability of significantly improving gbest. In addition, it is simple to implement and has low time and memory overhead.The insertion operator for the processing order of gbest is described in Figure4. It aims to insert the job π1 from the time window Θ1 immediately after the job π2 in time window Θ2.Figure 4
An example for insertion operator for job processing order.This insertion operator can be easily applied to the job processing order.Firstly, we need to select two different time windows. Time windowsΘ1 and Θ2 are random integers selected from the range of 1,Θmax−1 and Θ1+1,Θmax. Then, two jobs need to be chosen from those two time windows. Jobs π1 and π2 are chosen randomly from the jobs processed in the selected time windows. At this moment, job π1 must be processed before job π2 because time window Θ1 is in front of time window Θ2. Thirdly, for jobs from job π2 to the job immediately after job π1, their ordinal numbers need to be subtracted by 1 in this processing sequence. Finally, we change the ordinal number of job π1 in the processing order. The only task to perform is to place job π1 after job π2.Because the position of gbest is used to update particles in the next iteration, we need to change the position of gbest to maintain the consistency of the position and processing order of gbest. A small example is provided in Table2 to illustrate the process of adjusting the position of gbest according to the insertion operator.Table 2
Insertion operation example for position of gbest.
Originalorder0(5,π1=4,3,1,π2=2Step 1Target(5,3,1,π2=2,π1=4Dimension12345pos0[3.1,4.3,2.7,2.2,1.9]Swapπ1=43Dimension12345pos1[3.1,4.3,2.2,2.7,1.9]order1(5,3,4,1,2)Step 2Swapπ1=41Dimension12345pos2[2.7,4.3,2.2,3.1,1.9]order2(5,3,1,4,2)Step 3Swapπ1=4π2=2Dimension12345pos3[2.7,3.1,2.2,4.3,1.9]order3∗=target(5,3,1,2,4)Assume that the original gbest has a 5-dimensional positionpos0=3.1,4.3,2.7,2.2,1.9 and the original order order0=5,4,3,1,2. If π1=4 and π2=2, we can determine the changed order target=5,3,1,2,4 according to insertion operator for order, as shown in Figure 4. For this instance, step 1 shown in Table 2 involves exchanging the job π1 to the job to the right. So we need to swap jobs 4 and 3, and we can obtain pos1 by swapping the value of dimensions 3 and 4 of pos0. At this moment, we have pos1=3.1,4.3,2.2,2.7,1.9 and order1=5,3,4,1,2. In step 2, we also swap the job π1 to the right job. This time, we need to exchange job 4 with job 1 according to order1 so that order2 can be obtained. To obtain pos2, we can swap the value of dimensions 4 and 1 of pos1, that is, exchanging 3.1 with 2.7. Step 3 is also based on its previous step; this time, we need to exchange job π1 and job π2 because job π2 is to the right of job π1 in order2. Similar with step 1 and step 2, pos3 is obtained by swapping the values of dimensions 4 and 2 of pos2. Finally, we get pos3=2.7,3.1,2.2,4.3,1.9. To verify its correctness, we can decode pos3 using SPV so that we can determine its order (5, 3, 1, 2, 4), which is equal to the target order.Based on all descriptions above, for each iteration, we applied the insertion operator shown in Algorithm3 to the original gbest five times to obtain five different new gbests. The original gbest was replaced by the best gbest among these five gbests with the smallest objective function value if it was better than the original gbest. Based on the above, the local search process is described in Algorithm 4.Algorithm 3:Insertion operator for gbest.
Require: gbest, problemDataEnsure:gbestnew(1)
time windowΘ1⟵random1,gbest.schedule.size−1(2)
time windowΘ2⟵randomΘ1+1,gbest.schedule.size(3)
temp1⟵random1,gbest.scheduleΘ1.size(4)
temp2⟵random1,gbest.scheduleΘ2.size(5)
π1⟵gbest.scheduleΘ1temp1(6)
π2⟵gbest.scheduleΘ2temp2(7)
initializegbestnew⟵gbest(8)
for each ite:=π2,π2−1,…,π1+1do(9)
swapgbestnew.posgbest.orderite,gbestnew.posgbest.orderite−1(10)
end for(11)
for each ite:=π1,π1+1,…,π2−1do(12)
swapgbestnew.orderite,gbestnew.orderite+1(13)
end for(14)
evaluategbestnew,problemData(15)
returngbestnewAlgorithm 4:Local search process.
Require: gbest, problemDataEnsure: gbest(1)
arrgbestnew⟵∅(2)
for each ite:=1,2,…,maxitedo(3)
apply insertion operator to gbest to get agbestnew(4)
arrgbestnew⟵arrgbestnew∪gbestnew(5)
end for(6)
obtain the bestgbestnew from arrgbestnew as bestgbestnew(7)
ifbestgbestnew is better than gbest then(8)
gbest⟵bestgbestnew(9)
end if(10)
return gbestAlgorithm 5:PSO-LS framework.
Require: parameter, problemDataEnsure: solution(1)
initializeSwarm (swarm, parameter,n)(2)
evaluateSwarm (swarm, problemData)(3)
initialize pbest and gbest(4)
while parameter.stopCriteria is not satisfied do(5)
updateSwarm (swarm, parameter)(6)
adjustSwarm (swarm, parameter)(7)
evaluateSwarm (swarm, problemData)(8)
localSearch (swarm.gbest, problemData)(9)
end while(10)
solution = swarm.gbest.solution(11)
return solution


## 3.5. PSO-LS Framework

The PSO-LS framework structure is shown in Algorithm5. As described in the previous sections, the state of the swarm is initialized by the first three lines. The main loop of the PSO algorithm consists of lines from 4 through 9. Based on the fact that the behavior of each particle depends heavily on the global leader gbest, the eighth line which aims to improve the quality of the global optimal particle is added before the end of each iteration by calling Algorithm 4.


## 4. Computational Experiments

To evaluate PSO-LS proposed in the previous chapter, we performed many experiments for comparison with the genetic algorithm (GA) [21].To be specific, we used the main algorithm framework in a previous study [22] that uses GA to solve the scheduling problem. The initial population was generated randomly. We used C1 from [22] for chromosomal representation and crossover operator. For selection mechanism, we used a hybrid of roulette wheel selection [23] with an elitist strategy [23]. A shift mutation was applied to the GA according to the literature [22]. The probability of mutation pm was dynamic, and at the beginning, pm:=pm0. For each iteration, pm decreases by a rate of θ. In the population, when the value of the minimum fitness over the mean of fitness is larger than a constant real number D, i.e., vmin/vmean>D, pm takes the initial value pm0.Before the comparison, experiments for parameter selection were needed because the performance of heuristic algorithms depends strongly on their parameters. We performed the same parameter selection experiment on PSO and GA.


### 4.1. Problem Data Setting

Before we started the experiment, the data of problems are given as follows:(i)
The processing time of jobi, pi, is uniformly generated in the range unif1,10.(ii)
The electricity consumption of jobi, Ai, is distributed from the uniform unif3,15.(iii)
The due time of jobi, di, is distributed from the uniform unif5,5×n.(iv)
The importance of jobi, wi, is distributed from the uniform unif1,n.All the problems handled in the experiments were generated randomly based on the distributions.


### 4.2. Algorithm Parameters Setting

We used the Taguchi method [24] for parameter selection.Taguchi method is also called the orthogonal experimental design which is used to determine the value of each factor especially when the number of factors and factor levels are greater than 3. Based on orthogonal tables, the number of experiments can be greatly decreased. The brief steps of the Taguchi method are as follows: firstly, determine responses, factors, and levels; secondly, select appropriate orthogonal tables; thirdly, execute the experiments according to orthogonal tables and fill the tables with experimental results; then, analyze the results and determine the factor level combination; and at last, verify the effectiveness of the selected levels of factors.We took the size of swarm, weight,c1, c2, and Vmax as factors for the PSO algorithm. We also took the size of population, the probability of crossover pc, the probability of mutation pm, and the other two parameters related to mutations θ and D as the factors for the GA algorithm. Each factor of both algorithms took 4 levels, as shown in Tables 3 and 4.Table 3
Levels of parameters for PSO.
ParameterSize50100150200Weight0.60.70.80.9c10.010.050.10.15c20.30.60.80.95Vmax1234Table 4
Levels of parameters for GA.
ParameterSize50100150200pc0.30.50.70.9pm0.30.50.70.9θ0.690.790.890.99D0.650.750.850.95We conducted 16 experiments according to the orthogonal tables of parameters of each algorithm, as shown in Tables5 and 6.Table 5
Orthogonal table for parameters for PSO.
No.SizeWeightc1c2VmaxSmall-scaleLarge-scale1500.60.010.316150.0400125,285.86102500.70.050.624532.949091,016.69453500.80.10.833702.433573,910.10904500.90.150.9543018.055038,671.730051000.60.050.843867.686589,791.167061000.70.010.9533531.786071,033.745071000.80.150.324092.915084,425.593081000.90.10.613051.151552,046.650091500.60.10.9523695.036575,719.6005101500.70.150.813517.028067,949.1885111500.80.010.643122.311060,491.8475121500.90.050.333132.798057,114.9990132000.60.150.634070.935581,141.6650142000.70.10.343676.878583,755.1865152000.80.050.9513137.842049,046.6995162000.90.010.822761.621534,490.5440Table 6
Orthogonal table for parameters for GA.
No.SizepcpmθDSmall-scaleLarge-scale1500.30.30.690.654220.1760117,609.06452500.50.50.790.753879.6515108,405.69153500.70.70.890.853905.2175102,019.34254500.90.90.990.953706.756093,161.175051000.30.50.890.953317.076092,678.022061000.50.30.990.853505.2000108,444.703571000.70.90.690.753510.147089,561.192581000.90.70.790.653656.2845106,062.773091500.30.70.990.753064.300579,132.2530101500.50.90.890.653145.214077,560.3880111500.70.30.790.953470.5435111,862.9095121500.90.50.690.853331.9765101,187.5760132000.30.90.790.852951.099572,115.2650142000.50.70.690.953014.659580,158.9815152000.70.50.990.653223.180590,552.2890162000.90.30.890.753291.8940113,233.6705Considering that the problems on different scales may take different parameter levels to obtain effective search capabilities, we set the means of TWT of a random small-scale problem and a random large-scale problem as responses. A problem with 30 jobs was used as the small-scale problem and 70 jobs as the large-scale problem. To eliminate as much random interference as possible, the average value of the objective function value resulting from 20 executions of each algorithm was taken as the response.After the tables were designed and filled, we needed to select parameters for the PSO and GA algorithms by analyzing Tables5 and 6.Then, we needed to decide which level would be selected for each factor. We selected the factor of the size of the particle swarm for the small-scale problem as an example, as shown in the line on the top left of Figure5. Firstly, let us consider the situation where size equals 50. According to Table 5, the average of TWT for a size of 50 for the small-scale problem can calculated by the mean of the small-scale response of the first, second, third, and fourth experiments. That is, 6150.0400+4532.9490+3702.4335+3018.0550/4=4350.869375. Secondly, similarly, we can obtain 3635.88475 for level 100, 3366.793375 for level 150, and 3411.819375 for level 200. Thirdly, we determine the best parameter of 150 for the small-scale problem for PSO because level 150 has the smallest mean TWT of 3366.793375.Figure 5
Influence of the key parameters for PSO.The average responses at different levels for each factor need to be calculated, and then, the level of each factor with the smallest mean TWT is chosen. We performed this procedure on other factors for PSO and all the factors for GA for both the small- and large-scale problems. The main effect plots for PSO and GA are shown in Figures5 and 6, respectively. The lowest points of these lines are taken as the value for each parameter for the algorithms.Figure 6
Influence of the key parameters for GA.As such, we determined all the parameter values for each algorithm. For the PSO algorithm, the values of the size of swarm, weight,c1, c2, m, and Vmax are 150, 0.9, 0.1, 0.95, and 4 for the small-scale problem and 200, 0.9, 0.15, 0.95, and 4 for the large-scale problem, respectively. For the GA algorithm, similarly, the size of population, the probability of crossover pc, the probability of mutation pm, and the other two parameters relating to mutations θ and D are 200, 0.5, 0.9, 0.99, and 0.95 for the small-scale problem and 200, 0.3, 0.9, 0.99, and 0.95 for the large-scale problem, respectively.In order to verify the effectiveness of selected levels of factors by the Taguchi method, the responses of the selected parameter values need to be compared with that of all the level combinations displayed in Figures 5 and 6. Problems of size 30 and size 70 are generated randomly, and their results are displayed in Tables 7 and 8. The values of line 17 in both figures are the levels for factors selected for small-scale problems and line 18 for large-scale problems. It can be seen from the two tables that the fitness obtained by the levels of factors selected for the small-scale problems is the smallest among the other values in the same column. The TWT obtained by the levels of factors chosen for the large-scale problems is also the smallest among the other data in the same column. Therefore, the parameter selections for PSO and GA by the Taguchi method are effective.Table 7
The effectiveness of parameter selection for PSO.
No.SizeWeightc1c2VmaxSmall-scaleLarge-scale1500.60.010.317802.857781944.09552500.70.050.625892.0415692195.53853500.80.10.835343.4035642169.63654500.90.150.9544433.615504850.229551000.60.050.845659.695658437.44861000.70.010.9535036.7085603161.16671000.80.150.325346.9595631647.51281000.90.10.614541.963546953.601591500.60.10.9525399.3495625364.341101500.70.150.814936.6025620230.085111500.80.010.644620.1865570452.559121500.90.050.334676.6135554409.8515132000.60.150.635393.4215624672.711142000.70.10.345250.421635595.3965152000.80.050.9514489.3905538767.257162000.90.010.824074.7515487169.7495172000.90.10.9544046.7475483691.6605182000.90.150.9544124.0595479002.7685Table 8
The effectiveness of parameter selection for GA.
No.SizepcpmθDSmall-scaleLarge-scale1500.30.30.690.655877.824814077.77252500.50.50.790.755532.903781673.4133500.70.70.890.854947.04750002.86754500.90.90.990.955080.9145768124.555551000.30.50.890.954915.209738638.40861000.50.30.990.855123.6145791738.01671000.70.90.690.754637.9835751141.205581000.90.70.790.654943.807778180.74191500.30.70.990.754400.202720077.3955101500.50.90.890.654431.645691519.7225111500.70.30.790.954864.1745786077.9255121500.90.50.690.854664.906792386.35132000.30.90.790.854357.5805684881.422142000.50.70.690.954431.7005722812.895152000.70.50.990.654511.614747950.5375162000.90.30.890.755038.0215769743.4985172000.50.90.990.954296.492686883.08182000.30.90.990.954335.9145681536.872


### 4.3. Performance Comparison

We compared the results of PSO-LS, PSO, and GA for problems on six different scales: 10, 30, 50, 70, 100, and 300 jobs. Problems with fewer than 70 jobs were considered small-scale; otherwise, they were considered large-scale.When solving these two sets of problems on different scales, the algorithms choose the values of parameters of the corresponding scale, which was obtained in the previous section.For each scale, five different instances were randomly generated. When solving each problem, each algorithm was independently executed 20 times, and the average value of these 20 results was recorded to reduce the differences in the random initial solutions.Each algorithm executes the same duration for each run. All algorithms were executed in 1, 10, 30, 50, 100, and 100 s, which correspond to solving problems with 10, 30, 50, 70, 100, and 300 jobs, respectively. For small-scale problems, the algorithms almost converge within the setting time, so we compare the results of each algorithm when the algorithms converge. For large-scale problems, because of the difficulty in the problems, algorithms cannot converge in a short time, so we let the algorithm run enough time to see, which makes the results closer to the optimal solutions. Since time is vital to production environment, it is important to get a better satisfactory solution in a shorter time. Therefore, the computational time rather than the number of iterations is controlled for the computational experiments.For the 20 runs, the comparison results of the average TWT obtained by PSO-LS, PSO, and GA are shown in Table9.Table 9
Comparison of the mean TWT.
Scale-instancePSO-LSPSOGA10-1666.8100669.9850666.810010-2186.3200186.4200186.320010-3273.2200274.3000273.615010-4232.3720229.3980236.833010-51,114.73001,115.65401,117.578030-14,956.70304,938.72204,724.978030-218,087.658018,563.079019,007.344030-36,810.15006,919.53207,286.000030-49,355.27409,612.90009,701.413030-510,393.877010,603.297011,060.379050-147,373.079049,662.628050,611.010050-268,891.757070,747.014079,298.578050-361,826.237064,119.760067,243.050050-468,777.671070,193.705077,970.551050-529,073.968030,776.000033,192.183070-1135,271.7270143,512.1820158,553.003070-2164,900.6270171,377.4080183,845.925070-3128,195.6660135,871.2800150,625.168070-4110,219.4880118,058.2520138,250.718070-5161,958.1090166,567.7950192,447.0210100-1287,348.7000308,337.3160452,220.2050100-2316,831.4730339,679.4730491,640.0870100-3363,915.9090392,756.4790550,393.6550100-4512,024.2470541,724.8160705,187.0550100-5352,616.9280384,112.2770588,789.3920300-113,726,081.649014,313,663.888035,374,531.8320300-212,896,793.116013,395,467.677034,768,966.6680300-310,358,806.233010,809,516.379030,715,756.5610300-413,422,518.767014,022,110.864035,002,552.1430300-510,851,867.171011,269,214.088029,338,328.5100Pairedt-tests were to be conducted with a significance level α=0.05 to analyze the performance of PSO-LS compared with both basic PSO and GA.For the same scale of problems, the differences in the objective function values obtained by PSO-LS and PSO shown in Table9 can be obtained by Di=PSOi−PSO-LSi, where i=1,…,5, which are normally distributed; thus, D∼NuD,sD2. We wish to test the hypothesis:H0:uD≤0,H1:uD>0..The number of samples, the sample mean, and the sample standard deviation aren, d¯, and sd accordingly. If t−statistic=d¯/sD/n>tα=0.05n−1, H0 is rejected and ud>0. That is, PSO has a greater fitness than PSO-LS, so the performance of PSO-LS is better than PSO. Otherwise, PSO-LS is considered to have no obvious advantages.We used the above method to test the performance of PSO-LS compared to PSO at all scales. Firstly, subtract the value of the PSO-LS column from that of the PSO column in Table9 and obtain the data of the second column in Table 10. Values greater than 0 indicate that PSO-LS is better. Then, the mean and standard deviation of differences on different problem sales are calculated including 10, 30, 50, 70, 100, and 300, and the results are recorded in the third and fourth columns in Table 10, respectively. T-statistics on different scales was finally obtained according to the mean differences and standard deviations which were displayed in the fifth column. Similarly, columns 2 through 5 are shown in Table 11 to demonstrate the differences between PSO-LS and GA on all scales. When the computed t-statistics was greater than tα=0.05n−1=2.1318, PSO-LS was considered to have better performance than PSO for problems of the corresponding numbers of jobs. In the fifth column of the two tables, the data greater than 2.1318 have been highlighted to show that PSO-LS is better for problems with corresponding number of jobs.Table 10
Statistical analysis between PSO and PSO-LS.
ScalePSO-PSO-LSd¯1sD1t1d¯2sD2t2d¯sDt103.180.462.230.46706.17914.752.9991,107.10193,487.232.580.101.08−2.970.9230−17.98206.77183.552.52475.42109.38257.63209.42502,289.551,911.28381.2411.211,855.262,293.521,416.031,702.03708,240.456,968.261,473.1810.58181,508.02245,021.922.876,476.787,675.617,838.764,609.6910020,988.6226,774.624,582.8713.0622,848.0028,840.5729,700.5731,495.35300587,582.24510,781.1981,041.4114.09498,674.56450,710.15599,592.10417,346.92Table 11
Statistical analysis between GA and PSO-LS.
ScaleGA-PSO-LSd¯1sD1t1d¯2sD2t2d¯sDt100.001.542.021.712,303.793,501.792.553,501,909.837,880,984.742.430.000.394.462.8530−231.73435.29430.872.26919.69475.85346.14666.50503,237.936,474.533,162.234.5810,406.825,416.819,192.884,118.227023,281.2824,635.244,606.3011.967,001,515.8810,119,889.352.6818,945.3022,429.5028,031.2330,488.91100164,871.51191,098.6327,433.9715.58174,808.61186,477.75193,162.81236,172.4630021,648,450.1820,788,813.761,416,510.1832.8221,872,173.5520,356,950.3321,580,033.3818,486,461.34In addition, to analyze PSO-LS performance in small- and large-scale problems, the sample size isn = 15, and when t−statistic=d¯/sd/n>tα=0.05n−1=1.7613, PSO-LS is considered statistically better in large- or small-scale problems significantly. The figures were placed in columns 6 through 8 of Tables 10 and 11. Column 8 was the t-statistics for small-scale problems and large-scale problems, and the data greater than tα=0.05n−1=1.7613 were shown in bold.In order to analyze the differences between PSO-LS and PSO and GA in general, whent−statistic=d¯/sd/n>tα=0.05n−1=1.6991, PSO-LS was considered statistically better. The mean of differences, the standard deviations, and t-statistics are shown in the last three columns of Tables 10 and 11. The numbers greater than 1.6991 were bold.In order to analyze the effectiveness of PSO-LS against basic PSO, the differences, the averages of differences, andt-statistics are shown in Table 10. The gap is the difference of TWT obtained by PSO and by PSO-LS, d¯1 is the mean of the differences calculated from 5 instances with the same job size, sD1 is the standard deviation related to d¯1, and then, the t-statistics of each scales, t1, can be obtained by d¯1/sD1/5. We can also calculate the t-statistics by the small-scale and the large-scale, t2, by d¯2/sD2/15, where d¯2 is the mean of the gaps from the small-scale category and large-scale, while sD2 is their related standard deviation. Similarly, we can obtain t = 1.26 by d¯/sD/30, where d¯=684,186.52 and sD=2,984,291.44 for the overall data obtained from PSO and PSO-LS.Similar to Table10, Table 11 is also given to analyze the performances of PSO-LS compared with GA.The observations from the displayed results are shown as follows.As for the comparison between PSO and PSO-LS, PSO-LS is statistically better than the basic PSO significantly according to Table10 because the differences between the PSO and PSO-LS were almost greater than zero (except for 10-4 and 30-1 in Table 9) and the t-statistics for all the differences was 2.58 which was greater than tα=0.0529 (1.6991). As for performance of solving problems with the same number of jobs, t-statistics in the t1 column was greater than tα=0.054 (2.1318), only except for the problems with 10 jobs, which demonstrated the superior performance of PSO-LS than that of PSO except for the 10-scale problems. T-statistics in t2 is both larger than tα=0.0514 (1.7613). This can be attributed to the effectiveness of the local search strategy, by which a better gbest, as the global leader which the whole particle swarm depends on, may be found in each iteration with just a little more time cost because the insertion operator is simple, efficient, and time-saving. Besides, there was a increasing tendency of t-statistics with the increase in the number of jobs, starting with 0.46 and reaching the top at 14.09 by the scale 300, which meant the local search strategy improved the search capability as the complex of problems increases, although on small scales such as scale 10, it did not have significant advantages. Moreover, t-statistics in column t2 and t is much smaller than 14.09 obtained by scale 300 because the differences in objective function values of problems in different scales vary dramatically, giving rise to large standard deviations which can bring a smaller t-statistics, according to the equation of t-statistic, i.e., d¯/SD/n. Standard deviation depends on the difference in instances, which can be considered as a property of problems.As for the comparison between GA and PSO-LS,t-statistics was equal to 2.43 for all the gaps between GA and PSO-LS and the t-statistics is larger than tα=0.0529 (1.6991). So PSO-LS was significantly better than GA generally. PSO framework was time-saving, which gave rise to less time cost within each iteration so that within the executing time limit, the number of iterations of PSO-LS can be more, compared with the GA algorithm with relatively complex operators of selection, crossover, and mutation. Moreover, the local search strategy with the efficient insertion operator tailored specifically for this problem improved gbest which all the particles rely heavily on to update their states, leading to improvement in almost each iteration. Because of the energy constraints, the insertion operator can cause great changes. However, the operators of GA, such as crossover and mutation, can bring less diversity of offspring, and good genes might be likely to be lost in inheritance.There are more information between PSO-LS and GA in detail. Firstly, when the number of jobs was 10, GA had a slightly larger average TWT than PSO-LS at most instances, except for instances 10-1 and 10-2 in Table9, but the gaps between the objective function values obtained by PSO-LS and GA were smaller than 5.00 in all instances, which is shown in Table 11. The t-statistics of the gaps between GA and PSO-LS was 1.71, which was smaller than tα=0.054=2.1318. So, when the number of jobs was 10, PSO-LS was slightly better than GA and there was no statistically significant differences between them. This was because the problems with 10 jobs were not difficult and algorithms had converged or was close to converging within 1 second.Secondly, when the number of jobs was 30, PSO-LS obtained the fewest points compared with PSO and GA except for 30-1, as shown in Table9. So the differences between GA and PSO-LS were mostly nonnegative in Table 11. The t-statistics of the gaps was 2.26, which was greater than tα=0.054=2.1318, according to which the PSO-LS was statistically better than GA.Thirdly, when the number of jobs was larger than 30, PSO-LS was much more effective than PSO and GA, as displayed in Table9.According to thet1 column in Table 11, the t-statistics of gaps of TWT obtained from GA and PSO-LS was 4.58, 11.96, 15.58, and 32.82 for scale from 50 to 300, which were all significantly larger than tα=0.054=2.1318. And t-statistics in column t1 had an upward trend with the increase in jobs, which illustrated the superior performance of PSO-LS than GA especially for large-scale problems.As fort-statistics of differences between GA and PSO for the small-scale and large-scale problems, according to column t2 in Table 11, they were 2.55 and 2.68, respectively, which were both greater than tα=0.0514=1.7613. It shows good global searching capability of PSO-LS against GA.In conclusion, PSO-LS has a strong search capability for finding more optimal solutions than those obtained by basic PSO and GA. The larger the number of jobs, the larger the gap in the results between PSO-LS and GA. Because of local search strategy, PSO-LS is statistically better than the basic PSO and GA significantly.


## 4.1. Problem Data Setting

Before we started the experiment, the data of problems are given as follows:(i)
The processing time of jobi, pi, is uniformly generated in the range unif1,10.(ii)
The electricity consumption of jobi, Ai, is distributed from the uniform unif3,15.(iii)
The due time of jobi, di, is distributed from the uniform unif5,5×n.(iv)
The importance of jobi, wi, is distributed from the uniform unif1,n.All the problems handled in the experiments were generated randomly based on the distributions.


## 4.2. Algorithm Parameters Setting

We used the Taguchi method [24] for parameter selection.Taguchi method is also called the orthogonal experimental design which is used to determine the value of each factor especially when the number of factors and factor levels are greater than 3. Based on orthogonal tables, the number of experiments can be greatly decreased. The brief steps of the Taguchi method are as follows: firstly, determine responses, factors, and levels; secondly, select appropriate orthogonal tables; thirdly, execute the experiments according to orthogonal tables and fill the tables with experimental results; then, analyze the results and determine the factor level combination; and at last, verify the effectiveness of the selected levels of factors.We took the size of swarm, weight,c1, c2, and Vmax as factors for the PSO algorithm. We also took the size of population, the probability of crossover pc, the probability of mutation pm, and the other two parameters related to mutations θ and D as the factors for the GA algorithm. Each factor of both algorithms took 4 levels, as shown in Tables 3 and 4.Table 3
Levels of parameters for PSO.
ParameterSize50100150200Weight0.60.70.80.9c10.010.050.10.15c20.30.60.80.95Vmax1234Table 4
Levels of parameters for GA.
ParameterSize50100150200pc0.30.50.70.9pm0.30.50.70.9θ0.690.790.890.99D0.650.750.850.95We conducted 16 experiments according to the orthogonal tables of parameters of each algorithm, as shown in Tables5 and 6.Table 5
Orthogonal table for parameters for PSO.
No.SizeWeightc1c2VmaxSmall-scaleLarge-scale1500.60.010.316150.0400125,285.86102500.70.050.624532.949091,016.69453500.80.10.833702.433573,910.10904500.90.150.9543018.055038,671.730051000.60.050.843867.686589,791.167061000.70.010.9533531.786071,033.745071000.80.150.324092.915084,425.593081000.90.10.613051.151552,046.650091500.60.10.9523695.036575,719.6005101500.70.150.813517.028067,949.1885111500.80.010.643122.311060,491.8475121500.90.050.333132.798057,114.9990132000.60.150.634070.935581,141.6650142000.70.10.343676.878583,755.1865152000.80.050.9513137.842049,046.6995162000.90.010.822761.621534,490.5440Table 6
Orthogonal table for parameters for GA.
No.SizepcpmθDSmall-scaleLarge-scale1500.30.30.690.654220.1760117,609.06452500.50.50.790.753879.6515108,405.69153500.70.70.890.853905.2175102,019.34254500.90.90.990.953706.756093,161.175051000.30.50.890.953317.076092,678.022061000.50.30.990.853505.2000108,444.703571000.70.90.690.753510.147089,561.192581000.90.70.790.653656.2845106,062.773091500.30.70.990.753064.300579,132.2530101500.50.90.890.653145.214077,560.3880111500.70.30.790.953470.5435111,862.9095121500.90.50.690.853331.9765101,187.5760132000.30.90.790.852951.099572,115.2650142000.50.70.690.953014.659580,158.9815152000.70.50.990.653223.180590,552.2890162000.90.30.890.753291.8940113,233.6705Considering that the problems on different scales may take different parameter levels to obtain effective search capabilities, we set the means of TWT of a random small-scale problem and a random large-scale problem as responses. A problem with 30 jobs was used as the small-scale problem and 70 jobs as the large-scale problem. To eliminate as much random interference as possible, the average value of the objective function value resulting from 20 executions of each algorithm was taken as the response.After the tables were designed and filled, we needed to select parameters for the PSO and GA algorithms by analyzing Tables5 and 6.Then, we needed to decide which level would be selected for each factor. We selected the factor of the size of the particle swarm for the small-scale problem as an example, as shown in the line on the top left of Figure5. Firstly, let us consider the situation where size equals 50. According to Table 5, the average of TWT for a size of 50 for the small-scale problem can calculated by the mean of the small-scale response of the first, second, third, and fourth experiments. That is, 6150.0400+4532.9490+3702.4335+3018.0550/4=4350.869375. Secondly, similarly, we can obtain 3635.88475 for level 100, 3366.793375 for level 150, and 3411.819375 for level 200. Thirdly, we determine the best parameter of 150 for the small-scale problem for PSO because level 150 has the smallest mean TWT of 3366.793375.Figure 5
Influence of the key parameters for PSO.The average responses at different levels for each factor need to be calculated, and then, the level of each factor with the smallest mean TWT is chosen. We performed this procedure on other factors for PSO and all the factors for GA for both the small- and large-scale problems. The main effect plots for PSO and GA are shown in Figures5 and 6, respectively. The lowest points of these lines are taken as the value for each parameter for the algorithms.Figure 6
Influence of the key parameters for GA.As such, we determined all the parameter values for each algorithm. For the PSO algorithm, the values of the size of swarm, weight,c1, c2, m, and Vmax are 150, 0.9, 0.1, 0.95, and 4 for the small-scale problem and 200, 0.9, 0.15, 0.95, and 4 for the large-scale problem, respectively. For the GA algorithm, similarly, the size of population, the probability of crossover pc, the probability of mutation pm, and the other two parameters relating to mutations θ and D are 200, 0.5, 0.9, 0.99, and 0.95 for the small-scale problem and 200, 0.3, 0.9, 0.99, and 0.95 for the large-scale problem, respectively.In order to verify the effectiveness of selected levels of factors by the Taguchi method, the responses of the selected parameter values need to be compared with that of all the level combinations displayed in Figures 5 and 6. Problems of size 30 and size 70 are generated randomly, and their results are displayed in Tables 7 and 8. The values of line 17 in both figures are the levels for factors selected for small-scale problems and line 18 for large-scale problems. It can be seen from the two tables that the fitness obtained by the levels of factors selected for the small-scale problems is the smallest among the other values in the same column. The TWT obtained by the levels of factors chosen for the large-scale problems is also the smallest among the other data in the same column. Therefore, the parameter selections for PSO and GA by the Taguchi method are effective.Table 7
The effectiveness of parameter selection for PSO.
No.SizeWeightc1c2VmaxSmall-scaleLarge-scale1500.60.010.317802.857781944.09552500.70.050.625892.0415692195.53853500.80.10.835343.4035642169.63654500.90.150.9544433.615504850.229551000.60.050.845659.695658437.44861000.70.010.9535036.7085603161.16671000.80.150.325346.9595631647.51281000.90.10.614541.963546953.601591500.60.10.9525399.3495625364.341101500.70.150.814936.6025620230.085111500.80.010.644620.1865570452.559121500.90.050.334676.6135554409.8515132000.60.150.635393.4215624672.711142000.70.10.345250.421635595.3965152000.80.050.9514489.3905538767.257162000.90.010.824074.7515487169.7495172000.90.10.9544046.7475483691.6605182000.90.150.9544124.0595479002.7685Table 8
The effectiveness of parameter selection for GA.
No.SizepcpmθDSmall-scaleLarge-scale1500.30.30.690.655877.824814077.77252500.50.50.790.755532.903781673.4133500.70.70.890.854947.04750002.86754500.90.90.990.955080.9145768124.555551000.30.50.890.954915.209738638.40861000.50.30.990.855123.6145791738.01671000.70.90.690.754637.9835751141.205581000.90.70.790.654943.807778180.74191500.30.70.990.754400.202720077.3955101500.50.90.890.654431.645691519.7225111500.70.30.790.954864.1745786077.9255121500.90.50.690.854664.906792386.35132000.30.90.790.854357.5805684881.422142000.50.70.690.954431.7005722812.895152000.70.50.990.654511.614747950.5375162000.90.30.890.755038.0215769743.4985172000.50.90.990.954296.492686883.08182000.30.90.990.954335.9145681536.872


## 4.3. Performance Comparison

We compared the results of PSO-LS, PSO, and GA for problems on six different scales: 10, 30, 50, 70, 100, and 300 jobs. Problems with fewer than 70 jobs were considered small-scale; otherwise, they were considered large-scale.When solving these two sets of problems on different scales, the algorithms choose the values of parameters of the corresponding scale, which was obtained in the previous section.For each scale, five different instances were randomly generated. When solving each problem, each algorithm was independently executed 20 times, and the average value of these 20 results was recorded to reduce the differences in the random initial solutions.Each algorithm executes the same duration for each run. All algorithms were executed in 1, 10, 30, 50, 100, and 100 s, which correspond to solving problems with 10, 30, 50, 70, 100, and 300 jobs, respectively. For small-scale problems, the algorithms almost converge within the setting time, so we compare the results of each algorithm when the algorithms converge. For large-scale problems, because of the difficulty in the problems, algorithms cannot converge in a short time, so we let the algorithm run enough time to see, which makes the results closer to the optimal solutions. Since time is vital to production environment, it is important to get a better satisfactory solution in a shorter time. Therefore, the computational time rather than the number of iterations is controlled for the computational experiments.For the 20 runs, the comparison results of the average TWT obtained by PSO-LS, PSO, and GA are shown in Table9.Table 9
Comparison of the mean TWT.
Scale-instancePSO-LSPSOGA10-1666.8100669.9850666.810010-2186.3200186.4200186.320010-3273.2200274.3000273.615010-4232.3720229.3980236.833010-51,114.73001,115.65401,117.578030-14,956.70304,938.72204,724.978030-218,087.658018,563.079019,007.344030-36,810.15006,919.53207,286.000030-49,355.27409,612.90009,701.413030-510,393.877010,603.297011,060.379050-147,373.079049,662.628050,611.010050-268,891.757070,747.014079,298.578050-361,826.237064,119.760067,243.050050-468,777.671070,193.705077,970.551050-529,073.968030,776.000033,192.183070-1135,271.7270143,512.1820158,553.003070-2164,900.6270171,377.4080183,845.925070-3128,195.6660135,871.2800150,625.168070-4110,219.4880118,058.2520138,250.718070-5161,958.1090166,567.7950192,447.0210100-1287,348.7000308,337.3160452,220.2050100-2316,831.4730339,679.4730491,640.0870100-3363,915.9090392,756.4790550,393.6550100-4512,024.2470541,724.8160705,187.0550100-5352,616.9280384,112.2770588,789.3920300-113,726,081.649014,313,663.888035,374,531.8320300-212,896,793.116013,395,467.677034,768,966.6680300-310,358,806.233010,809,516.379030,715,756.5610300-413,422,518.767014,022,110.864035,002,552.1430300-510,851,867.171011,269,214.088029,338,328.5100Pairedt-tests were to be conducted with a significance level α=0.05 to analyze the performance of PSO-LS compared with both basic PSO and GA.For the same scale of problems, the differences in the objective function values obtained by PSO-LS and PSO shown in Table9 can be obtained by Di=PSOi−PSO-LSi, where i=1,…,5, which are normally distributed; thus, D∼NuD,sD2. We wish to test the hypothesis:H0:uD≤0,H1:uD>0..The number of samples, the sample mean, and the sample standard deviation aren, d¯, and sd accordingly. If t−statistic=d¯/sD/n>tα=0.05n−1, H0 is rejected and ud>0. That is, PSO has a greater fitness than PSO-LS, so the performance of PSO-LS is better than PSO. Otherwise, PSO-LS is considered to have no obvious advantages.We used the above method to test the performance of PSO-LS compared to PSO at all scales. Firstly, subtract the value of the PSO-LS column from that of the PSO column in Table9 and obtain the data of the second column in Table 10. Values greater than 0 indicate that PSO-LS is better. Then, the mean and standard deviation of differences on different problem sales are calculated including 10, 30, 50, 70, 100, and 300, and the results are recorded in the third and fourth columns in Table 10, respectively. T-statistics on different scales was finally obtained according to the mean differences and standard deviations which were displayed in the fifth column. Similarly, columns 2 through 5 are shown in Table 11 to demonstrate the differences between PSO-LS and GA on all scales. When the computed t-statistics was greater than tα=0.05n−1=2.1318, PSO-LS was considered to have better performance than PSO for problems of the corresponding numbers of jobs. In the fifth column of the two tables, the data greater than 2.1318 have been highlighted to show that PSO-LS is better for problems with corresponding number of jobs.Table 10
Statistical analysis between PSO and PSO-LS.
ScalePSO-PSO-LSd¯1sD1t1d¯2sD2t2d¯sDt103.180.462.230.46706.17914.752.9991,107.10193,487.232.580.101.08−2.970.9230−17.98206.77183.552.52475.42109.38257.63209.42502,289.551,911.28381.2411.211,855.262,293.521,416.031,702.03708,240.456,968.261,473.1810.58181,508.02245,021.922.876,476.787,675.617,838.764,609.6910020,988.6226,774.624,582.8713.0622,848.0028,840.5729,700.5731,495.35300587,582.24510,781.1981,041.4114.09498,674.56450,710.15599,592.10417,346.92Table 11
Statistical analysis between GA and PSO-LS.
ScaleGA-PSO-LSd¯1sD1t1d¯2sD2t2d¯sDt100.001.542.021.712,303.793,501.792.553,501,909.837,880,984.742.430.000.394.462.8530−231.73435.29430.872.26919.69475.85346.14666.50503,237.936,474.533,162.234.5810,406.825,416.819,192.884,118.227023,281.2824,635.244,606.3011.967,001,515.8810,119,889.352.6818,945.3022,429.5028,031.2330,488.91100164,871.51191,098.6327,433.9715.58174,808.61186,477.75193,162.81236,172.4630021,648,450.1820,788,813.761,416,510.1832.8221,872,173.5520,356,950.3321,580,033.3818,486,461.34In addition, to analyze PSO-LS performance in small- and large-scale problems, the sample size isn = 15, and when t−statistic=d¯/sd/n>tα=0.05n−1=1.7613, PSO-LS is considered statistically better in large- or small-scale problems significantly. The figures were placed in columns 6 through 8 of Tables 10 and 11. Column 8 was the t-statistics for small-scale problems and large-scale problems, and the data greater than tα=0.05n−1=1.7613 were shown in bold.In order to analyze the differences between PSO-LS and PSO and GA in general, whent−statistic=d¯/sd/n>tα=0.05n−1=1.6991, PSO-LS was considered statistically better. The mean of differences, the standard deviations, and t-statistics are shown in the last three columns of Tables 10 and 11. The numbers greater than 1.6991 were bold.In order to analyze the effectiveness of PSO-LS against basic PSO, the differences, the averages of differences, andt-statistics are shown in Table 10. The gap is the difference of TWT obtained by PSO and by PSO-LS, d¯1 is the mean of the differences calculated from 5 instances with the same job size, sD1 is the standard deviation related to d¯1, and then, the t-statistics of each scales, t1, can be obtained by d¯1/sD1/5. We can also calculate the t-statistics by the small-scale and the large-scale, t2, by d¯2/sD2/15, where d¯2 is the mean of the gaps from the small-scale category and large-scale, while sD2 is their related standard deviation. Similarly, we can obtain t = 1.26 by d¯/sD/30, where d¯=684,186.52 and sD=2,984,291.44 for the overall data obtained from PSO and PSO-LS.Similar to Table10, Table 11 is also given to analyze the performances of PSO-LS compared with GA.The observations from the displayed results are shown as follows.As for the comparison between PSO and PSO-LS, PSO-LS is statistically better than the basic PSO significantly according to Table10 because the differences between the PSO and PSO-LS were almost greater than zero (except for 10-4 and 30-1 in Table 9) and the t-statistics for all the differences was 2.58 which was greater than tα=0.0529 (1.6991). As for performance of solving problems with the same number of jobs, t-statistics in the t1 column was greater than tα=0.054 (2.1318), only except for the problems with 10 jobs, which demonstrated the superior performance of PSO-LS than that of PSO except for the 10-scale problems. T-statistics in t2 is both larger than tα=0.0514 (1.7613). This can be attributed to the effectiveness of the local search strategy, by which a better gbest, as the global leader which the whole particle swarm depends on, may be found in each iteration with just a little more time cost because the insertion operator is simple, efficient, and time-saving. Besides, there was a increasing tendency of t-statistics with the increase in the number of jobs, starting with 0.46 and reaching the top at 14.09 by the scale 300, which meant the local search strategy improved the search capability as the complex of problems increases, although on small scales such as scale 10, it did not have significant advantages. Moreover, t-statistics in column t2 and t is much smaller than 14.09 obtained by scale 300 because the differences in objective function values of problems in different scales vary dramatically, giving rise to large standard deviations which can bring a smaller t-statistics, according to the equation of t-statistic, i.e., d¯/SD/n. Standard deviation depends on the difference in instances, which can be considered as a property of problems.As for the comparison between GA and PSO-LS,t-statistics was equal to 2.43 for all the gaps between GA and PSO-LS and the t-statistics is larger than tα=0.0529 (1.6991). So PSO-LS was significantly better than GA generally. PSO framework was time-saving, which gave rise to less time cost within each iteration so that within the executing time limit, the number of iterations of PSO-LS can be more, compared with the GA algorithm with relatively complex operators of selection, crossover, and mutation. Moreover, the local search strategy with the efficient insertion operator tailored specifically for this problem improved gbest which all the particles rely heavily on to update their states, leading to improvement in almost each iteration. Because of the energy constraints, the insertion operator can cause great changes. However, the operators of GA, such as crossover and mutation, can bring less diversity of offspring, and good genes might be likely to be lost in inheritance.There are more information between PSO-LS and GA in detail. Firstly, when the number of jobs was 10, GA had a slightly larger average TWT than PSO-LS at most instances, except for instances 10-1 and 10-2 in Table9, but the gaps between the objective function values obtained by PSO-LS and GA were smaller than 5.00 in all instances, which is shown in Table 11. The t-statistics of the gaps between GA and PSO-LS was 1.71, which was smaller than tα=0.054=2.1318. So, when the number of jobs was 10, PSO-LS was slightly better than GA and there was no statistically significant differences between them. This was because the problems with 10 jobs were not difficult and algorithms had converged or was close to converging within 1 second.Secondly, when the number of jobs was 30, PSO-LS obtained the fewest points compared with PSO and GA except for 30-1, as shown in Table9. So the differences between GA and PSO-LS were mostly nonnegative in Table 11. The t-statistics of the gaps was 2.26, which was greater than tα=0.054=2.1318, according to which the PSO-LS was statistically better than GA.Thirdly, when the number of jobs was larger than 30, PSO-LS was much more effective than PSO and GA, as displayed in Table9.According to thet1 column in Table 11, the t-statistics of gaps of TWT obtained from GA and PSO-LS was 4.58, 11.96, 15.58, and 32.82 for scale from 50 to 300, which were all significantly larger than tα=0.054=2.1318. And t-statistics in column t1 had an upward trend with the increase in jobs, which illustrated the superior performance of PSO-LS than GA especially for large-scale problems.As fort-statistics of differences between GA and PSO for the small-scale and large-scale problems, according to column t2 in Table 11, they were 2.55 and 2.68, respectively, which were both greater than tα=0.0514=1.7613. It shows good global searching capability of PSO-LS against GA.In conclusion, PSO-LS has a strong search capability for finding more optimal solutions than those obtained by basic PSO and GA. The larger the number of jobs, the larger the gap in the results between PSO-LS and GA. Because of local search strategy, PSO-LS is statistically better than the basic PSO and GA significantly.


## 5. Conclusion

In this paper, we studied a single-machine scheduling problem with energy consumption limits to minimize total weighted tardiness. Based on the basic PSO algorithm, a local search was designed to be embedded in the algorithm as PSO-LS to improve the performance of the original algorithm, which is one aspect of our main contribution. Another aspect of our contribution is the constraint handling process tailored for this problem, which was used to determine the start processing time and completion time of each job to obtain total weighted tardiness as the objective function value. The constraint handling process considers the actual production environment, reserving two efficiencies for starting processing time to be accurate to the seconds and using as much energy in each time window as possible without violating energy constraints.Experimental results showed that this enhanced algorithm, PSO-LS, is more effective than the original PSO and GA algorithms especially for large-scale problems, which demonstrated the effectiveness of our algorithm design.This research can be extended in the following aspects: first, more operators inside PSO could be developed to improve the performance of local search; second, other methods such as the adaptive large neighborhood search algorithm (ALNS) [25] could be used to bring more diversity of particles; third, initialization methods of PSO could be taken into account to improve both the diversity of particles and the goodness of initial solution; fourth, energy consumption limits with uncertainty can be taken into account to meet more complex production environment; fifth, other PSO variants such as binary PSO [26] can be considered to be used as the algorithm framework to handle the discrete problem. These issues will be addressed in the further studies.



---

*Source: 8870917-2020-11-05.xml*