Abstract
Facing the worsening environmental problems, green manufacturing and sustainable development have attracted much attention. Aiming at the energy-efficient distributed re-entrant hybrid flow shop scheduling problem considering the customer order constraints (EDORHFSP) under Time-of-Use (TOU) electricity price, a mathematical model is established to minimize the maximum completion time and total consumption energy cost. In the study, some customer orders require production in multiple factories and jobs belonging to the same customer order must be processed in one factory. Firstly, a memetic algorithm (MA) was proposed to solve the problem. To improve the performance of the algorithm, encoding and decoding methods, energy cost saving procedure, three heuristic rules about the population initialization and some neighborhood search methods are designed. Then, Taguchi method is adopted to research the influence of parameters setting. Lastly, numerical experiments demonstrate the effectiveness and superiority of MA for the EDORHFSP.
Keywords
Introduction
The development of manufacturing industry has brought great convenience to people’s life, but also led to some new problems, such as environmental pollution, global warming, energy depletion and so on. As rapid industrialization of the world, the constraint of resources and environment has become the bottleneck that restricts the sustainable development of industry. Meanwhile, under the background of economic globalization and cooperative production, manufacturing has changed from the traditional single factory production to multi-location factoriesproduction and distributed manufacturing has become a common production mode. Distributed manufacturing can make full use of the resources, reduce the cost and improve the competitiveness of enterprises through reasonable allocation, optimal combination and resource sharing.
Re-entrant hybrid flow shop scheduling problem (RHFSP), which has been proved to be a NP-hard problem [1], is an extension of classical hybrid flow shop scheduling problem (HFSP) and is widely used in chemical, textile, steel, semiconductor [2] and other industries. Therefore, the study of RHFSP has important theoretical significance and practical value. Since Graves and Meal et al. [3] proposed the re-entrant scheduling problem in 1983, more and more scholars have studied RHFSP in recent years. Kim and Lee [4] considered the unrelated parallel machine based on the general RHFSP with the objectives of minimizing the maximum completion time and the total tardiness time. But in fact, the tardiness time objective is treated as a constraint condition. Dugardin and Yalaoui et al. [5] proposed a new multi-objective genetic algorithm to solve the RHFSP, aiming at minimizing the maximum completion time and maximizing utilization of bottleneck machine, simultaneously. Cho and Bae et al. [6], Ying and Lin et al. [7], and Shen and Wang et al. [8, 9] proposed the pareto genetic algorithm, iterative pareto greedy algorithm, improved teaching and learning optimization algorithm and pareto based discrete harmony search algorithm respectively to solve the bi-objective RHFSP with the objectives of minimizing the maximum completion time and the total tardiness. Lin and Liu et al. [10] designed a hybrid harmony search and genetic algorithm for the RHFSP considering limited buffer capacity, aiming at minimizing the maximum completion time and mean flowtime. Zhou and Hu et al. [101] proposed a hybrid differential evolution algorithm to solve the RHFSP considering inspection and repair operations. The objective is minimizing total weighted completion time. To sum up, the optimization objectives are mainly time-related in previous researches, and rarely consider the environmental and energy cost related objectives [8].
According to statistics, by 2050, global energy demand will increase by 37%, and CO2 emissions will increase by about 80% in the next 30–40 years [11]. As we all know, the industrial sector consumes the most energy around the word [12, 13]. Thus, how to save energy has become an urgent problem in modern industrial production. Developing energy-saving equipment is a direct way to save energy, but it is difficult to achieve the target of energy saving and economic benefits in a short time due to large investment and long cycle [14]. In addition, green scheduling is another means to achieve energy saving and consumption reduction. It can improve energy utilization at a very small cost through reasonable optimization of resource allocation, operation sequencing and operation mode [15]. In recent years, more and more attention has been paid to green scheduling problems, in which several mechanisms are mainly considered, such as power off mechanism [12, 16], dynamic machine speed [17–19] and TOU electricity price mechanism [19–21]. To reduce the burden on the grid in peak periods, TOU electricity price has been implemented in many countries to encourage consumers to shift the usage from peak periods to off-peak or mid-peak periods. Sin et al. [22] investigated the scheduling problem considering preventive maintenance under TOU electricity price. Ding and Schulz et al. [22] developed a hybrid particle swarm optimization algorithm to solve the flexible flow shop scheduling considering TOU electricity price. Zhou and Jin et al. [23] used a hybrid multi-objective meta-heuristic algorithm to study the energy-efficient scheduling problem considering dynamic job arrival times under TOU electricity price. Zheng and Zhou [24] proposed a hybrid ant colony optimization algorithm to solve the two-stage blocking green permutation flow shop scheduling problem under TOU electricity price. In the paper, we study the EDORHFSP under the TOU electricity price mechanism.
Most of the previous studies on scheduling problem assume that all the jobs are processed in a single factory. Nevertheless, in today’s highly competitive marketplace, distributed scheduling has become increasingly popular owing to its production efficiency and efficient resource utilization [25]. Distributed scheduling problem (DSP) mainly involves two sub-problem: assigning jobs to factories and determining jobs sequence. Gao et al. [26] used an enhanced tabu search algorithm for the distributed permutation flow shop scheduling problem (DPFSP). Lin et al. [27] adopted an improved iterated greedy algorithm to solve the DPFSP. Wang et al. [14] prosed a knowledge-based cooperative algorithm to solve the energy-efficient DPFSP. It is not difficult to find that in the classic DSP, jobs are processed as independent entities. However, several jobs belong to the same customer order in the actual production scenario. In that case, it is wise to handle the jobs from the same customer order in the one factory to reduce production costs and enhance customer satisfaction [28, 29]. Obviously, if jobs belonging to the same customer order are processed in different factories, it is necessary to transport partially completed jobs among the factories in order to package the entire order together [30]. As far as we know, there is no literature on energy-saving RHFSP considering both distributed features and customer order constraints simultaneously. In this paper, we tackle the EDORHFSP under TOU electricity price with the objectives of minimizing the maximum completion time and total energy consumption cost.
The remainder of the paper is organized as follows. In Section 2, the EDORHFSP is detailed. The MA is designed in detail to solve the EDORHFSP in Section 3. In Section 4, numerical experiments are given. Finally, some conclusions and future works.
Problem description and formulation
Problem description
EDORHFSP can be described as follows: r customer orders need to be processed in f factories. Each customer order l contains λ l jobs, and each customer order can be processed by any one of the f factories. Each factory contains s stages. Each stage has one or more parallel machines and some jobs may need to visit the same stage several times. Besides the classic flow shop constraints, there are some additional constraints according to the distributed characteristics and customer order constraints. The jobs belong to the same customer order must be processed in one factory. Jobs from different orders can be intermingled in the factory. Once a job is assigned to a factory, all its operations must be processed in the same factory. Thus, the major task of EDORHFSP is to assign customer orders to the factories, assign jobs to machines, determine the set of operations on all machines, so as to minimize maximum completion time and total energy cost. Figure 1 shows the diagram of EDORHFSP.

