A New Greedy Insertion Heuristic Algorithm with a Multi-Stage Filtering Mechanism for Energy-Efficient Single Machine Scheduling Problems

To improve energy efficiency and maintain the stability of the power grid, time-of-use (TOU) electricity tariffs have been widely used around the world, which bring both opportunities and challenges to the energy-efficient scheduling problems. Single machine scheduling problems under TOU electricity tariffs are of great significance both in theory and practice. Although methods based on discrete-time or continuous-time models have been put forward for addressing this problem, they are deficient in solution quality or time complexity, especially when dealing with large-size instances. To address large-scale problems more efficiently, a new greedy insertion heuristic algorithm with a multi-stage filtering mechanism including coarse granularity and fine granularity filtering is developed in this paper. Based on the concentration and diffusion strategy, the algorithm can quickly filter out many impossible positions in the coarse granularity filtering stage, and then, each job can find its optimal position in a relatively large space in the fine granularity filtering stage. To show the effectiveness and computational process of the proposed algorithm, a real case study is provided. Furthermore, two sets of contrast experiments are conducted, aiming to demonstrate the good application of the algorithm. The experiments indicate that the small-size instances can be solved within 0.02 s using our algorithm, and the accuracy is further improved. For the large-size instances, the computation speed of our algorithm is improved greatly compared with the classic greedy insertion heuristic algorithm.


Introduction
Driven by the rapid development of global economy and civilization, there will be a consistent growth in energy consumption in the years ahead.According to a survey of the International Energy Agency (IEA), the world-wide demand for energy will increase by 37% by 2040 [1].Non-renewable energy resources such as coal, oil, and gas are diminishing day-by-day, which is threatening the sustainable development of many countries.Meanwhile, greenhouse gas emissions generated from inappropriate usage of fossil fuels have taken a heavy toll on the global climate as well as the atmospheric environment [2].Therefore, how to save energy and then improve the environment quality has become a pressing matter of the moment.
As the backbone of many countries, the industrial sector consumes about half of the world's total energy and emits the most greenhouse gases [3,4].Hence, energy saving in the industry sector has priority in promoting sustainable economic development.As we all know, most of the energy is converted into the form of electricity that numerous industrial sectors use as their main energy [5,6].
Nevertheless, electricity is hard to store effectively, and thus, must be produced and delivered to its customers at once [7].In addition, the electricity demand is always uneven, which leads to an increase in generating cost owing to the utilization of backup power facilities during peak hours [8].In order to maintain balance between electricity supply and demand, electricity providers usually implement demand-side management programs [9], which are an essential component of realizing the goals of a smart grid and rationalizing the allocation of power resources [10].
One of the demand-side management programs is time-of-use (TOU) electricity tariffs, which have been widely used around the world.Usually, a common TOU tariff scheme can be divided into three types of periods: off-peak, mid-peak, and on-peak periods.The basic nature of the TOU scheme is that the retail prices set by electricity providers vary hourly throughout the day according to the amount of electricity demands; when there is an increase in demand, the electricity cost goes up correspondingly, and vice versa [11].The practice of TOU electricity tariffs not only provides significant opportunities for the industrial sector to enhance energy efficiency, but also avoids power rationing during on-peak periods, and improves the stability of the power grid [7].
Using low-energy equipment and improving the efficiency of production management are two important methods to save energy [12].As a widely used production management method, scheduling can effectively control energy consumption [13], which brings a lower cost of operation.However, the studies about energy-saving scheduling are still limited [14].Over recent years, energy-efficient scheduling problems have gradually aroused the attention of scholars.To achieve the goal of energy saving during the production process, some researchers have investigated the problems with various energy-efficient mechanisms to reduce electricity costs by minimizing overall energy consumption, such as speed-scaling [15][16][17][18] and power-down [19][20][21], while others have studied the problems from the perspective of TOU electricity tariffs, which has become a frontier issue in this field.
As for researching scheduling problems under TOU electricity tariffs, there has been a growing interest recently.Considering both production and energy efficiency, Luo et al. [22] proposed an ant colony optimization meta-heuristic algorithm for hybrid flow shop scheduling problems under TOU electricity tariffs.Zhang et al. [12] studied a flow shop scheduling problem with production throughput constraints to minimize electricity cost and the carbon footprint simultaneously.Sharma et al. [23] presented a so called "econological scheduling" model for a speed-scaling multi-machine scheduling problem aimed to minimize the electricity cost and environmental impact.Moon et al. [24] examined the unrelated parallel machine scheduling problem under TOU electricity tariffs to optimize the weighted sum of makespan and electricity cost.Ding et al. [7] and Che et al. [25] addressed a similar parallel machine scheduling problem under TOU electricity tariffs to minimize the total electricity cost.The former developed a time-interval-based mixed-integer linear programming (MILP) model and a column generation heuristic algorithm.The latter improved the former model by providing a linear programming relaxation and a two-stage heuristic algorithm.
Single machine scheduling problems are of great significance both in theory and practice.On one hand, there are many single machine scheduling problems in the real industrial environment.For example, a Computer Numerical Control (CNC for short) planer horizontal milling and boring machine can be regarded as a single machine.On the other hand, the research results and methods of single machine scheduling problems can provide reference for other scheduling problems, such as flow shop, job shop, and parallel machine scheduling problems.For single machine scheduling problems under TOU electricity tariffs, Wang et al. [26] investigated a single-machine batch scheduling problem to minimize the makespan and the total energy costs simultaneously.Considering the TOU electricity tariffs and the power-down mechanism, Shrouf et al. [27] proposed a model that enables the operations manager to determine the "turning on" time, "turning off" time, and idle time at machine level, leading to a significant reduction in electricity cost by avoiding on-peak periods.Gong et al. [28] developed a mixed integer linear programming model and a genetic algorithm for the same problem, reducing electricity cost and greenhouse gas emissions effectively during peak time periods.Without considering a power-down mechanism, Fang et al. [29] studied the single machine scheduling problem under TOU electricity tariffs systematically to minimize the total electricity costs.They divided the problem into the two cases of uniform-speed and speed-scalable, in which a preemptive version and a non-preemptive version were investigated respectively.For the uniform-speed case with non-preemptive assumption (Problem U-pyr), they demonstrated that the problem is strongly non-deterministic polynomial-time hard (NP-Hard).Note that the Problem U-pyr is the same as our problem.Based on Fang et al. [29], Che et al. [9] investigated a continuous-time MILP model for Problem U-pyr and developed a greedy insertion heuristic algorithm(GIH) that is the most classic method for this problem until now, according to our best knowledge.In their algorithm, the jobs are inserted into available periods with lower electricity prices in sequence, and the jobs with higher power consumption rates are mostly assigned to periods with lower electricity prices by traversing all non-full "forward blocks" and "backward blocks".
However, Fang et al. [29] did not establish a complete mathematical model for the single machine scheduling problem (Problem U-pyr) under TOU electricity tariffs, and their algorithm is only feasible in the condition that all the jobs have the same workload and the TOU tariffs follow a so-called pyramidal structure.Regrettably, the TOU electricity tariffs rarely follow a complete pyramidal structure in most provinces in China.To perfect the theory of Fang et al. [29], Che et al. [9] developed a new model and algorithm, but their algorithm requires that all the jobs must traverse all non-full "forward blocks" and "backward blocks", causing a strong high-time complexity.Especially when the processing times of the jobs are relatively short, it usually takes several jobs to fill one period and generates uneven remaining idle times, which leads to an increase in the number of forward and backward blocks required to be calculated.In addition, the generation process of "forward (backward) block" is limited to the job movements that do not incur additional electricity cost, which may cause some jobs to miss the optimum positions.
Thus, by focusing on the jobs with short processing times, this paper proposes a more efficient greedy insertion algorithm with a multi-stage filtering mechanism (GIH-F) based on the continuous-time MILP model to address these issues.The proposed algorithm mainly consists of two stages: coarse granularity filtering and fine granularity filtering.In the coarse granularity filtering stage, all the possible positions are first divided into three levels (i.e., three layers) according to the price of electricity, corresponding to high-price, medium-price, and low-price layers.Then, all the jobs are sorted in non-increasing order of their electricity consumption rates and assigned to the layer with a lower price successively.Based on the concentration and diffusion strategy, once the layer to which a job belongs is determined, the hunting zone of possible positions of a job is concentrated in a certain layer.To find the optimal position, the job to be inserted can search for its position in a relatively large space in the selected layer.Then, considering processing times, electricity consumption rates of the jobs and electricity prices, the electricity cost with respect to each possible position can be compared using characteristic polynomials.Based on these, several judgment conditions can be set up in for a fine granularity filtering stage to determine the position of each job to be inserted.
To summarize, the proposed algorithm can filter out impossible layers, and then judge each condition that belongs to the selected layer successively.Once the condition is satisfied, the job is just inserted into the corresponding position.Through coarse granularity filtering and fine granularity filtering, our algorithm does not have to traverse all possible positions, which leads to a great reduction in the time complexity.A real case study and two sets of randomly generated instances are used to test the performance of the proposed algorithm in this paper.
The rest of this paper is organized as follows.Section 2 presents a description of the single machine scheduling problem under TOU electricity tariffs.In Section 3, an efficient GIH-F is developed.Next, a real case study and two sets of experimental tests are provided in Section 4. Finally, the conclusions and prospects are presented in Section 5.

