## 3 A Greedy Insertion Heuristic Algorithm with Multi-Stage Filtering Mechanism
### 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  
Figure 1: An example of the mixed-integer linear programming (MILP) model. Figure 2: An illustration of the first type of time-of-use (TOU) electricity tariffs. 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 3 rd 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 \(\exists k\in A,t_{i}\leq\max_{k\in A}\{l_{k}\}+l_{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. Condition 1: \(\exists k\in A,t_{i}\leq l_{k}\). 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}<l_{4}\)). It is noteworthy that the smaller the number of the job, the greater the power consumption rate. Condition 2: \(t_{i}>\max_{k\in A}\{l_{k}\}>0\) and \(d_{k+1}>0\). 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\in A}\{l_{k}\}+l_{k+1}\) and \(\exists k^{\prime}\in B,t_{i}\leq l_{k^{\prime}}\), job \(i\) is assigned to layer 2. Condition 3: \(\max_{k\in A}\{l_{k}\}>0\) and \(d_{k+2}>0\). 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  
Figure 3: Illustration of Condition 1.  
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\).