Diagram of the EDORHFSP.
f: number of factories
s: number of stages in each factory
r: number of customer orders
h: number of re-entrances
g: index for factories, g = 1, 2, . . . , f
l, w: index for customer orders, l, w = 1, 2, . . . , r
λ l : number of jobs in customer order l
J l : jobs set belonging to customer order l
n: number of jobs, namely
k: index of operations for the job
j,v: index for jobs, j, v = 1, 2, . . . , n
C j : completion time of job j
N j : operations set of job j
s: number of stages in each factory
i: index for stages, i = 1, 2, . . . , s
m ig : number of machines at stage i in factory g
a: index for machines at stage i in factory g, a = 1, 2, . . . , m ig
M
total
: number of machines at all stages in all factories g,
q: index for machines
R q : number of operations on machine q
O jk : the k-th operation of job j
M: a large positive number
U = {e0 + 1, e0 + 2, . . . , e1, e1 + 1, e1 + 2, . . . , e2, . . . , er-1 + 1, er-1 + 2, . . . , e
r
}, in which, {el-1 + 1, el-1 + 2, . . . , e
l
} are the jobs belonging to customer order l.
U ig : operations set that are processed at stage i in factory g
S jkg : starting time of O jk in factory g
E jkg : ending time of O jk in factory g
p jkiag : processing time of O jk in factory g at stage i on machine a
T q : completion time of machine q
S q : start-up time of machine q
PI q : unit energy consumption of machine q in the idle state
PW q : unit energy consumption of machine q in the processing state
f (t): TOU electricity price function
r ijkag : binary variable, 1 if O jk is processed at stage i on machine a in factory g, and 0 otherwise
Y jg : binary variable, 1 if the job j is processed in factory g, and 0 otherwise
Zjkj′k′: binary variable, 1 if O jk precedes Oj′k′, and 0 otherwise
Objectives functions and main constraints
Two objective functions C max and TEC are listed as follows based on the existing literatures [7, 31].
Objective functions:
In which, C
max
and TEC represent the maximum completion time and the total energy consumption cost respectively. In addition, TEC is made up of two parts, one is the energy consumption cost PC when machines are in the processing state, the other one is the energy consumption cost IC when machines are in the idle state.
s.t.
Formulas (1) and (2) are two objective functions. Constraint (5) means that each job must be assigned to one and only one factory. Constraint (6) ensures that jobs belonging to the same customer order should be processed in the same factory. Constraint (7) ensures that each operation can only be processed on one machine at the corresponding stage. Constraint (8) ensures that the starting time is not earlier than the ending time of the previous operation. Constraints (9), (10) and (11) mean that one machine processes at most one operation at a time. Constraints (12), (13) and (14) define the C j . Constraints (15) and (16) define the relationship between S jkg andE jkg .
In the bi-objective optimization problem, solution X1 dominates X2 (denotes as X1 ≺ X2), if and only if ∀i ∈ {1, 2} , f i (X1) ⩽ f i (X2) ∧ ∃ i ∈ {1, 2}, f i (X1) < f i (X2). A solution X is the non-dominant solution when there is no solution that can dominate it. EDORHFSP usually involves a large number of jobs, machines and operations, and due to the re-entrant characteristics, it is difficult to solve using the mathematical model directly. Given this situation, a memetic algorithm is proposed to solve the problem with objectives of minimizing the maximum completion time and total energy consumption cost simultaneously.
Memetic algorithm (MA) is an algorithm framework based on the combination of global search and local search. Different search strategies can form different cultural MA. For example, genetic algorithm can be used for global search strategy, tabu search and simulated annealing can be used for local search strategy. By establishing the balance between global search and local search, MA is widely used in various multi-objective optimization problems and shows good performance. For the EDORHFSP, an Memetic algorithm is designed. Moreover, to enhance the performance of MA, encoding and decoding methods, energy cost saving procedure, three heuristic rules about the population initialization and some neighborhood search methods are designed. Figure 2 shows the flow chart of MA for the EDORHFSP.