MILP Formulation for the Problem
This paper studies an energy-efficient single machine scheduling problem under TOU electricity tariffs.The problem can also be called a single machine scheduling problem with electricity costs (SMSEC).Consider a set of jobs N = {1, 2, . . ., n} that need to be processed on a single machine with the objective of minimizing the electricity cost.It is assumed that all the jobs must be processed at a uniform speed.Each job i ∈ N has its unique processing time t i and power consumption per hour p i .A machine can process, at most, one job at a time, and when it is processing a job, no preemption is allowed.Each job and the machine are available for processing at time instant 0. Machine breakdown and preventive maintenance are not considered in this paper.
The machine is mainly powered by electricity.The electricity price follows a TOU pricing scheme represented by a set of time periods M = {1, 2, . . ., m}, with each period k ∈ M, having an electricity price c k and a starting time b k .The interval of period k is represented by [b k , b k+1 ], k ∈ M, and b 1 = 0 is always established.It is assumed that the C max is the given makespan and b m+1 ≥ C max .This means that a feasible solution always exists.
The main work of this problem is to assign a set of jobs to periods with different electricity prices in the time horizon [0, b m+1 ] to minimize total electricity cost, and the main task is to determine to which period(s) a job is assigned and how long a job is processed in each period.Hence, two decision variables are given as follows.Note that the starting time of each job can be determined by the decision variables (i.e., x i,k and y i,k ).
x i,k : assigned processing time of job i in period k, i ∈ N, k ∈ M; In addition, a job is called processed within a period if both its starting time and completion time are within the same period.Otherwise, it is called processed across periods [9].Let d k and X k , k ∈ M, represent the duration of period k and the total already assigned processing times in period k, respectively.The difference between d k and X k is defined as the remaining idle time of period k which is represented by I k , k ∈ M. If I k = 0, the period k is called full.
The MILP model for the single machine scheduling problem can be presented as follows: (5) Equation ( 1), the objective is to minimize the total electricity cost (TEC).Constraints (2)-( 4) are associated with the processing time assigned to periods.Constraints ( 5) and ( 6) are used to guarantee the non-preemptive assumption.Specifically, constraint (5) guarantees that if a job is processed across more than one period, it must occupy several continuous periods.Constraint (6) ensures that if a job is processed across three periods, the middle period must be fully occupied by the job.Constraint (7) ensures that, at most, one job is processed across any pair of adjacent periods.An illustration to the MILP model is given by an example of a 2-job single machine scheduling problem under a 3-period TOU scheme, as shown in Figure 1.Note that more detailed explanations of the formulas can be seen in Che et al. [9].
Algorithms 2017, 10, x FOR PEER REVIEW 5 of 20 TOU scheme, as shown in Figure 1.Note that more detailed explanations of the formulas can be seen in Che et al. [9].

The Characteristics of TOU Electricity Tariffs
In China, the TOU electricity tariffs can be mainly divided into two types according to the relative position of the off-peak period: (1) the off-peak period lies between an on-peak period and a mid-peak period; (2) the off-peak period lies between two mid-peak periods.In addition, there is only one off-peak period in a day, and the duration of the off-peak period is longest.This paper will investigate the single-machine scheduling problem under the first type of TOU electricity tariffs, which are being implemented in many places in China, such as Shanxi, Guangxi, and Jiangxi Provinces and so on.Next, let A, B, and Γ represent the off-peak, mid-peak, and on-peak periods, respectively.That is, A, B, , and ∩ = ∅ Γ .B An illustration is given in Figure 2. Accordingly, M = {1, 2, …, 10}, A = {5, 10}, B = {1, 3, 6, 8}, and Γ = {2, 4, 7, 9}.

Multi-Stage Filtering Mechanism Design
The proposed algorithm is built on the concentration and diffusion strategy.Firstly, all the possible positions are divided into three layers based on the price of electricity.Specifically, in layer 1, all the jobs are processed within an off-peak period or processed across a pair of periods consisting of an off-peak period and a mid-peak period.In layer 2, the vast majority of the jobs are processed within a mid-peak period or processed across a set of adjacent periods consisting of an off-peak period, a mid-peak period, and an on-peak period.Obviously, the electricity prices corresponding to the positions in this layer are relatively higher than layer 1.In layer 3, the vast majority of the jobs are processed across a pair of periods consisting of a mid-peak period and an on-peak period or

The Characteristics of TOU Electricity Tariffs
In China, the TOU electricity tariffs can be mainly divided into two types according to the relative position of the off-peak period: (1) the off-peak period lies between an on-peak period and a mid-peak period; (2) the off-peak period lies between two mid-peak periods.In addition, there is only one off-peak period in a day, and the duration of the off-peak period is longest.This paper will investigate the single-machine scheduling problem under the first type of TOU electricity tariffs, which are being implemented in many places in China, such as Shanxi, Guangxi, and Jiangxi Provinces and so on.Next, let A, B, and Γ represent the off-peak, mid-peak, and on-peak periods, respectively.That is, A, B,

The Characteristics of TOU Electricity Tariffs
In China, the TOU electricity tariffs can be mainly divided into two types according to the relative position of the off-peak period: (1) the off-peak period lies between an on-peak period and a mid-peak period; (2) the off-peak period lies between two mid-peak periods.In addition, there is only one off-peak period in a day, and the duration of the off-peak period is longest.This paper will investigate the single-machine scheduling problem under the first type of TOU electricity tariffs, which are being implemented in many places in China, such as Shanxi, Guangxi, and Jiangxi Provinces and so on.Next, let A, B, and Γ represent the off-peak, mid-peak, and on-peak periods, respectively.That is, A, B,

Multi-Stage Filtering Mechanism Design
The proposed algorithm is built on the concentration and diffusion strategy.Firstly, all the possible positions are divided into three layers based on the price of electricity.Specifically, in layer 1, all the jobs are processed within an off-peak period or processed across a pair of periods consisting of an off-peak period and a mid-peak period.In layer 2, the vast majority of the jobs are processed within a mid-peak period or processed across a set of adjacent periods consisting of an off-peak period, a mid-peak period, and an on-peak period.Obviously, the electricity prices corresponding to the positions in this layer are relatively higher than layer 1.In layer 3, the vast majority of the jobs are processed across a pair of periods consisting of a mid-peak period and an on-peak period or