The flow chart of MA for the EDORHFSP.
In the paper, a solution contains two segments: factories assignment for all customer orders and jobs sequence in each factory. To be specific, each solution consists of f vectors and each vector represents a sequence of jobs in the corresponding factory, for instance, n = 6, f = 2, r = 3, s = 3, J1 = [1, 2, 3], J2 = [4, 5] and J3 = [6]. In the example, 3 customer orders are processed in 2 identical factories and there are 3, 2 and 2 machines at each stage, respectively. Specifically, customer order 1 includes job 1, 2 and 3, customer order 2 includes job 4 and 5 and customer order 3 just includes of job 6. Table 1 lists the processing times of all operations. For convenience, let us suppose that PW = 8 and PI = 1 in thepaper.
Processing times
Processing times
In different places or countries, TOU electricity price schemes vary greatly. Ttaking the electricity price scheme of Shanghai in 2019 as an example, which is shown in Table 2. Such pricing structure can encourage consumers to transfer the electricity consumption from peak periods to mid-peak or off-peak periods, because the price of electricity in peak periods is higher.
TOU electricity price scheme
The decoding method is detailed as follows:
Step 1: Select π g form the solution π, here π g refers to jobs sequence processed in factory g, initialize g = 1.
Step 2: Select the first job j from π g , arrange all the operations of job j on the machines that can finish it as early as possible.
Step 3: Select the next job v from π g and arrange operation O vk to the appropriate machine from the available machine set (MS) for it.
Step 4: Select machine a from the MS, and traverse all idle periods [Starts, Ends] of it. The earliest starting time S vkg of operation O vk is shown in formula (17).
Step 5: According to Equation (18), find an appropriate insertion point for O vk . If more than one qualified S vkg is found, select the smallest one as the starting time. In addition, if the insertion condition is not met, then setting S vkg = Lm a , where Lm a signifies the ending time of machine a at the current state.
Step 6: Repeat step 4 and step 5 until all machines in MS are traversed. If more than one machine with the same S vkg , we choose the machine with less idle time between insertion point and the previousoperation.
Step 7: Calculate E vkg of operation O vk , according to formula (19).
Step 8: Traverse all jobs in the π g and repeat step 2-step 7.
Step 9: Update g = g + 1, repeat step2–step8 until all factories have been decoded.
Step 10: According to the scheduling results of all operations, two objective function values C max and TEC are calculated.
With above mentioned encoding method, a solution can be denoted as π = {π1, π2, . . . , π f }. To make it easier to understand, let us suppose that π = {, [4, 5, 6]} where π1 = [2, 1, 3] and π2 = [4, 5, 6]. Take factory 1 for example, firstly, all of the operations of job 2 are scheduled on the machine that can finish them as early as possible. Then, each operation of job 1 will be arranged on the machine by finding the appropriate insertion points. By analogy, all operations of job 3 are arranged on the appropriate machines. Figures 3 and 4 are the gantt charts, in which operation “302” denotes the second operation of job 3. Two objective function values of thescheduling scheme are C max = 15 hours and TEC = 360.0280 CNY.

Schedule of factory 1.

Schedule of factory 2.
Because the waiting state of machines and jobs inevitably appears in the RHFSP, especially in the case of large-scale jobs, we can make full use of these waiting times to adjust the processing periods of the operations. Based on machine allocation and operation sequencing, the energy cost saving procedure is added to select the appropriate starting processing time for all operations, and try to avoid the operations being processed at high electricity price, so as to achieve the purpose of reducing the TEC without deteriorating the C max . According to the decoding rules, all operations can only move to the right. Moreover, the shift of the next operation will affect the previous one, so the energy cost saving procedure should follow the rule from back to front. Specifically, energy cost saving procedure mainly includes two parts: right-shift (RS) procedure and local adjustment (LA) procedure. The detailed RS procedure is as follows, and the diagram is shown inFig. 5.

RS procedure.
Step 1: Select one factory and all operations are arranged according to the completion time.
Step 2: Under the premise of not affecting the maximum completion time of the selected factory, each operation should move to the right to avoid operations being processed at high electricity price as far as possible according the TOU electricity price.
Step 3: Repeat step 2 until all operations have been traversed.
Step 4: Repeat step 1 to step 3 until all factories have been traversed.
Step 5: Update the pareto archive with the newly explored solutions.
Taking Table 1 as an example, after adding the RS procedure to Figs. 3 and 4, the new gantt charts are shown in Figs. 6 and 7. The comparison shows that operations “106”, “301”, “406”, “506” and “601” have moved to the right. Investigate the reason we can from following aspects thinking: (1) The electricity price of operations “106” and “601” remains the same before and after the procedure. Although the RS procedure cannot reduce the energy consumption, it can strive for a certain right-shift space for the previous operations. (2) The right-shift of operation “406” can reduce the energy consumption cost by moving the processing period from high electricity price 1.202 yuan/Kwh to low electricity price 0.749 yuan/Kwh. Meanwhile, the idle time of machine 6 did not increase in factory 2. (3) Although the shift of operation “506” from high electricity price 1.202 yuan/Kwh to low electricity price 0.749 yuan/Kwh also resulted in an increase of the idle time, taking the two factors into consideration, the total energy cost is reduced. (4) Although the electricity price of operation “301” before and after the RS procedure remains unchanged, energy cost can be reduced by shortening the idle time in the factory. To sum up, two objective function values of the scheduling scheme are C max = 15 hours and TEC = 349.7712 CNY after the RS procedure, and TEC is reduced by 10.2568 CNY by comparison.

Schedule of factory 1 after RS procedure.

Schedule of factory 2 after RS procedure.
After the RS procedure, some operations may be transferred to other machines at the same stage, which we call it LA procedure. Without deteriorating the maximum completion time, some machines can be shut-down in advance or power-on later by the LA procedure, which is help to reduce the idle energy consumption cost (IC). Figures 8 and 9 are the gantt charts after the LA procedure. The processing period of operation “301” is at 1–4 hours in Fig. 8. Machine 1, which is at the same stage as machine 3, is idle at 1–4 hours. Therefore, operation “301” can be transferred to machine 1 for processing, and machine 3 can be powered on later, thus reducing idle energy consumption effectively. In summary, after the LA procedure, two objective function values of the scheduling scheme are C max = 15 hours and TEC = 349.2089 CNY, and TEC is reduced by 0.5623 CNY by comparison.