Multi-Stage Filtering Mechanism Design
The proposed algorithm is built on the concentration and diffusion strategy.Firstly, all the possible positions are divided into three layers based on the price of electricity.Specifically, in layer 1, all the jobs are processed within an off-peak period or processed across a pair of periods consisting of an off-peak period and a mid-peak period.In layer 2, the vast majority of the jobs are processed within a mid-peak period or processed across a set of adjacent periods consisting of an off-peak period, a mid-peak period, and an on-peak period.Obviously, the electricity prices corresponding to the positions in this layer are relatively higher than layer 1.In layer 3, the vast majority of the jobs are processed across a pair of periods consisting of a mid-peak period and an on-peak period or processed within an on-peak period.The electricity prices of the positions corresponding to 3rd layer are the highest.
Then, all the jobs are sorted in non-increasing order of their electricity consumption rates and assigned to the layer with a lower price successively to achieve the preliminary coarse granularity filtering target.Once the layer to which a job belongs is determined, the hunting zone of possible positions of a job is concentrated in a certain layer.In the fine granularity filtering stage, several judgment conditions are set up to determine the position of each job to be inserted using characteristic polynomials based on considering processing time, electricity consumption rate of the job, and electricity price.What is more, aiming to find the optimal position, the hunting zone of possible positions of a job is properly expanded in this stage.
Assuming that a job, say job i, whose processing time does not exceed the duration of the shortest on-peak period, is to be inserted, the idea of the proposed algorithm is given as follows.
Layer 1 includes conditions 1-2.If ∃k ∈ A, t i ≤ max k∈A {I k } + I k+1 , job i is assigned to layer 1. Obviously, at the very start, the off-peak periods are preferentially occupied by the jobs with high power consumption rates, since all the jobs are sorted in advance.
If Condition 1 is satisfied, job i can be directly processed within an off-peak period with the lowest electricity price.Note that each job processed within a period is placed to the leftmost side of the period.An illustration is given in Figure 3 (i.e., job 3 is a job to be inserted, and t 3 < I 4 ).It is noteworthy that the smaller the number of the job, the greater the power consumption rate.
Algorithms 2017, 10, x FOR PEER REVIEW 6 of 20 processed within an on-peak period.The electricity prices of the positions corresponding to 3rd layer are the highest.Then, all the jobs are sorted in non-increasing order of their electricity consumption rates and assigned to the layer with a lower price successively to achieve the preliminary coarse granularity filtering target.Once the layer to which a job belongs is determined, the hunting zone of possible positions of a job is concentrated in a certain layer.In the fine granularity filtering stage, several judgment conditions are set up to determine the position of each job to be inserted using characteristic polynomials based on considering processing time, electricity consumption rate of the job, and electricity price.What is more, aiming to find the optimal position, the hunting zone of possible positions of a job is properly expanded in this stage.
Assuming that a job, say job i, whose processing time does not exceed the duration of the shortest on-peak period, is to be inserted, the idea of the proposed algorithm is given as follows.
Obviously, at the very start, the off-peak periods are preferentially occupied by the jobs with high power consumption rates, since all the jobs are sorted in advance.
If Condition 1 is satisfied, job i can be directly processed within an off-peak period with the lowest electricity price.Note that each job processed within a period is placed to the leftmost side of the period.An illustration is given in Figure 3 (i.e., job 3 is a job to be inserted, and t3 < I4).It is noteworthy that the smaller the number of the job, the greater the power consumption rate.
When Condition 2 is satisfied, it means that job i cannot be processed within an off-peak period.As a second-best choice, job i can be processed across periods k and k + 1 in such a condition.An illustration is given in Figure 4.Note that when the job 5 is inserted into the position, it should be adjacent to job 2.
Since dk+2 > 0, it follows that period k + 2 always exists.To minimize the electricity cost for processing job i, the off-peak period with maximal remaining idle time (period k) should be given priority, compared with other off-peak, mid-peak, and on-peak periods.Thus, job i is preferred to be processed across periods k, k + 1, and k + 2. Meanwhile, the corresponding electricity cost is named as Condition 2: When Condition 2 is satisfied, it means that job i cannot be processed within an off-peak period.As a second-best choice, job i can be processed across periods k and k + 1 in such a condition.An illustration is given in Figure 4.Note that when the job 5 is inserted into the position, it should be adjacent to job 2.
Layer 2 includes Conditions 3-5.If t i > max k∈A {I k } + I k+1 and ∃k ∈ B, t i ≤ I k , job i is assigned to layer 2.
Since d k+2 > 0, it follows that period k + 2 always exists.To minimize the electricity cost for processing job i, the off-peak period with maximal remaining idle time (period k) should be given priority, compared with other off-peak, mid-peak, and on-peak periods.Thus, job i is preferred to be processed across periods k, k + 1, and k + 2. Meanwhile, the corresponding electricity cost is named as cost1.However, if job i is processed within a mid-peak period (i.e., the corresponding electricity cost is named as cost2), the electricity cost may be lower.Hence, two positions are considered and an illustration is given in Figure 5.Let c A , c B , and c Γ represent the electricity prices of off-peak, mid-peak, and on-peak periods, respectively.To select the optimal position, the key property 1 is given as follows.
cost1.However, if job i is processed within a mid-peak period (i.e., the corresponding electricity cost is named as cost2), the electricity cost may be lower.Hence, two positions are considered and an illustration is given in Figure 5.Let cA, cB, and cΓ represent the electricity prices of off-peak, mid-peak, and on-peak periods, respectively.To select the optimal position, the key property 1 is given as follows.
holds, the best choice for job i is to be processed within a mid-peak period. Proof.
( ) Therefore, when inequality (8) holds, job i can be directly processed within a mid-peak period.Otherwise, job i must be processed across periods k, k + 1, and k + 2. This ends the proof.□ The only difference between Conditions 3 and 4 is whether dk+2 = 0 or not.This implies that period k is the last off-peak period and period k + 2 does not exist.Hence, period k must be in the last cycle cost1.However, if job i is processed within a mid-peak period (i.e., the corresponding electricity cost is named as cost2), the electricity cost may be lower.Hence, two positions are considered and an illustration is given in Figure 5.Let cA, cB, and cΓ represent the electricity prices of off-peak, mid-peak, and on-peak periods, respectively.To select the optimal position, the key property 1 is given as follows.
holds, the best choice for job i is to be processed within a mid-peak period. Proof.
( ) Therefore, when inequality (8) holds, job i can be directly processed within a mid-peak period.Otherwise, job i must be processed across periods k, k + 1, and k + 2. This ends the proof.□ Condition 4: The only difference between Conditions 3 and 4 is whether dk+2 = 0 or not.This implies that period k is the last off-peak period and period k + 2 does not exist.Hence, period k must be in the last cycle

Property 1. If Condition 3 is satisfied and x
holds, the best choice for job i is to be processed within a mid-peak period.
, it follows that: Therefore, when inequality (8) holds, job i can be directly processed within a mid-peak period.Otherwise, job i must be processed across periods k, k + 1, and k + 2. This ends the proof.The only difference between Conditions 3 and 4 is whether d k+2 = 0 or not.This implies that period k is the last off-peak period and period k + 2 does not exist.Hence, period k must be in the last cycle (i.e., on the last day) and there are two scenarios that should be considered as follows (the zero points of the two scenarios are different).
Scenario 1: In this scenario, neither period k + 1 nor period k + 2 exists and four possible positions marked in Figure 6a are given.Similar to Condition 3, period k is critical due to its lowest price and the longest remaining idle time.To insert job i into period k, the other jobs processed within period k should be moved right or left.Hence, two positions are analyzed first.

1.
To occupy off-peak periods as much as possible, a set of already inserted jobs in period k should be moved to the rightmost side, and then job i can be processed across periods k and k − 1.

2.
All inserted jobs in period k should be moved left so that job i can be processed within period k.
Note that the movement of jobs may lead to a change in their electricity costs, defined as movement cost.The insertion cost of job i is equal to the electricity cost for processing job i plus the corresponding movement cost if some already inserted jobs must be moved to enlarge the idle time of period(s).If the movement cost is zero, then the insertion cost is equal to the electricity cost for processing the job.
Let cost1 and cost2, respectively, denote the insertion costs of the above corresponding positions.Since the power consumption rate of job i is not higher than any one of the already inserted jobs, it follows that cost1 ≤ cost2.That is, the Position 1 is the only one that should be considered when job i is inserted into period k.Next, let k sm denote the off-peak period with submaximal remaining idle time.Positions 3 and 4 are given as follows.