Schedule of factory 1 after LA procedure.

Schedule of factory 2 after LA procedure.
The pseudo code for LA procedure is as follows, in which, Idle(i) denotes the total idle time on all machines at stage i.
The energy consumption curves (EC curves) of all machines along with time in each factory are plotted in Figs. 10 and 11. Obviously, the electricity load shifts in some periods. If there is a difference between the dotted line and the solid line, it means that the electricity load has been transferred. Specifically, the electricity is charged at high (low) price about 8–9 (3–4) hours in factory 1. After the energy cost saving procedure, total energy consumption is decline in the former period, on the contrary, total energy consumption increased in the latter period. It’s the same situation in factory 2. Therefore, the TEC can be saved by transferring the usage from peak period to off-peak or mi-peak period after the energy cost saving procedure.

Energy consumption curves of factory 1.

Energy consumption curves of factory 2.
Take operation O jk as an example, supposing operation O jk is processed on machine a in factory g and Sj′k′g is the starting time of the next operation after O jk on machine a. Meanwhile, the range of starting time of O jk is [t min , t max ]. The pseudo code for the energy cost saving procedure is as follows.
For the EDORHFSP, three heuristic rules are designed for assigning the customer orders to the appropriate factories and sequencing jobs in each factory. Rule1, Rule2 and Rule3 begin with constructing a job sequence θ randomly, and each job appears once in it.
Rule1
The specific steps of Rule1 are as follows:
Step 1: Generate a jobs sequence θ randomly.
Step 2: Remove the first job from θ and insert it into the first stage of the first factory.
Step 3: If θ is not empty, remove the next job j of customer order l. If no jobs of the customer order l have been extracted from θ, then randomly select a factory g and place job j at the end of sequence π g , where π g is the jobs sequence to be processed in factory g. if one or more jobs of customer order l have already been assigned to the factory (for example factory G), then place job j at the end of sequence π G .
Step4: Repeat Step3 until θ is empty.
Step5: Get π = {π1, π2, . . . , π f }.
Rule2
In Rule2, consider C max when arranging jobs. The details of Rule2 is given as follows.
Step 1: Generate a jobs sequence θ randomly.
Step 2: Remove the first job from θ and insert it into the first stage of the first factory.
Step 3: If θ is not empty, remove the next job j of customer order l. If no jobs of the customer order l have been extracted from θ, then tentatively insert job j into all possible positions of π g where g = 1, 2, . . . , f. Through calculation, we choose to put the job j in the position with minimum C max of all factories, then the job sequence π g ′ is obtained after arranging job j. if there are some jobs belonging to customer order l have been assigned to the factory (for example factory G), then job j must be assigned to the factory G and place job j in the position with minimum C max , then the job sequence π G is obtained after arranging job j.
Step4: Repeat Step3 until θ is empty.
Step5: Get π = {π1, π2, . . . , π f }.
Rule3
Rule3 is similar to Rule2, the difference is that when assigning jobs, we take minimizing TEC as the criterion. Here, we will not elaborate on the specific steps of Rule3.
Figure 12 shows the hybrid initialization strategy. P init is the percentage of initialization population to execute Rule2, and Rule3 strategies, and the remaining (1-2*P init ) will execute the Rule1 strategy.

Population initialization based on hybrid strategy.
According to the characteristics of EDORHFSP, five neighborhood search methods are designed in the paper:
Orders_Swap_among_Factories, Orders_Insert_among_Factories, Job_Best_Insert_within_Factory, Job_Best_Swap_within_Factory and
Jobs_Inverse_within_Factory.
Orders_Swap_among_Factories
Firstly, find the critical factory f c with maximum completion time among all factories. Then, try to exchange the customer order in factory f c with other customer orders in the remaining factories sequentially. Next, the jobs of two chosen orders are reinserted into the appropriate position of the target factories one by one. Accept the exchange if the C max can be reduced until all possible exchanges are completed.
Orders_Random_Insert_other_Factory
At first, find the critical factory f c with maximum completion time among all factories. Then, select a customer order randomly form π fc and insert it into another factory (select a factory randomly different from f c ). Obviously, the procedure does not guarantee to find a better solution, but it can greatly increase the diversity of individuals.
Job_Best_Insert_within_Factory
A job j is randomly extracted from π g to generate jobs sequence π g ′ and inserted it into all possible positions of π g ′. The job will be re-assigned, if a better solution is gotten. The pseudo code for the Job_Best_Insert_within_Factory is as follows.
Job_Best_Swap_within_Factory
This procedure attempts to swap the job j with any one of the rest jobs within the factory. If a better solution is obtained, the jobs sequence is updated. The pseudo code for the Job_Best_Swap_within_Factory is as follows.
Jobs_Inverse_within_Factory
Invert the sub-sequence randomly between two different positions within the critical factory f c .
Due to a large number of jobs, machines and operations are involved in this EDORHFSP, the neighborhood local search is conducted mainly within the critical factory f c . In addition, to improve the diversity of the population, we will do some exploration in the other factories. The pseudo code for Neighborhood_Search_methods is as follows.
Numerical experiments and comparisons
Generating test data
As a new problem, there is no ready-made test data in related research. Therefore, we will generate the test data based on the famous benchmark sets created by Cho et al. [6] for the RHFSP. For each instance, the number of jobs, stages, machines, re-entrances, processing times, customer orders and factories are random integers from the uniform distributions U[10, 50], U[5, 25], U[1, 6], U[1,6, 1,6], U[1, 30], U[5, 8] and U[2, 4], respectively.
In this paper, the TOU electricity price scheme consists of seven pricing periods one day. Figure 13 shows the piecewise function diagram of electricity price. In the figure, the price (1.202 CNY/Kwh) in peak periods is more than four times as high as that (0.285 CNY/Kwh) in off-peak periods. Such a huge change in electricity prices provides a huge opportunity for energy intensive manufacturing companies to save costs.

TOU electricity price over 24 hours.
All programs are coded in Matlab on the computer with i7-10510U CPU@1.80 GHz and 16 G RAM.
The following three metrics (IGD, C, SP) are used to evaluate the performance of MA. In addition, since the optimal pareto fronts (OPF) of the instances are unknown, we use an approximate pareto front (APF) instead of OPF. Specifically, for each instance, APF can be obtained by combining the non-dominated solutions obtained by all the algorithms into one set and then removing the dominated solutions from the set. In addition, due to different dimensions, it is necessary to standardize before calculating them.
IGD (Inverted Generational Distance) is a comprehensive metric which is used to evaluate evaluates the convergence and distribution performance of the algorithm. The calculation formula is as shown in (20).
In which, |N*| denotes the number of non-dominated solutions on the OPF. N is the non-dominated solutions set obtained by one algorithm. dist (x, N) represents the Euclidean distance between the solution x ∈ N* and the nearest solution on N. Clearly, the smaller the IGD, the better the performance. In an extreme case, IGD = 0 means that N is a subset of N*.
C metric is used to measure the dominating relationship between two non-dominated solution sets. C(A, B) means the percentage of the solutions in B that are dominated by at least one solution in A. C (A, B) =0 indicates that no solution in B is dominated by any solution in A. C (A, B) =1 indicates that all solutions in B are dominated by some solutions in A.
SP is used to measure the distribution uniformity of the non-dominated solutions on the pareto front. In an extreme case, SP = 0 indicates that the non-dominated solutions on the pareto front are evenly distributed.
Where,
MA mainly involves four key parameters: PopSize (population size), P init (the percentage of initialization population to execute Rule2 and Rule3 in population initialization), P Insert (the probability of performing Orders_Random_Insert_other_Factory), G max (the maximum number of generations). Taguchi method of design-of-experiments (DOE) is used to investigate the effect of parameters setting on the performance of MA. As shown in Table 3, each parameter contains four factor levels. Moreover, the orthogonal array L16(44) is used and the MA will run 20 times independently for every parameter combination on each instance. After all the experiments are done, the average of dominant metric Ω of each parameter combination is regarded as the response variable (RV) value, as shown in Table 4. The dominant metric Ω represents the percentage of non-dominated solutions obtained by an algorithm that are also non-dominated solutions on the OPF.
Parameters combination
Parameters combination
Orthogonal array and ARV values
The average RV and the significance rank are shown in Table 5. The larger the delta is, the more significant the parameter is. Table 5 shows that P Insert is the most significant parameter, PopSize ranks the second, G max and P init ranks the third and the last, respectively. To be specific, a proper P Insert is help to prevent the algorithm from falling into local optimum. For PopSize, a small PopSize will lead to insufficient sampling of the solution space, while a large PopSize could lead to inadequate evolutionary processes. As for P init , a suitable value of P init is helpful to balance the diversity and quality of the initial solutions. The trend of each factor is shown in Fig. 14. Based on the above analysis, it is suggested to select the appropriate parameter combination as PopSize = 60, P init = 0.3, P Insert = 0.1 and G max = 100 in the following numerical experiments.
RV and rank of each parameter