3.
Suppose that job i is processed across periods k sm , k sm + 1, and k sm + 2. If I k sm is slightly smaller than I k , cost3 may be less than cost1 as period k sm + 1 is a mid-peak period.Hence, Position 3 needs to be considered.4.
Similar to Condition 3, job i can be processed within a mid-peak period.
Algorithms 2017, 10, x FOR PEER REVIEW 8 of 20 (i.e., on the last day) and there are two scenarios that should be considered as follows (the zero points of the two scenarios are different).Scenario 1: In this scenario, neither period k + 1 nor period k + 2 exists and four possible positions marked in Figure 6a are given.Similar to Condition 3, period k is critical due to its lowest price and the longest remaining idle time.To insert job i into period k, the other jobs processed within period k should be moved right or left.Hence, two positions are analyzed first.
1. To occupy off-peak periods as much as possible, a set of already inserted jobs in period k should be moved to the rightmost side, and then job i can be processed across periods k and k − 1. 2. All inserted jobs in period k should be moved left so that job i can be processed within period k.
Note that the movement of jobs may lead to a change in their electricity costs, defined as movement cost.The insertion cost of job i is equal to the electricity cost for processing job i plus the corresponding movement cost if some already inserted jobs must be moved to enlarge the idle time of period(s).If the movement cost is zero, then the insertion cost is equal to the electricity cost for processing the job.
Let cost1 and cost2, respectively, denote the insertion costs of the above corresponding positions.Since the power consumption rate of job i is not higher than any one of the already inserted jobs, it follows that cost1 ≤ cost2.That is, the Position 1 is the only one that should be considered when job i is inserted into period k.Next, let k sm denote the off-peak period with submaximal remaining idle time.Positions 3 and 4 are given as follows.
3. Suppose that job i is processed across periods k sm , k sm + 1, and k sm + 2. If Ik sm is slightly smaller than Ik, cost3 may be less than cost1 as period k sm + 1 is a mid-peak period.Hence, Position 3 needs to be considered.4. Similar to Condition 3, job i can be processed within a mid-peak period.To ensure that cost1 = p i × (x i,k × c A + x i x i,k−1 × c Γ ) always holds, Property 2 is given first.Property 2. When Condition 4 is satisfied and d k+1 = 0, job i can be directly inserted into Position 1 without moving any already inserted jobs in period k − 1.
Proof.Since ∃k ∈ A, I k > 0, there must be no jobs processed within period k − 1.It is only possible that a job, say job j, j < i, is processed across periods k − 2 and k − 1.Therefore, x j,k−2 may be the value of the maximal remaining idle time of all mid-peak periods before inserting job j.Since ∃k ∈ B, t i ≤ I k' and j < i, it is understandable that t i ≤ I k ≤ x j,k−2 .Now, job i is to be inserted, it follows that t i + x j,k−1 ≤ x j,k−2 + x j,k−1 = t j .As mentioned earlier, the processing times of all the jobs do not exceed the duration of the shortest on-peak period, that is, t j ≤ d k−1 .Hence, This suggests when job i is inserted into Position 1, period k − 1 cannot be full.Hence, job i can be directly inserted into Position 1 without moving any already inserted jobs in period k − 1.Note that this property applies to Scenario 2 as well.
According to Property 2, cost1 = p i × (x i,k × c A + x i,k −1 × c Γ ) is always satisfied.In the following part, three formulas for calculating the insertion costs of Positions 1, 3, and 4 are given.
Since cost1 is always less than cost2, there is no need to compute cost2.Eventually, the insertion costs of all the possible positions that job i can be inserted into can be easily and directly calculated by the above formulas, and then the position with minimum insertion cost will be chosen.
Scenario 2: It can be seen from Figure 6b that the Positions 1, 4, and 5 in Scenario 2 are the same as the Positions 1, 3, and 4 in Scenario 1.The only difference between Scenarios 1 and 2 is whether d k+1 > 0 or not (i.e., period k + 1 exists).Since period k + 1 is a mid-peak period, two additional positions need to be considered in comparison with Scenario 1.

1.
A set of already inserted jobs in period k are moved to the rightmost side of the period k + 1, and then job i is processed across periods k and k − 1.

2.
A set of already inserted jobs in period k should be moved to the left until job i can be processed across periods k and k + 1.
The size of the two insertion costs (i.e., the processing electricity cost of job 6 plus the movement costs of jobs 3, 4, and 5) corresponding to Positions 2 and 3 is uncertain, because the electricity cost for processing job i is greater at Position 2 than at Position 3, while the movement costs are just the opposite.Eventually, it should calculate insertion costs of five possible positions, and then choose the position with minimum cost.Condition 5: ∀k ∈ A, I k = 0.When Condition 5 is satisfied, this means all the off-peak periods are full and job i can be directly processed within a mid-peak period.
Layer 3 includes Conditions 6 and 7. Most of the jobs are processed across a pair of periods consisting of a mid-peak period and an on-peak period or processed within an on-peak period in this layer.Condition 6: If Condition 6 is satisfied, it means job i cannot be processed within any one of the mid-peak periods, let alone off-peak periods.In other words, job i can only be used to fill the remaining idle time of a certain period with lower electricity price.There is an obvious regularity that the more the remaining idle time of the off-peak or mid-peak period job i occupy, the lower is its processing electricity cost.Figure 7 shows all the possible positions for a scenario.The analysis process of the possible positions that job i can be inserted into is similar to Condition 4, and, therefore, will not be repeated here.{ } max 0.
If Condition 6 is satisfied, it means job i cannot be processed within any one of the mid-peak periods, let alone off-peak periods.In other words, job i can only be used to fill the remaining idle time of a certain period with lower electricity price.There is an obvious regularity that the more the remaining idle time of the off-peak or mid-peak period job i occupy, the lower is its processing electricity cost.Figure 7 shows all the possible positions for a scenario.The analysis process of the possible positions that job i can be inserted into is similar to Condition 4, and, therefore, will not be repeated here.k i