Factor level trend.
In this paper, three heuristic rules are designed for population initialization. It is necessary to compare MA with MA1 (random initialization using Rule1 only) to verify the effectiveness of population initialization. Each instance runs for 20 times independently. The average C metric of 8 instances and the p values obtained by Wilcoxon signed-rank test are listed in Table 6 and the boxplots of C metric are shown in Fig. 15. When p value is less than 0.05, there is a significant difference between the two algorithms.
Comparison of C metric between MA and MA1
Comparison of C metric between MA and MA1

Boxplot of C metric between MA and MA1.
Table 6 shows that C(MA, MA1) is larger than C(MA1, MA) on all instances, which implies that most non-dominated solutions obtained by MA1 are dominated by those obtained by MA. In addition, the p values of all the instances are less than 0.05, which indicates that the designed population initialization procedure is significantly effective to solve the EDORHFSP.
To demonstrate the effectiveness of energy cost saving, we compare the MA with MA without energy cost saving, denoted as MA2. Each instance runs 20 times independently. The average C metric of 8 instances and the p values obtained by Wilcoxon signed-rank test are recorded in Table 7 and Fig. 16 is the boxplots of C metric.
Comparison of C metric between MA and MA2
Comparison of C metric between MA and MA2

Boxplot of C metric between MA and MA2.
Table 7 shows that C(MA, MA2) is larger than C(MA2, MA) on all instances, which implies that most non-dominated solutions obtained by MA2 are dominated by those obtained by MA. In addition, p values of all the instances are less than 0.05, which means that the energy cost saving procedure is significantly effective to solve the EDORHFSP. The pareto fronts on the scale (20,10,1) instance with r = 8, f = 4 and the scale (16,6,1) instance with r = 4, f = 2 are shown in Figs. 17 and 18, which further verify the above conclusion.

Pareto front on the scale (20,10,1) instance with r = 8 and f = 4.

Pareto front on the scale (16,6,1) instance with r = 4 and f = 2.
To validate the performance of the proposed MA, SPEAII, MODE and NSGAII are selected for comparative study. 8 instances of different sizes are randomly selected from the 240 instances with three different [r, f] combinations. Each instance runs 20 times independently. To make an overall comparison, the average values of three performance metrics are listed in the Tables 8, 9 and 10. The boxplots of three metrics are shown in Figs. 19 and 20. As we all know, the average values of three metrics can only represent the performance from the macroscopic perspective, so it is necessary to carry out the Wilcoxon signed-rank test to show the difference is significant or not.
Performance metrics of three algorithms (r = 4, f = 2, A: MA, B: MODE, C: SPEA-II, D: NSGA-II)
Performance metrics of three algorithms (r = 4, f = 2, A: MA, B: MODE, C: SPEA-II, D: NSGA-II)
Performance metrics of three algorithms (r = 6, f = 3, A: MA, B: MODE, C: SPEA-II, D: NSGA-II)
Performance metrics of three algorithms (r = 8, f = 4, A: MA, B: MODE, C: SPEA-II, D: NSGA-II)

Boxplot of IGD and SP metrics for all algorithms.