I t ≥
Algorithm 1: Greedy insertion heuristic algorithm with multi-stage filtering mechanism 1. Sort all jobs in non-increasing order of their power consumption rates 2. Initialization:  Condition 7 implies that all the off-peak periods and mid-peak periods are full, and job i can only be inserted into on-peak periods.If max k ∈Γ I k < t i , job i should be inserted into all non-full on-peak periods by moving a set of already inserted jobs, and then the position with the lowest insertion cost can be chosen.The movement method can refer to Che et al. [9].
The core component of the heuristic algorithm is described as a pseudo code, shown in Algorithm 1.Note that the argmin(I k ≥ t i ) denotes the minimal index k for I k ≥ t i .
Theorem 1.The proposed heuristic algorithm runs in O(n 2 m|Γ|) in the worst case.Step C7 includes steps C7.1 and C7.2, wherein the complexity of step C7.1 is O(|Γ|), and the complexity of step C7.2 is O(nm|Γ|).Therefore, step C7 requires O(nm|Γ|) operations in the worst case.To summarize, the proposed algorithm runs in O(n 2 m|Γ|) in the worst case.Now, assume that no jobs need to traverse all non-full on-peak periods, that is, the Step C7.2 has never been used.In this case, the time complexity of the proposed algorithm is O(n 2 m).However, the classic greedy insertion algorithm proposed by Che et al. [9] requires O(n 2 m 2 ) operations in the worst case when dealing with the same problem, because their algorithm requires all the jobs to traverse all non-full periods to find an optimum position.
Algorithm 1: Greedy insertion heuristic algorithm with multi-stage filtering mechanism 1. Sort all jobs in non-increasing order of their power consumption rates 2. Initialization:

Computational Results
In this section, a real-life instance from a machinery manufacturing company in China is provided to further illustrate the MILP model and the proposed algorithm.Then, two sets of contrasting experiments with randomly generated instances are conducted, aiming to show the good performance of the algorithm.The algorithm is coded in MATLAB R2015b and the experiments are run on an Intel(R) Core(TM) i7-4790 3.60 GHz processor with 16 GB of memory under the Windows 7 operating system.For benchmarking, the greedy insertion heuristic algorithm proposed by Che et al. [9] is adopted for our contrast tests.
The TOU electricity tariffs used for all instances are those implemented in Shanxi Province, China, as given in Table 1.It can be seen from Table 1 that the off-peak period is between an on-peak period and a mid-peak period, which means that the actual electricity prices meets the first type of TOU electricity tariffs.Assume that the time horizon starts at 8:00 a.m. of the first day.C max and C B denote the given makespan and the total processing times of all the jobs, respectively.The parameter e = C max /C B (e ≥ 1) is used to measure the degree of time tightness.In these instances, C max can be obtained by the formula C max = e × C B as long as the parameter e is set.Obviously, as e increases, C max increases.Note that b m+1 is calculated by b m+1 = C max /24) × 24.Let TEC F and TEC H be the total electricity cost calculated by our algorithm (GIH-F)and Che et al.'s algorithm (GIH), respectively.The runtimes of the two algorithms are represented by CT F and CT H , respectively.The gaps between TEC F and TEC H are represented by G, G = (TEC F − TEC H )/TEC H × 100%.The ratio of CT H /CT F is represented by R.

A Real Case Study
The MILP model and the proposed algorithm are applied to a vertical machining center (SMTCL VMC 1600P) from a machinery manufacturing company shown in Figure 8.In this real-life instance, the company receives some orders of processing rectangular parts with three product models for continuous casting machines of the steel plants.Figure 9 is the picture of the rectangular part, and the complex cavity surfaces including the planes, camber surfaces, and spherical surfaces are to be processed on the VMC.The power consumption per hour required by the VMC is related to the material of the job, cutting depth, feed speed, and so on.To obtain the average power consumption rate of the machine, a power measurement is performed using a power meter (UNI-T UT232), and the measurement data is presented by Table 2.In addition, the order quantity of the three models is 15, 35, and 10 parts, respectively.Cmax and CB denote the given makespan and the total processing times of all the jobs, respectively.The parameter e = Cmax/CB (e ≥ 1) is used to measure the degree of time tightness.In these instances, Cmax can be obtained by the formula Cmax = e × CB as long as the parameter e is set.Obviously, as e increases, Cmax increases.Note that bm+1 is calculated by Let TECF and TECH be the total electricity cost calculated by our algorithm (GIH-F)and Che et al.'s algorithm (GIH), respectively.The runtimes of the two algorithms are represented by CTF and CTH, respectively.The gaps between TECF and TECH are represented by G, G = (TECF − TECH)/TECH × 100%.The ratio of CTH/CTF is represented by R.

A Real Case Study
The MILP model and the proposed algorithm are applied to a vertical machining center (SMTCL VMC 1600P) from a machinery manufacturing company shown in Figure 8.In this real-life instance, the company receives some orders of processing rectangular parts with three product models for continuous casting machines of the steel plants.Figure 9 is the picture of the rectangular part, and the complex cavity surfaces including the planes, camber surfaces, and spherical surfaces are to be processed on the VMC.The power consumption per hour required by the VMC is related to the material of the job, cutting depth, feed speed, and so on.To obtain the average power consumption rate of the machine, a power measurement is performed using a power meter (UNI-T UT232), and the measurement data is presented by Table 2.In addition, the order quantity of the three models is 15, 35, and 10 parts, respectively.Cmax and CB denote the given makespan and the total processing times of all the jobs, respectively.The parameter e = Cmax/CB (e ≥ 1) is used to measure the degree of time tightness.In these instances, Cmax can be obtained by the formula Cmax = e × CB as long as the parameter e is set.Obviously, as e increases, Cmax increases.Note that bm+1 is calculated by 1 / 24) 24.
Let TECF and TECH be the total electricity cost calculated by our algorithm (GIH-F)and Che et al.'s algorithm (GIH), respectively.The runtimes of the two algorithms are represented by CTF and CTH, respectively.The gaps between TECF and TECH are represented by G, G = (TECF − TECH)/TECH × 100%.The ratio of CTH/CTF is represented by R.

A Real Case Study
The MILP model and the proposed algorithm are applied to a vertical machining center (SMTCL VMC 1600P) from a machinery manufacturing company shown in Figure 8.In this real-life instance, the company receives some orders of processing rectangular parts with three product models for continuous casting machines of the steel plants.Figure 9 is the picture of the rectangular part, and the complex cavity surfaces including the planes, camber surfaces, and spherical surfaces are to be processed on the VMC.The power consumption per hour required by the VMC is related to the material of the job, cutting depth, feed speed, and so on.To obtain the average power consumption rate of the machine, a power measurement is performed using a power meter (UNI-T UT232), and the measurement data is presented by Table 2.In addition, the order quantity of the three models is 15, 35, and 10 parts, respectively.Let us temporarily put aside the above real-life instance, and talk about solving a hypothetical instance given in Tables 3 and 4 based on the above data.Specifically, it is assumed that there are twelve parts which need to be processed within two days.That is, the number of periods is ten (i.e., m = 10).According to this example, we will demonstrate the MILP model and the main computational process of GIH-F.First, the twelve jobs are sorted in non-increasing order according to their power consumption rates, that is, job 7, job 8, job 9, job 10, job 11, job 12, job 5, job 6, job 1, job 2, job 3, and job 4. Second, the remaining idle time of all the periods are initialized.Obviously, t 7 ≤ max k∈A {I k } + I k+1 and t 7 ≤ I 4 (i.e., k = 4), hence job 7 can be inserted into the low-price layer 1 and is placed in the position corresponding to the Condition 1.The same applies to jobs 8, 9, and 10.In this way, the off-peak periods are fully utilized by the jobs with high power consumption rates, resulting in lower total electricity costs.At this stage, the remaining idle time of each period is as follows: I 1 = 3.Let us continue, and it is not hard to check that the job 12 is to be inserted into the position corresponding to Condition 4. As mentioned earlier, there will be five positions waiting for selection at this moment.The insertion costs for these five positions are 12.8, 10.7, 10.7, Inf, and 13.9, respectively.Therefore, job 12 is to be inserted into the Position 2 which crosses periods 8 and 9.Note that I k sm = 0 (i.e., I 4 = 0), hence job 12 cannot be processed across periods k sm , k sm + 1, and k sm + 2, and the corresponding insertion cost is infinity.At this stage, the remaining idle time of each period is as follows: I 1 = 3.5, I 2 = 7, I 3 = 4.5, I 4 = 0, I 5 = 0, I 6 = 3.2, I 7 = 7, I 8 = 4.2, I 9 = 0, I 10 = 0.An illustration is given in Figure 10b.
Next, let us explain the insertion process of other jobs concisely.Jobs 5 and 6 are assigned to layer 2, and they satisfy Condition 5. Therefore, these two jobs are to be inserted into mid-peak period 2. Similarly, jobs 1 and 2 are to be inserted into period 7.At this stage, the remaining idle time of each period is as follows: I 1 = 3.5, I 2 = 1.8,I 3 = 4.5, I 4 = 0, I 5 = 0, I 6 = 3.2, I 7 = 2.2, I 8 = 4.2, I 9 = 0, I 10 = 0.An illustration is given in Figure 10c.Returning to the real-life instance, let us now talk about the efficiency of the MILP model and the proposed algorithm.Currently, the company plans to produce 70-Model, 40-Model, and 100-Model rectangular parts in 7, 3, and 2 days respectively.That is, five parts are to be produced every day from 8:00 to 24:00.This suggests that it needs 12 days to process all the parts and the total electricity cost (TEC) can be computed as follows: ( ) Figure 11 is the scheduling result diagram of the real-life instance.It can be seen from Figure 11 that with our scheduling, the total electricity cost for processing all the parts is 447.9CNY, which can be reduced by 42.0%.Returning to the real-life instance, let us now talk about the efficiency of the MILP model and the proposed algorithm.Currently, the company plans to produce 70-Model, 40-Model, and 100-Model rectangular parts in 7, 3, and 2 days respectively.That is, five parts are to be produced every day from 8:00 to 24:00.This suggests that it needs 12 days to process all the parts and the total electricity cost (TEC) can be computed as follows: Figure 11 is the scheduling result diagram of the real-life instance.It can be seen from Figure 11 that with our scheduling, the total electricity cost for processing all the parts is 447.9CNY, which can be reduced by 42.0%.

Randomly Generated Instances Studies
In these tests, we utilize two sets of randomly generated instances to evaluate the performance of the proposed algorithm.For the first set of small-size instances, the range of jobs is [20,100].For the second set of large-size instances, the number of jobs is set as 500, 1000, 2000, 3000, 4000, and 5000.The processing time t i is randomly generated from a uniform distribution (30, 210) min and the power consumption per hour p i is randomly generated in (30, 100) kW.To measure the effect of the proposed algorithm, parameter e is set as e = 1.2, 1.5, 2, 3.
For each group of n (n ≤ 2000) and e, 10 random instances are generated, then the average values of 10 tests are calculated and recorded.When the number of jobs is set as 3000, 4000, and 5000, GIH has to run for more than 4 h (the longest is nearly two days) to find a feasible solution.Thus, considering the feasibility of the experiment, only 3 random instances are generated in such a group of tests.All the average values are recorded in Tables 5 and 6.Meanwhile, for the large-size instances, we add two rules to GIH to reduce the computation time without changing the computational accuracy.The improved algorithm is named GIH2.} denotes the minimal index k for t i ≤ I k , then job i can be directly inserted into the off-peak period kk and the job no longer traverses all the non-full periods.Rule 2: If t i ≤ min k ∈Γ I k , max k∈A {I k } > 0 or max k ∈B {I k } > 0, then job i no longer traverses on-peak periods.
As mentioned above, when there are no jobs that need to traverse non-full on-peak periods, the time complexity of GIH-F is O(n 2 m) and GIH is O(n 2 m 2 ).This implies that GIH-F is m times faster than GIH, theoretically, and the experimental data of the small-size instances in Table 5 can verify this conclusion.From Table 5, we can see that R and m are almost the same order of magnitude.In addition, all the small-size instances can be solved within 0.02 s using GIH-F.By and large, the computation time increases slightly with n, and parameter e has no significant effect on the computation time, which indicates that the algorithm is quite stable.In addition, it can be seen from Table 5 that the smaller the parameter e (i.e., the shorter the makespan), the higher the total electricity cost.Therefore, in a specific instance, the decision-makers can obtain a set of Pareto solutions by adjusting the makespan, and they can choose a solution according to actual needs.What is more, it is amazing to see that our algorithm not only greatly improves computation speed but also further improves the accuracy.
Table 6 shows that the number of periods increases quickly with the number of jobs.Since the time complexity of GIH is O(n 2 m 2 ), it's runtime will rise sharply.To ensure the feasibility of the contrast tests, we add two rules (i.e., Rule 1 and Rule 2) to improve the computational speed of GIH without changing the computational accuracy.
Intuitively, the CT F is significantly less than CT H2 , which means that the designed filtering mechanism is efficient in dealing with large-scale instances.Specially, as n = 5000 and e = 2.0, our algorithm can solve a randomly generated instance within 1 min and maintain the same accuracy as GIH2, while GIH2 takes nearly 39 h, let alone GIH.Note that when e is set as 3.0, the given makespan is very abundant and there is no job processed within an on-peak period in our experimental environments.Thus, according to Rule 2, all the jobs do not have to traverse on-peak periods, and then CT H2 is greatly reduced.Conversely, when e is set as 1.2, the number of periods decreases and the jobs are arranged very tightly.There will be many jobs inserted into the periods with higher electricity prices.Therefore, our algorithm should filter more positions with lower electricity prices and constantly judge whether the job needs to be moved.Obviously, all these operations may increase the computation time.Thus, when dealing with large-size instances and setting e to 1.2 or 1.5, our algorithm runs longer, but the computation time is still far less than GIH2.