Boxplot of C metric for all algorithms.
The above three tables show that IGD and SP of the MA is smaller than those of the MODE, SPEA-II and NSGA-II on every instance, which implies that the MA is superior to the MODE, SPEA-II and NSGA-II in terms of IGD and SP metrics. Meanwhile, C(MA, MODE), C(MA, SPEA-II) and C(MA, NSGA-II) are greater than C(MODE, MA), C(SPEA-II, MA) and C(NSGA-II, MA) respectively on all instances, which implies that most non-dominated solutions obtained by MODE, SPEA-II and NSGA-II are dominated by those obtained by MA. In terms of C metric, since most of p values are smaller than 0.05, therefore, MA is clearly superior to that of MODE, SPEA-II and NSGA-II. Figures 19 and 20 further verify the above conclusions.
Take the instance with scale (19,9,1) as an example, in which there are 19 jobs, 9 stages, 1 re-entrance, 2 factories, 5 customer orders and J1 = {1, 2} , J2 = {3} , J3 = {4, 5, 6, 7, 8, 9} , J4 = {10, 11} and J5 = {12, 13, 14, 15, 16, 17, 18, 19}. In addition, there are 2, 1, 2, 2, 1, 2, 1, 2 and 1 machines at each stage, respectively. Take a non-dominated solution π = {, linebreak [19, 11, 12, 14, 18, 10, 16, 3, 17, 13, 15]} as an example. Obviously, Customer orders J1 and J3 are processed in factory 1 and customer orders J2, J4 and J5 are processed in factory 2. The Gantt charts without considering TOU are illustrated in Figs. 21 and 22 with C max = 100 hours and TEC = 5730.9650 CNY. The Gantt charts considering TOU are illustrated in Figs. 23 and 24 with C max = 100 hours and TEC = 5492.1233 CNY. Comparisons show that the total TEC is reduced by 4.17% to 238.8417 CNY without affecting the C max . Exploring its reason, it is not difficult to discover that processing periods of some operations have been shifted to right. For example, the processing periods of operations “102”, “201”, “202”, “6016”, “706”, “304”, “305”, “1301”, “1302” and “1607” move from higher price to lower price. Meanwhile, the total energy consumption curves in the two factories are shown in Fig. 25. The figure shows that electricity load shifts obviously in some periods, such as, about 25 hours, 80 hours and 90 hours of factories 1, about 12 hours, 40 hours and 70 hours of factories 2. To study the change trend of the energy consumption cost before and after considering TOU, taking the corresponding scheduling scheme in Figs. 21–24 as an example, the energy consumption cost histogram is shown in Fig. 26. It suggests that in factory 1 and factory 2, the energy consumption cost in idle state increases slightly after considering TOU, but the energy consumption cost is significantly reduced in processing state, which leads to the reduction of TEC. The reason is that the unit energy consumption of machines in the processing state is far greater than that in the idle state. Therefore, it is necessary to reduce the processing period at the high electricity price as far as possible, but this process may increase the energy consumption cost in the idle period. To sum up, the energy consumption cost can be saved by avoiding the periods at the high electricity price, meanwhile, the MA algorithm can solve the EDORHFSP effectively.

Gantt charts without considering TOU of factory 1.

Gantt charts without considering TOU of factory 2.

Gantt charts considering TOU of factory 1.

Gantt charts considering TOU of factory 2.

Energy consumption curves.

The comparison about the energy consumption cost before and after considering TOU.
In this study, a memetic algorithm is proposed to solve the energy-efficient distributed re-entrant hybrid flow shop scheduling problem considering the customer order constraints under TOU electricity price. some customer orders require production in multiple factories and jobs belonging to the same customer order must be processed in the same factory. The main contributions of this paper are as follows: (1) Order constraint is introduced to scheduling problem, which is closer to the actual production. (2) A mathematical model is established for the EDORHFSP aiming at minimizing the C max and TEC. (3) Based on the characteristics of the problem, the encoding scheme, decoding methods and three heuristic rules of population initialization are designed. (4) In order to avoid local optimum and premature convergence, energy cost saving procedure and some local neighborhood search methods are designed to improve the performance of the algorithm. (5) The superiority and effectiveness of the algorithm are verified by a large number of simulation experiments.
Numerical experiments show that the proposed algorithm has better performances than the MODE, SPEA-II and NSGA-II algorithms and TEC can be reduced by transferring the operations from peak periods to mid-peak or off-peak periods. In the future, EDORHFSP will be further studied, such as designing better algorithms, introducing dynamic speed of machines, uncertain scheduling, andso on.
Funding
The work is supported by National Natural Science Foundation of China (NO. 71840003).