Conclusions and Prospects
This paper develops a new greedy insertion heuristic algorithm with a multi-stage filtering mechanism for single machine scheduling problems under TOU electricity tariffs.The algorithm can quickly filter out many impossible positions in the coarse granularity filtering stage and then each job to be inserted can search for its optimal position in a relatively large space in the fine granularity filtering stage.Compared with the classic greedy insertion algorithm, the greatest advantage of our algorithm is that it no longer needs to traverse all non-full periods, so the time complexity of the algorithm is quite low, and it can easily address the large-scale single machine scheduling problems under TOU electricity tariffs.The real case study demonstrates that with our scheduling, the total electricity cost for processing all the parts can be reduced by 42.0%.In addition, two sets of experimental instances are provided.The computational results demonstrate that the small-size instances can be solved within 0.02 s using our algorithm, and the accuracy of the algorithm is further improved.For the large-size instances, we add two rules to the classic greedy insertion algorithm, which reduces the computation time without changing the calculation precision, but the results show that our algorithm still outperforms it.Specifically, when addressing the large-scale instances with 5000 jobs, the computation speed of our algorithm improves by nearly 2700 times.Computational experiments also reveal that the smaller the parameter e, the more significant the filtering mechanism is.
This paper focuses on the single machine scheduling problems under the first type of TOU electricity tariffs.In our future research, we will continue to study the problem under the second type of TOU tariffs (i.e., the off-peak period lies between two mid-peak periods).In addition, we will also strive to improve our algorithm and extend it to other machine environments, such as parallel machines and flow shop.

Figure 1 .
Figure 1.An example of the mixed-integer linear programming (MILP) model.

Figure 2 .
Figure 2.An illustration of the first type of time-of-use (TOU) electricity tariffs.

Figure 1 .
Figure 1.An example of the mixed-integer linear programming (MILP) model.

Figure 1 .
Figure 1.An example of the mixed-integer linear programming (MILP) model.

Figure 2 .
Figure 2.An illustration of the first type of time-of-use (TOU) electricity tariffs.

Figure 2 .
Figure 2.An illustration of the first type of time-of-use (TOU) electricity tariffs.
that all the off-peak periods and mid-peak periods are full, and job i can only be inserted into on-peak periods.If be inserted into all non-full on-peak periods by moving a set of already inserted jobs, and then the position with the lowest insertion cost can be chosen.The movement method can refer to Che et al.[9].The core component of the heuristic algorithm is described as a pseudo code, shown in Algorithm 1.Note that the ( ) arg min k i I t ≥ denotes the minimal index k for .

Proof.
Step 1 runs in O(nlogn) time for sorting n numbers and Step 2 requires O(m) time.For each given job, Step C1 runs in O(|A|) in the worst case and Step C2 requires O(1).Steps C3 and C5 both require O(|B|) operations in the worst case.Steps C4 and C6 demand O(nm) to compute the movement cost when calculating the insertion cost.

Figure 9 .
Figure 9.The geometry of the rectangular part.

Figure 9 .
Figure 9.The geometry of the rectangular part.

Figure 9 .
Figure 9.The geometry of the rectangular part.

Finally, jobs 3 Figure 10 .
Figure 10.Illustration of the computational process of GIH-F.

Figure 10 .
Figure 10.Illustration of the computational process of GIH-F.

Figure 11 .
Figure 11.The scheduling result of the real-life instance.Figure 11.The scheduling result of the real-life instance.

Figure 11 .
Figure 11.The scheduling result of the real-life instance.Figure 11.The scheduling result of the real-life instance.
If layer 1 C1.If Condition 1 is satisfied Initial the period index kk = argmin k∈A (I k ≥ t i ) //Job i is processed within period kk.Else Initial the period index kk = argmin k ∈B (I k ≥ t i ) //Job i is processed within period kk'.C4.Else if Condition 4 is satisfied C4.1.If d k+1 = 0 //Calculate cost1, cost3, and cost4 and insert job i into the position with minimal insertion cost.Initial the period index kk = argmin k ∈Γ I k ≥ t i C4.2.Else if d k+2 = 0 and d k+1 > 0 //Calculate cost1, cost2, cost3, cost4, and cost5 and insert job i into the position with minimal insertion cost.C5.Else if Condition 5 is satisfied Initial the period index kk = argmin k ∈B (I k ≥ t i ) //Job i is processed within period kk'.//Job i is processed within period kk".C7.2.Else //Job i traverses all non-full on-peak periods and insert job i into the position with minimal insertion cost.

Table 1 .
The TOU tariffs used for all instances.

Table 1 .
The TOU tariffs used for all instances.

Table 1 .
The TOU tariffs used for all instances.

Table 2 .
The measurement data of the real-life instance.

Table 3 .
A hypothetical instance based on real-life data.

Table 4 .
TOU tariffs for the hypothetical instance.

Table 5 .
Computational results for the small-size instances.

Table 6 .
Computational results for the large-size instances.If t i ≤ max k∈A {I k } and kk = argmin k∈ A {t i ≤ I k }, where argmin k∈ A {t i ≤ I k