Introduction

Flowshop scheduling problems are hot topics in the field of intelligent optimization and control systems. Among them, the hybrid flowshop scheduling problem (HFSP) has been extensively studied due to its wide range of applications, such as steelmaking system [1], tempered glass manufacturing system [2] and micro-electronics manufacturing system [3]. Ruiz and Vázquez-Rodríguez pointed out the model of HFSP, where n jobs should be processed in successive S stages optimizing for given objective function [4]. HFSP is an extension of classical flowshop scheduling problem (FSP), and the difference between them is the existence of parallel machines (m > 1) for each stage. Since the coupling of the two sub-problems (job scheduling and machine allocation) make production more flexible while expanding the search of the solution space, this poses a challenge for heuristic design.

The distributed manufacturing mode (DMM) is valued for reducing costs and more flexibility [5]. It aims to assign jobs to a suitable factory and schedule a sequence of jobs for each factory to obtain the optimal objective value [6]. DMM has been widely applied in prefabricated system [7] and steel production system [8, 9], and has proven to be effective in improving the overall efficiency of production. Thus, the distributed hybrid flowshop scheduling problem (DHFSP) has been more focused, which is combined both advantages of DMM and HFS. The additional coupled sub-problem also poses a challenge to algorithms for searching suitable factory assignment plans.

In previous studies on HFSPs, the processing time of the job was assumed to be a fixed positive parameter. However, in real production, the machine can control the processing time by the additional resources allocated to it, especially when CNC machines are involved [10]. Additional resources can be defined as fuels, tools, manpower and so on [11], which are necessary for the start of job processing. According to the divisibility of resource, it is categorized into two types: continuous or discrete divisibility. The former means that resources can be divided into arbitrary units, while the latter means that resources are divided into fixed units. Among the discrete divisibility resource, resource-dependent processing time (RDPT) has captured the most attention in HFSP, which can be found in the study of CNC machines using tools to control processing times [10] and the scheduling production process in which manpower resources are involved [12]. RDPT is linearly related to the units of resource, i.e., a reasonable allocation of resources is not only effective in starting the jobs on time, but also in reducing the overall processing time. This point can be demonstrated in the production of steel. In the steel production industry, the processing time of the ingot preheating process before hot rolling can be reduced by allocating some additional fuel [13]. Thus, planning the allocation of fuel to each furnace to achieve a reduction in the time taken to melt the steel is the key issue.

Pan et al. investigated the HFSP that arises in the steelmaking process, which consists of three successive stages: steelmaking, re-refining, and continuous casting [14]. And RDPT problem also exists at these stages, such as, Janiak et al. pointed out that during the melting stage, the furnace needs to be preheated in advance, and the preheating time is inversely proportional to the time of additional fuel addition [15]. Biskup et al. also stated, different quality and amount of diamond drills used for different drilling machines can effectively control the processing time [16]. Ng et al. studied the time spent on an assembly line in steel production depending on the number and efficiency of workers [12].

With economic development, the DHFSP-RDPT is more worthy in steel production. Figure 1 shows the process of distributed steel production system (DSPS). First, the planning department receives product orders. Then, allocates jobs rationally to factories. Each factory is responsible for completing all processing operations for allocated jobs, as well as allocating resources, scheduling jobs. Finally, all factories complete the production of their respective products and then deliver the products to the customers in a unified manner.

Fig. 1
figure 1

Process flowchart of the distributed steel production

The above description is the operational flow of the DSPS. In the DSPS, each steel factory can be regarded as a hybrid flowshop with a resource warehouse. Each job needs to be processed through three consecutive stages, i.e., steelmaking, re-refining, and continuous casting. However, each stage of processing in the steel factory requires an additional resource. These resources have different functions, for example, fuel is responsible for heating up the furnace, molds are responsible for setting the shape, diamond drills and grinding wheels are needed for the machine, and workers are responsible for using the machine to perform the welding process. However, there is an inverse relationship between the quality and quantity of the same type resources. High-quality resources are scarce, although they can reduce processing time significantly. Such as high-quality drill bits can dramatically reduce processing time, but because of their high cost, they can only be stocked in small quantities in the typical steel factory. Meanwhile, the number of resources used is proportional to the reduction in processing time, i.e., the more resources allocated, the shorter the processing time. Such as, adding more fuel allows the furnace to heat up quickly, which in turn shortens the time it takes for steel to go from solid to liquid.

The warehouse keeps multiple types of resources to cope with resource shortages. Although they have different effects on processing times, they all perform the same function. However, resource scheduling research in RDPT and multiple types are still lacking researching due to the complex multi-dimensional sub-problems.

Motivated by the above challenges in manufacturing systems, this study focuses on solving DHFSP-RDPT, which is a combination of DHFSP and RDPT. The classic HFSP has been proven to be NP-hard problem [4]. Optimizing the DHFSP-RDPT is a decision-making process for factory assignment, machine assignment, job scheduling and resource allocation, which is also a NP-hard problem.

By dissecting the previous research, there are fewer studies combining DHFSP and RDPT. To meet this challenge, an adaptive gain-sharing knowledge algorithm combined with machine learning method is proposed to find the optimal solution for the DHFSP-RDPT with minimum makespan, including rational factory assignments, scheduling sequences, and resource allocation schemes. The main contributions are threefold:

  1. 1.

    The DHFSP with resource-dependent processing times for multiple types of renewable resources is considered, and the mathematical model is proposed;

  2. 2.

    By analyzing the characteristics of the DHFSP-RDPT, two resource reallocation heuristics are proposed based on four problem-specific lemmas, and employed to enhance the local search capability of proposed algorithm;

  3. 3.

    A DGSK, embedded with three initialized rules, a discrete evolutionary based global search strategy and a meta-Lamarckian learning based local search method, is developed in accordance with the many-coupled sub-problem characteristic of the considered problem.

  4. 4.

    The results from running simulations of the DGSK algorithm on three different scales of instances (i.e., small, medium, and large) are compared to the simulation results using five state-of-the-art algorithms, including the genetic algorithm (GA) [17], the simulated annealing algorithm (SA) [18] the self-adaptive artificial bee colony algorithm (SABC) [19], the hybrid algorithm (HA) [20], and the parameter-less iterated greedy (IGMR) [21]. The criteria for evaluation consist of the convergence speed and the efficiency of the obtained solutions. The numerical results verify the superiority of convergence ability and solution results of DGSK when solving DHFSP-RDPT.

The rest of the sections are organized as follows: Sect. Literature review is the literature review. Section Problem description detailed describes the proposed problem and two resource reallocation rules. Section Framework of the proposed algorithm introduces the detailed of DGSK algorithm.in detail Sect. Experimental results presents experimental comparisons and analysis. Section Conclusion gives the conclusions and future work.

Literature review

Hybrid flowshop scheduling

Several algorithms have been applied to address the HFSP, such as the ant colony optimization (ACO) algorithm [22], the cuckoo search (CS) algorithm [23], the genetic algorithm (GA) [17], the iterated greedy algorithm with a speed-up procedure [24].

As the processes continue to become intelligent, more realistic constraints were researched. Mirsanei et al. presented a simulated annealing (SA) algorithm to solve the HFSP with sequence-dependent setup time [25]. Choong et al. proved that the particle swarm optimization (PSO) combined with the SA obtained better results in solving the HFSP with multiprocessor tasks [26]. Li and Pan combined the artificial bee colony (ABC) algorithm and tabu search (TS) to address the HFSP with machine-limited buffers [27]. Chamnanlor et al. presented a genetic algorithm hybridized ant colony optimization (GACO) for addressing the HFSP with time window constraints [28]. Rashidi et al. proposed a redirect procedure for the improved hybrid multi-objective parallel genetic algorithm (IHMOPGA) to avoid falling into a local optimum when solving the HFSP with sequence-dependent setup times and processor blocking [29]. Costa et al. proposed a hybrid backtracking search method for solving the HFSP with limited workforce [30]. More complex processing environments are also receiving attention. Gicquel et al. addressed the HFSP with multiprocessor tasks, zero buffer capacity and limited waiting time simultaneously by cutting-plane algorithm (CPA) [31]. Li et al. proposed a bi-population balancing multi-objective evolutionary algorithm to solve the fuzzy flexible job shop scheduling problem, which is arising in the steelmaking system [32].

According to the above literature, many realistic constraints have been regarded in the HFSP. However, distributed factories, which may be necessary in most HFSPs, are mentioned in a few studies.

Distributed hybrid flowshop scheduling

The cooperation of factories has received more research. To tackle this complex problem in a single objective, Shao et al. proposed a model for the DHFSP and addressed it by a multi-neighborhood iterated greedy algorithm [9]. Cai et al. designed a dynamic search process in a shuffled frog-leaping algorithm (DSFLA) to address the DHFSP with multiprocessor tasks [33]. Wang et al. developed a bi-population cooperative memetic algorithm (BCMA) with knowledge-based methods [34]. Du et al. used a learn-to-improve reinforcement learning approach, which is a combination of three coordinated double deep Q-networks to solve the distributed scheduling problem in precast concrete production [35]. Li et al. presented an improved brainstorm optimization algorithm to optimize the fuzzy complication time [36].

The exploration of multi-objective DHFSP also reflects the advantages of DHFSP. Lei and Wang proposed a diversified search processes to minimize makespan and the number of tardy jobs in the DHFSP [37]. Zheng et al. minimized the fuzzy total tardiness and robustness by the cooperative coevolution algorithm [38]. Shao et al. designed several problem-specific local search operators based on the objectives of makespan, earliness and tardiness, and workload [8]. Lu et al. investigated the DHFSP with objectives of makespan and total energy consumption [39]. Li et al. designed four problem-specific lemmas to guide the knowledge-based multi-objective algorithm in solving the DHFSP with four objectives [7].

While efficient methods have been developed for solving DHFSP problems with different constraints and different objectives, DHFSP considering resource constraints has been addressed by few studies. Especially, the strong coupling of sub-problems associated with RDPT leads to a complex solution space which is difficult to search adequately.

Scheduling with resources for operations

Till now, the research on HFSPs with resource constraints is rare. The resource constraint scheduling problem can be formulated by the precedence model [10]. Li et al. addressed the flexible job shop problem with limited transportation resource by a hybrid iterated greedy algorithm [40]. The GA, SA [18] and column generation algorithm [41] are applied to solve the two-stage HFSP with renewable resources. Tao et al. improved the ABC algorithm with a self-adaptive strategy to solve resource constraints in DHFS [19].

As for dynamic processing time with resource, Wei et al. formulated the single-machine scheduling with RDPT [42]. Liu and Feng extended the model from a single-machine to two-machine in no-wait FSP [43]. And Yin et al. researched the unrelated parallel machine scheduling model [44]. Mollaei et al. considered the bi-objective MILP model [45]. A heuristic (CL) is efficient for the scheduling problem with RDPT [46]. Mokhtari et al. proposed a hybrid discrete differential evolution (HDDE) algorithm [47] and Behnamian et al. proposed multi-objective hybrid metaheuristic (MOHM) [20].

Therefore, it is challenging to develop efficient methods and algorithms for the DHFSP with resource constraints, especially for the resource-dependent processing time.

Summary of the literature review

Table 1 summarizes the HFSP and DHFSP literature in terms of algorithms, objective functions, machine allocation methods, and factory allocation methods. It is obvious from Table 1 that (1) first available machine selection (FAM) and earliest complete time machine selection (ECT) methods are effective in solving the machine assignment problem. However, when dealing with strong resource constraint, the heuristic methods need to be improved. (2) Despite critical factory-based operators can improve the local search capability for better factory assignment schemes, the performance of the local search is degraded if the multi-dimensional sub-problem strong coupling. Thus, local search requires an in-depth exploration of the dimensions of the optimal potential, especially considering resource allocation.

Table 1 Literature review for HFSP and DHFSP

Table 2 lists the research of flowshop scheduling problems for resource constrained processing operations. The analysis from the point of view of approach and resource attributes shows that (1) Resource-dependent processing times with for multiple types of renewable resources are rarely studied in HFSP due to the complexity of multi-dimensional sub-problem. (2) Few resource adjustment rules combined with effective local search strategies have been proposed to optimize resource allocation schemes.

Table 2 Literature review for scheduling with resources for operations

Many methodologies for solving complex optimization problems have been researched in existing literature. Such as, Ebrahimnejad et al. suggested using knowledge-based heuristics to improve the efficiency ABC [48]. Then, Abbaszadeh et al. improved the elite ABC (EABC) algorithm to increase the convergence rate for addressing the fuzzy optimization problem [49]. For the multi-objective optimization problem, Alrezaamiri et al. proposed a fuzzy artificial chemical reaction optimization algorithm and a parallel multi-objective ABC algorithm to improve the quality of the non-dominated solutions searched [50, 51]. Solving NP-hard problems is a challenge faced in the field of optimization algorithms. Therefore, Kalantari et al. proposed a whale optimization algorithm-based approach and an efficient improved ACO algorithm to meet the challenge [52, 53]. Furthermore, it is also important to balance runtime and convergence capacity. Thus, Pirozmand et al. applied a binary artificial algae algorithm to reduced problem solving time [54] and Caprio et al. used a fuzzy-based ACO algorithm to improve the convergence rate when solving the problem [55]. Each of these approaches provides technical support for solving DHFSP-RDPT.

Problem description

The proposed DHFSP with resource-dependent processing time can be described as follows. \(J=\{\mathrm{1,2},\cdots ,n\}\) jobs are assigned to \(F=\{\mathrm{1,2},\cdots ,h\}\) factories and each factory is considered as a hybrid flowshop, which contains \({M}_{k}\) parallel machines with \(K=\{\mathrm{1,2},\cdots ,S\}\) stages. The number of parallel machines \({M}_{k}\) in each stage is different, and at least one stage must satisfy \({M}_{k}>1\). The set of jobs assigned factory f need to complete all stages of the processing operation in turn before output. Figure 2 is the process flowchart of DHFSP-RDPT. It can be seen from Fig. 2 that each factory has a resource warehouse to store resources used in processing. There are \({R}_{k}\) types of resources available at each stage. The total number of resources of each type depends on the \({a}_{t,k}\), which is a linear compression rate of the resources on the processing time. The \({a}_{t,k}\) causes the standard processing time \({pt}_{j,k}\) to decrease as the number of resources \({u}_{t,j,k,f}\) (\({u}_{t,j,k,f}>1\)) used increases. A processing operation can start only if it obtains \({u}_{t,j,k,f}\) units of type t resources. Since the storage of each type of resource is limited, when the resource stored does not satisfy the arrangement, the job will wait in the machine buffer until a sufficient of resource t is released. In this paper, the resource is renewable, i.e., when the processing operation is completed, the occupied resources are returned to the warehouse. Therefore, the scheduling problem contains four parts to determine the maximum completion time (makespan), i.e., (1) factory assignment for each job, (2) the job processing order; (3) types of resources used for each operation and (4) the units allocated to the operations.

Fig. 2
figure 2

Process flowchart of the DHFS-RDPT

To fully formulate the DHFS-RDPT, some assumptions are given as follows.

  • Once the job starts processing, it cannot be interrupted or transferred until the processing is completed.

  • The job can be processed by only one parallel machine at any stage.

  • The job can only choose one factory and complete all stages of processing.

  • The job must be processed in the order of stages.

  • Each machine can only process one job at a time.

  • The buffer of machines is infinite.

  • Resources are released immediately when processing is complete.

  • Each resource in use cannot be interrupted.

  • Transportation time of resources and jobs is not considered.

The notations are given to elaborate on the details of the DHFSP-RDPT in Table 3.

Table 3 Parameters and definition for DHFSP-RDPT

Based on the definition of the parameters in Table 3, the formulation of the DHFSP-RDPT is described as follows. Objective:

$$ \min C_{\max } \, $$
(1)

Subject to:

$$ C_{\max } \ge C_{j,S,f} \, \forall j,f $$
(2)
$$ MS_{i,p,f} \ge 0 \, \forall i \in M_{k} ,p,f $$
(3)
$$ MC_{i,p,f} \ge MS_{i,p,f} \, \forall i \in M_{k} ,p,f $$
(4)
$$ S_{j,k,f} \ge 0 \, \forall j,k,f $$
(5)
$$ C_{j,k,f} \ge 0 \, \forall j,k,f $$
(6)
$$ MS_{i,p + 1,f} \ge MC_{i,p,f} \, \forall i \in M_{k} ,p,f $$
(7)
$$ MS_{i,p + 1,k,f} \ge MC_{i,p,k,f} - M \times (1 - X_{i,t,j,k,p,r,f} ) \, \forall i \in M_{k} ,p,j,k,f,res,r $$
(8)
$$ Apt_{j,k} = pt_{j,k} - a_{t,k} u_{t,j,k,f} > 0 \, \forall t \in R_{k} ,j,k,f $$
(9)
$$ \begin{aligned} MC_{i,pr,k,f} &= MS_{i,pr,k,f}\\ &\quad +\sum\limits_{j = 1}^{n} \sum\limits_{{t \in R_{k} }}^{{}} Apt_{j,k,t}\\ &\quad \times X_{i,t,j,k,p,r,f} \, \forall i \in M_{k} ,k,p,r,f \end{aligned}$$
(10)
$$ C_{j,k,f} \le S_{j,k + 1,f} { + }M \times \;\left( {1 - \sum\limits_{p = 1}^{Tp} {\sum\limits_{r = 1}^{Tr} {X_{i,t,j,k,p,r,f} } } } \right) \, \forall j,k \ge 1,i \in M_{k + 1} ,t \in R_{k + 1} ,f $$
(11)
$$ \sum\limits_{f = 1}^{F} {\sum\limits_{{i \in M_{k} }}^{{}} {\sum\limits_{p = 1}^{Tp} {\sum\limits_{{res \in R_{k} }}^{{}} {\sum\limits_{r = 1}^{Rp} {X_{i,t,j,k,p,r,f} } } } } } = 1 \, \forall j,k $$
(12)
$$ \sum\limits_{f = 1}^{F} {U_{j,k,f} } = 1 \, \forall j,k $$
(13)
$$ \sum\limits_{{i \in M_{k} }} {\sum\limits_{p = 1}^{Tp} {Z_{j,i,k,p,f} } } = 1\;\forall j,k,f $$
(14)
$$ \sum\limits_{{t \in R_{k} }}^{{}} {\sum\limits_{r = 1}^{Tr} {Y_{j,t,k,r,f} } } = 1 \, \forall j,k,f $$
(15)
$$ U_{j,k,f} = U_{j,k - 1,f} \, \forall j,1 \le k \le S,f $$
(16)
$$ \sum\limits_{j = 1}^{n} {\sum\limits_{k = 1}^{S} {X_{i,t,j,k,p,r,f} } } \le 1 \, \forall i \in M_{k} ,p,t \in R_{k} ,r,f $$
(17)
$$ \sum\limits_{j = 1}^{n} {X_{i,t,j,k,p,r,f} } \ge \sum\limits_{j^{\prime} = 1}^{n} {X_{i,t,j,k,p + 1,r,f} } \, \forall i \in M_{k} ,1 \le p \le Tp - 1,k,t \in R_{k} ,r,f $$
(18)
$$ \begin{aligned} MS_{i,p,f} &\le S_{j,k,f} { + }M \times \left( {1 - X_{i,t,j,k,p,r,f} } \right) \, \forall j,\\ &\qquad k,i \in M_{k} ,p,t \in R_{k} ,r,f \end{aligned}$$
(19)
$$ MS_{i,p,f} { + }M \times \left( {1 - X_{i,t,j,k,p,r,f} } \right) \, \ge S_{j,k,f} \, \forall j,k,i \in M_{k} ,p,t \in R_{k} ,r,f $$
(20)
$$ \begin{aligned} MC_{i,p,f} &\le C_{j,k,f} { + }M \times \left( {1 - X_{i,t,j,k,p,r,f} } \right) \, \forall j,\\ &\qquad k,i \in M_{k} ,p,t \in R_{k} ,r,f \end{aligned}$$
(21)
$$ MC_{i,p,f} { + }M \times \left( {1 - X_{i,t,j,k,p,r,f} } \right) \ge C_{j,k,f} \, \forall j,k,i \in M_{k} ,p,t \in R_{k} ,r,f $$
(22)
$$ RS_{t,r,k,f} \ge 0 \, \forall t \in R_{k} ,r,k.f $$
(23)
$$ RC_{t,r,k,f} \ge RS_{t,r,k,f} \, \forall t \in R_{k} ,r,k.f $$
(24)
$$ RS_{t,r + 1,k,f} \ge RS_{t,r,k,f} \, \forall t \in R_{k} ,r,k.f $$
(25)
$$ 1 \le \sum\limits_{j = 1}^{n} {\sum\limits_{r = 1}^{Tr} {u_{t,j,k,f} Y_{j,t,k,r,f} } } \le TR_{t,k,f} \, \forall t \in R_{k} ,k.f $$
(26)
$$ RS_{t,r,k,f} \ge MS_{i,p,k,f} + M \times (1 - X_{i,t,j,k,p,r,f} ) \, \forall t \in R_{k} ,r,i \in M_{k} ,p,k,f $$
(27)
$$ RS_{t,r,k,f} + M \times (1 - X_{i,t,j,k,p,r,f} ) \ge MS_{i,p,k,f} \, \forall t \in R_{k} ,r,i \in M_{k} ,p,k,f $$
(28)
$$ RC_{t,r,k,f} \ge MC_{i,p,k,f} + M \times (1 - X_{i,t,j,k,p,r,f} ) \, \forall t \in R_{k} ,r,i \in M_{k} ,p,k,f $$
(29)
$$ RC_{t,r,k,f} + M \times (1 - X_{i,t,j,k,p,r,f} ) \ge MC_{i,p,k,f} \, \forall t \in R_{k} ,r,i \in M_{k} ,p,k,f $$
(30)
$$ \sum\limits_{{i \in M_{k} }}^{{}} {\sum\limits_{p = 1}^{Tp} {X_{i,t,j,k,p,r,f} } } = Y_{j,t,k,r,f} \, \forall j,t \in R_{k} ,k,r,f $$
(31)
$$ \sum\limits_{{t \in R_{k} }}^{{}} {\sum\limits_{r = 1}^{Tr} {X_{i,t,j,k,p,r,f} } } = Z_{j,i,k,p,f} \, \forall j,i \in M_{k} ,k,p,f $$
(32)

The objective is to minimize the makespan, which is described in Constraint (1). Constraint (2) denotes that the makespan depends on the completion time of the last stage of the jobs in each factory. Constraint (3) ensures that, for each machining position on the machine, the machine's start machining time is positive, and constraint (4) ensures that the machine's completion time should be greater than or equal to the start time. Constraints (5) and (6) keep the start processing time and completion processing time of the job positive, respectively. Constraints (7) and (8) indicate that for two consecutive processing positions on each machine, the start time of the succeeding position is greater than or equal to the end time of the preceding position. Constraints (9) defines the actual processing time (i.e., resource-dependent processing time) of each job at each stage, which is dependent on the number of allocated resource t and the compression rate of the resources t. Constraints (10) make sure that the processing should not be interrupted at each position on each machine. The Constraint (11) guarantees that in two consecutive stages of a job, the processing operation of the subsequent stage should be carried out after the completion of the processing operation of the previous stage. Constraints (12–15) enforces that each job can only be assigned to one factory, and for each stage, each job can only be processed on only one machine at only one processing position and select only one resource type with one occupancy priority. Constraints (16) ensures that the jobs should complete all stages of processing operations in the assigned factory. Constraints (17, 18) denotes each operation selects the first available processing position on the specified machine. Constraints (19–22) create the relationship between machine start processing time and job start processing time as well as machine completion processing time and job completion processing time. For each occupancy priority of resource types, Constraint (23) indicates the start using time should be a positive value and Constraint (24) ensures that the releasing time should be larger or equal to the start using time. Constraint (25) makes sure that resources cannot be occupied by more than two jobs at the same time. Constraint (26) denoted the number of resources allocated cannot exceed the maximum value. Constraints (27–30) create the relationship between machine processing time and resource occupancy time. Constraint (31) restricts that each unit of resource can only use by one machine for processing one operation and Constraint (32) restricts that each machine can only process one operation with one resource type.

Resource-dependent processing times with multiple types of resources

The actual processing time \({Apt}_{j,k}\) of the job j is dynamically changed at stage k according to the allocated resources (type and units), which is called resource-dependent processing time (RDPT). More specifically, when the job j is processed in stage k, \({u}_{t,j,k,f}=\{\mathrm{1,2},\cdots ,{TR}_{t,k,f}\}\) units of resource t can be allocated to speed up the processing. The \({TR}_{t,k,f}\) is the maximum amount of resource t, which is dependent on the remaining amount of resources t in the process. Since the resource in the proposed problem is renewable, there is no need to consider the sum of units in each stage, which is different from the RDPT with nonrenewable resources [47]. The \({Apt}_{j,k}\) can be defined by Formula (9), which is linear with the amounts of allocated resources. The \({a}_{t,k}\) is linear compression ratio for stander processing time (\({pt}_{j,k}\)), which represents a constant factor that reduces the processing time per unit of resource t.

Thus, \({a}_{t,k}{\times u}_{t,j,k,f}\) determines the reduced processing time, and it conforms to Formula (33). The upper and lower limits of \({Apt}_{j,k}\) are (\(pt_{j,k} - a_{t,k} \times 1\)) and (\(pt_{j,k} - a_{t,k} TR_{t,k,f}\)), respectively. Figure 3(a) describes the trend of RDPT decreasing with the growth of \({u}_{t,j,k,f}\) for \({pt}_{j,k}\) = 60, \({a}_{t,k}\) = 4, and \({TR}_{t,k,f}\) = 10. It can be seen from Fig. 3 (a) that the upper limit of the RDPT is 60–4 × 1 = 56 and the lower limit is 60–4 × 10 = 20. When the \({u}_{t,j,k,f}\) =5, the RDPT is 60–4 × 5 = 40. It They conform to Formula (33), i.e., \({Apt}_{j,k}({u}_{t,j,k,f}=1)=56>{Apt}_{j,k}({u}_{t,j,k,f}=5)=56{>Apt}_{j,k}({u}_{t,j,k,f}=10)=20\).

$$ Apt_{j,k} (u_{t,j,k,f} = 1) > Apt_{j,k} (u_{t,j,k,f} = 2) > \cdots > Apt_{j,k} (u_{t,j,k,f} = TR_{t,k,f} ) $$
(33)
Fig. 3
figure 3

Example of Lemma 1

The RDPT with multiple types of resources can be defined as follows. Resource type t is indexed from small to large, representing high to low resource quality and low to high resource reserves. In other words, the total amount of resources \({TR}_{t,k,f}\) in each stage is inversely proportional to the linear compression ratio \({a}_{t,k}\), i.e., when \({TR}_{t,k,f}\) conforms to formula (34), \({a}_{t,k}\) conforms to formula (35). Each operation has only one type of resource involved processing. When there is a shortage of resources, the operation needs to wait in the machine buffer until resource t is released and reaches the required units for processing.

$$ TR_{1,k,f} < TR_{1,k,f} < \cdots < TR_{{R_{k} ,k,f}} $$
(34)
$$ a_{1,k} > a_{2,k} > \cdots > a_{{R_{k} ,k}} $$
(35)

Knowledge-based resource reallocation rules

Two knowledge-based rules are proposed to reallocate the amounts of resources, i.e., the rule for (1) reducing resource allocation and (2) increasing resource allocation. To illustrate in detail the effectiveness of the two rules, we present four lemmas in advance.

Lemma 1

In the DHFSP-RDPT, reducing resource shortage time in the critical factory enables lower maximum completion times, which may reduce makespan.

Definition 1

Critical factory

For the distributed production environment, the maximum completion time \({C}_{j,S,f}\) for each factory depends on the time for the last stage of the last operation to complete the processing. According to the Formula (2), the makespan is defined as \(C_{\max } = \max (C_{j,S,1} ,C_{j^{\prime},S,2} , \cdots ,C_{j^{\prime\prime},S,h} )\), i.e., \(C_{\max } = C_{j,S,cf}\), where the \({C}_{j,S,cf}\) is the maximum completion time of critical factory. Obviously, if the \({C}_{j,S,cf}\) can be reduced, \({C}_{max}\) can be effectively reduced.

Proof

Suppose there are only one types of resource (t1 and t3) in each stage, and four jobs (all \({pt}_{j,k}=20)\) need to be processed through two stages, where each stage has two machines. The \({{\text{TR}}}_{{\text{t}},{\text{k}},{\text{f}}}\) and \({{\text{a}}}_{{\text{t}},{\text{k}}}\) are same as the example in Sect. Knowledge-based resource reallocation rules. If all jobs are allocated the maximum amounts of resources at each stage, the Gantt chart for scheduling is shown in Fig. 4(a), \({C}_{max1}=66\). As shown in Fig. 3(a), there are six resources shortage time intervals. Taking the resources shortage time intervals [39, 51] for example, if the \({{\text{RC}}}_{\mathrm{3,4},2,{\text{f}}}\) could be reduced to less than 52 (but not less than 40, and denoted the reduction time as Δ), \( {S{\prime}}_{\mathrm{4,2},f}=\) \( {S}_{\mathrm{4,2},f}-\) Δ, and \( {C{\prime}}_{\mathrm{4,2},f}=\)\({C}_{\mathrm{4,2},f}-\) Δ. Thus, the \({C{\prime}}_{max1}={C}_{max1}-\) Δ < \({C}_{max1}\). Furthermore, the Fig. 3(b) shows the scheduling Gantt chart resulting from rational resource allocation, which has no resource shortage time and the \({C}_{max2} =\) 49 < 66 = \({C}_{max1}\). Therefore, the lemma 1 is proofed.

Fig. 4
figure 4

Example for the two heuristic methods to reallocate resource

Lemma 2

In DHFSP-RDPT, if the amounts of resources allocated for processing at the same moment exceeds the maximum amount of resource, the resource shortage time will occur.

Proof

Suppose that the amounts of resources allocated to two jobs (\(j\),j’) that start processing at the same time are \({u}_{t,j,k,f}\) and \({u}_{t,j{\prime},k,f}\). If \({u}_{t,j,k,f}\) + \({u}_{t,j{\prime},k,f}\)  > \({TR}_{t,k,f}\), it conflicts with Constraint (26). Therefore, there must be a job that needs to wait in the machine's buffer for another job to be machined and release the resource, which results in a resource shortage time. Thus, the lemma 2 is proofed.

Lemma 3

In DHFSP-RDPT, if there is idle time for two adjacent positions of operations at any machine in the first stage, i.e., \(MC_{i,p + 1,1,f} - MS_{i,p,1,f} > 0\), then this idle time is a resource shortage time.

Proof

In the HFSP without constraints, there is no idle time for any machine in the first stage during processing. However, in DHFSP-RDPT, since the total amount of resources is limited, the amounts of resources allocated to jobs being processed at any moment cannot exceed\({TR}_{t,k,f}\). If \(\sum\nolimits_{j = 1}^{n} {\sum\nolimits_{r = 1}^{Tr} {u_{t,j,k,f} Y_{j,t,k,r,f} } } \ge TR_{t,k,f}\), lemma2 holds and a resource shortage time is generated. Taking Fig. 5(a) for further illustration, the existence of an idle time [19, 29] between two adjacent jobs (J1 and J4) processed on M1 is due to the amount of resource t1 that is not sufficient for the simultaneous start processing J3 and J4 now 20. Thus, the lemma 3 is proofed.

Fig. 5
figure 5

Framework of the proposed DGSK algorithm

Lemma 4

In DHFSP-RDPT, if in any stage except the first stage there existed \(MC_{i,p,k,f} - MS_{i,p + 1,k,f} > 0\), and the start time of processing of the job in the succeeding position is not equal to the end time of the job in the previous phase, i.e., \(S_{j,k,f} > C_{j,k - 1,f}\), then this idle time is a resource shortage time.

Proof

In HFSP without constraints, the idle time of the machine in the non-first stage exists because the machine waits for the completion of the job in the front stage. However, in DHFSP-RDPT, based on Lemma 2, an additional reason for idle time is due to waiting for resources. If the additional idle time due to waiting for resources is Δres, \(S_{j,k,f} = C_{j,k - 1,f} + \Delta_{res} > C_{j,k - 1,f}\) and \(MS_{i,p + 1,k,f} - MC_{i,p,k,f} \ge \Delta_{res} > 0\). Taking Fig. 5(a) for further illustration, there exists idle time [39, 54] on M3, however, \(S_{4,2,f} = C_{4,1,f} = 55\), hence [39, 54] is not a resource shortage time. There exists idle time [29, 39] on M4, and \(S_{3,2,f} = 40 > C_{3,1,f} = 30\). Therefore, the [39, 54] is resource shortage time due to J3 waiting for J2 to release resource t3. Thus, the Lemma 4 is proofed.

Based on the Lemmas 1–4, the two-resource reallocation heuristic methods aim to reduce resource shortage time, i.e., reduce the makespan by rational resource allocation for scheduling. The detailed descriptions of the two rules are as follows.

Heuristic 1: Reducing resource allocation

First, determine the resource shortage time in a critical factory by Lemma 3, 4, defined as [RSSTt,k,i, RSETt,k,i]. Then, if there exist job j in stage k with start processing time \({S}_{j,k,f}\) and end processing time \({C}_{j,k,f}\) satisfying Formula (36), then reducing the resource allocation \({u}_{t,j,k,f}\) with two criteria (Criteria 1, 2).

$$ S_{j,k,f} \le RSST_{t,k,i} < RSET_{t,k,i} \le C_{j,k,f} $$
(36)

Criteria 1: The allocated amounts \({u}_{t,j,k,f}\) of resource t used by job j at stage k must meet the minimum limit, i.e.,\({u}_{t,j,k,f}>1.\)

Criteria 2: Reducing \({u}_{t,j,k,f}\) will result in increased \({Apt}_{j,k}\). In order not to affect the start processing time of the subsequent jobs, the reduced \({u}_{t,j,k,f}\) should satisfies Formula (37).

$$ \Delta Apt_{j,k} = a_{t,k} \times \Delta u_{t,j,k,f} \le MS_{i,p + 1,k,f} - MC_{i,p,k,f} $$
(37)

where the \(\Delta u_{t,j,k,f}\) is the reduced amount of resource t allocated to job j. It means the reallocated resource for processing job j at stage k will change the \(MC_{i,p,k,f}\) to \(MC_{i,p,k,f}^{new}\)\(\left( {MC_{i,p,k,f}^{new} > MC_{i,p,k,f}^{{}} } \right)\) and ensure that \(MC_{i,p,k,f}^{new} \le MS_{i,p + 1,k,f}\).

Heuristic 2: Increasing resource allocation

First, determine the resource shortage time in a critical factory by Lemma 3–4, defined as [RSSTt,k,i, RSETt,k,i]. Then, if there exist job j in stage k with start processing time \({S}_{j,k,f}\) and end processing time \({C}_{j,k,f}\) satisfying Formula (36), then increasing the resource allocation \({u}_{t,j,k,f}\) with two criteria (Criteria 3, 4).

Criteria 3: The allocated amounts \({u}_{t,j,k,f}\) of resource t used by job j at stage k cannot meet the maximum limit, i.e.,\({u}_{t,j,k,f}<{TR}_{t,k,f}.\)

Criteria 4: Increasing \({u}_{t,j,k,f}\) will result in reduced \({Apt}_{j,k}\). In order not to affect the scheduling time of jobs in subsequent stages, the, the increased \({u}_{t,j,k,f}\) should also satisfies Formula (38).

$$ \Delta Apt_{j,k} = a_{t,k} \times \Delta u_{t,j,k,f} \le ESET_{t,k,i} - ESST_{t,k,i} $$
(38)

where the \(\Delta u_{t,j,k,f}\) is the increased amount of resource t allocated to job j. It means the reallocated resource for processing job j at stage k will change the \(MC_{i,p,k,f}\) to \(MC_{i,p,k,f}^{new}\) (\(MC_{i,p,k,f}^{new} < MC_{i,p,k,f}^{{}}\)), and ensure that \(C_{j,k,f}^{new} = MC_{{}}^{{}} MC_{{i^{\prime } ,p,k,f}}^{new} \ge ESET_{t,k,i}\).

Figure 4 is an example to further illustrate the validity of the two heuristic methods, which has n = 6, S = 2, Mk = 2 and \({R}_{k}=2\). The content in the middle of the rectangle indicates the resource allocation, for example, ‘t2-3’ of J1 on M1 at stage 1 means using 3 amounts of resource type 2. The \({TR}_{t,k,f}\) is given in Table 4. It can be seen in Fig. 5(a), through the verification of Lemmas 3 and 4, there are two resource shortage times [19, 29] and [29, 39], respectively.

Table 4 Total amount of each resource type at each stage

By employing the Heuristic 1, resources can be rationally allocated to reduce the resource shortage time [29, 39]. The reduced amounts of resources allow other jobs that require the same resource to start processing as early as possible, which may reduce the makespan by analyzing from Lemma 1. If the reduced amounts of resources are not enough for another job to start processing earlier, it will not affect the current makespan. Figure 4(b) confirm the effectiveness of Heuristic 1. More specially, when the RSST3,2,4 = 30 and RSET3,2,4 = 40, there exist J2 on M3 satisfying the Formula (36) (\(S_{2,2,f} = 15 \le 30 < 40 \le 40 = C_{2,2,f}\)) and allocated the same resource type t3, which caused the J3 to wait resource on M4. The \({u}_{\mathrm{3,2},2,f}\)=3 > 1 and the idle time between J2 and J4 on M3 is \(MS_{3,2,2,f} - MC_{3,1,2,f} = 15\). Thus, if \({u}_{\mathrm{3,2},2,f}\) is reduced from 3 to 1, the \(\Delta Apt_{2,2} = a_{3,2} \times \Delta u_{3,2,2,f} = 10 < 15\), which means that changing \(MC_{3,1,2,f}\) from 40 to 50 will not affect the start processing time of subsequent job J4. By this way, the makespan is reduced by reduce the t3 shortage time.

By the Heuristic 2, resources are fully utilized in a short period of time to reduce the resource shortage time [19, 29]. The increasing resource allocation for J3 in stage 1 enables J4 to start processing earlier in stage 1. Thus, the resource shortage time between J1 and J4 on M1 is reduced, which may result in a reduced makespan. Figure 4(c) shows effectiveness of Heuristic 2. More specially, when the RSST1,1,1 = 20 and RSET1,1,1 = 30, there exist J3 on M2 satisfying the Formula (36) (\(S_{1,1,f} = 15 \le 20 < 30 \le 30 = C_{1,1,f}\)) and allocated the same resource type t1, which caused the J4 to wait resource on M1. The \({u}_{\mathrm{1,3},1,f}\)=4 < 5 and \(ESET_{1,1,2} - ESST_{1,1,2} = 10\). Thus, if \({u}_{\mathrm{1,3},1,f}\) is increased from 4 to 5, the \(\Delta Apt_{3,1} = a_{3,1} \times \Delta u_{3,2,2,f} = 10 \le 10\), which means that changing \(MC_{2,2,1,f}\) from 30 to 20 will not affect the start processing time J1 at stage 2. By this way, the makespan is reduced by reduce the t1 shortage time.

Framework of the proposed algorithm

The framework of the DGSK is shown in Fig. 5. DGSK consists of three main modules: (1) Initialization of high-quality populations using three heuristics and a random method in a hybrid approach; (2) In order to enable the global search to balance each dimension of the searching individuals, a DE-based search mechanism is used to improve the original GSK algorithm, while six operators are designed to allow the two parallel search phases to handle discrete scheduling problems; (3) In terms of speeding up the convergence of the algorithm, a dimension-aware local search method is embedded into the GSK algorithm used to perform a depth search on individual-specific dimensions.

Solution Reputation

The encoding for a solution consists of three parts: (1) the first part is factory assignment; (2) the second part is the scheduling at the first stage, and (3) the third part is the resource type and the units of allocated resources for each job at each stage. Figure 6 represents an example of a solution encoding.

Fig. 6
figure 6

Reputation for a solution with a Factory assignment, b Scheduling of jobs and c information

In Fig. 6(a) and (b), the length of the two vectors is equal to n. Each element in the factory assignment vector represents the f. As for elements in the scheduling vector, it means the scheduled job serial number. For example, the scheduling sequence in f2 is J3, J1, J4 at stage 1.

In Fig. 6(c) the resource usage vector represents the type and units of resources allocated to jobs at each stage. The length is \(n \times s\). The elements consist of real numbers, where the integer part represents the resource type, and the fractional part represents the units. For example, J1 uses 3 units of resources 1 when processing at stage 1.

Initialization of population

The Np individuals in Pop are generated by four methods, i.e., the NEH method considering the critical factory (NEH_C), the NEH considering the resource constraint (NEH_R), the method of balancing the job number of factories (BNF), and the random method.

  1. 1)

    For the factory assignment vector, BNF and the random method are used in a hybrid way. The main steps of BNF are shown in Algorithm 1.

Algorithm 1
figure a

Procedure of BNF

  1. 2)

    For the scheduling vector, NEH_C, NEH_R and the random method are used in a hybrid way. The main steps of NEH_C and NEH_R are shown in Algorithm 2 and Algorithm 3, respectively.

Algorithm 2
figure b

Procedure of NEH_C

  1. 3)

    For the resource usage vector, the random method is used. Note that if the number of resources allocated is too large, resulting in \(pt_{j,s} - a_{t,s} u^{s,t} < 0\), the number of resources needs to be adjusted to the max value, which can make \(pt_{j,s} - a_{t,s} u^{s,t} > 0\).

Dimension calculation phase

Formulas (39-40) are used to compute the dimensional range of the junior gaining-sharing knowledge phase and senior gaining-sharing knowledge phase in each iteration.

$$ D_{Junior} = D \times ((G_{\max } - g)/G_{\max } )^{K} $$
(39)
$$ D_{Senior} = D - D_{Junior} $$
(40)

where D = 3 is the dimension of solution. The DJunior represents the search dimensions in the junior phase and the DSenior represents the search dimensions in the senior phase. Figure 7 shows an illustration of search dimension with iteration.

Fig. 7
figure 7

Junior and senior searching dimension during iteration increasing

Discrete evolution-based junior and senior phase

Based on the discreteness of scheduling problem, the improvement of the junior and senior gaining-sharing knowledge searching phase is described as follows.

Algorithm 3
figure c

Procedure of NEH_R

The search mechanism for the factory assignment vector is described as Formula (41) in the junior phase and Formula (42) in the senior phase.

$$ x_{{i,d}}^{{new - F}} = \left\{ {\begin{array}{*{20}c} {x_{i} \oplus ^{2} K_{f} \otimes ^{1} (x_{{i - 1}} { \ominus }x_{{i + 1}} ) \oplus ^{2} K_{f} \otimes ^{1} (x_{r}{ \ominus }x_{i} ),f(x_{i} ) > f(x_{r} )} \\ {x_{i} \oplus ^{2} K_{f} \otimes ^{1} (x_{{i - 1}} { \ominus }x_{{i + 1}} ) \oplus ^{2} K_{f} \otimes ^{1} (x_{i} { \ominus }x_{r} ),f(x_{i} ) \le f(x_{r} )} \\ \end{array} } \right. $$
(41)
$$ x_{{i,d}}^{{new - F}} = \left\{ {\begin{array}{*{20}c} {x_{i} \oplus ^{2} K_{f} \otimes ^{1} (x_{{p - best}}{ \ominus }x_{{p - worst}} ) \oplus ^{2} K_{f} \otimes ^{1} (x_{m} { \ominus }x_{i} ),f(x_{i} ) > f(x_{m} )} \\ {x_{i} \oplus ^{2} K_{f} \otimes ^{1} (x_{{p - best}}{ \ominus }x_{{p - worst}} ) \oplus ^{2} K_{f} \otimes ^{1} (x_{i} { \ominus }x_{m} ),f(x_{i} ) \le f(x_{m} )} \\ \end{array} } \right. $$
(42)

The search mechanism for the scheduling vector is described as Formula (43) in the junior phase and Formula (44) in the senior phase.

$$x_{{i,d}}^{{new - S}} = \left\{ {\begin{array}{*{20}c} {x_{i} \oplus ^{1} K_{f} \otimes ^{1} (x_{{i - 1}} { \ominus }x_{{i + 1}} ) \oplus ^{1} K_{f} \otimes ^{1} (x_{r} { \ominus }x_{i} ),f(x_{i} ) > f(x_{r} )} \\ {x_{i} \oplus ^{1} K_{f} \otimes ^{1} (x_{{i - 1}}{ \ominus }x_{{i + 1}} ) \oplus ^{1} K_{f} \otimes ^{1} (x_{i} { \ominus }x_{r} ),f(x_{i} ) \le f(x_{r} )} \\ \end{array} } \right.$$
(43)
$$ x_{{i,d}}^{{new - S}} = \left\{ {\begin{array}{*{20}c} {x_{i} \oplus ^{1} K_{f} \otimes ^{1} (x_{{i - 1}} { \ominus }x_{{i + 1}} ) \oplus ^{1} K_{f} \otimes ^{1} (x_{r} { \ominus }x_{i} ),f(x_{i} ) > f(x_{r} )} \\ {x_{i} \oplus ^{1} K_{f} \otimes ^{1} (x_{{i - 1}}{ \ominus }x_{{i + 1}} ) \oplus ^{1} K_{f} \otimes ^{1} (x_{i} { \ominus }x_{r} ),f(x_{i} ) \le f(x_{r} )} \\ \end{array} } \right.$$
(44)

The search mechanism for the resource usage vector is described as Formula (45) in the junior phase and Formula (46) in the senior phase.

$$ x_{{i,d}}^{{new - R}} = \left\{ {\begin{array}{*{20}c} {K_{f} \otimes ^{2} (x_{{i - 1}}{ \ominus }x_{{i + 1}} ) \oplus ^{3} K_{f} \otimes ^{2} (x_{r} \Theta x_{i} ) \oplus ^{3} x_{i} ,} \\ {K_{f} \otimes ^{2} (x_{{i - 1}}{ \ominus }x_{{i + 1}} ) \oplus ^{3} K_{f} \otimes ^{2} (x_{i} \Theta x_{r} ) \oplus ^{3} x_{i} ,} \\ \end{array} } \right.\begin{array}{*{20}c} {f(x_{i} ) > f(x_{r} )} \\ {f(x_{i} ) \le f(x_{r} )} \\ \end{array} $$
(45)
$$ x_{{i,d}}^{{new - R}} = \left\{ {\begin{array}{*{20}c} {K_{f} \otimes ^{2} (x_{{p - best}} { \ominus }x_{{p - worst}} ) \oplus ^{3} K_{f} \otimes ^{2} (x_{m}{ \ominus }x_{i} ) \oplus ^{3} x_{i} ,} \\ {K_{f} \otimes ^{2} (x_{{p - best}} { \ominus }x_{{p - worst}} ) \oplus ^{3} K_{f} \otimes ^{2} (x_{i}{ \ominus }x_{m} ) \oplus ^{3} x_{i} ,} \\ \end{array} } \right.\begin{array}{*{20}c} {f(x_{i} ) > f(x_{m} )} \\ {f(x_{i} ) \le f(x_{m} )} \\ \end{array} $$
(46)

The operators of \(\Theta\) \(\otimes^{1}\) \(\otimes^{1}\) \(\oplus^{1}\) \(\oplus^{2}\) \(\oplus^{2}\) in the Formulas (4146) are defined as Formulas (4752).

$${ \ominus }:x_{1}{ \ominus }x_{2} = \left\{ {\begin{array}{*{20}c} {x_{1} (i),} & {if\;\begin{array}{*{20}c} {x_{1} (i) \ne x_{2} (i)} \\ \end{array} } \\ {0,} & {otherwise} \\ \end{array} } \right. $$
(47)
$$ \otimes^{1} :K_{f} \otimes^{1} x = \left\{ {\begin{array}{*{20}c} {x(i),} & {if\begin{array}{*{20}c} {rand(i) < K_{f} } \\ \end{array} } \\ {0,} & {otherwise} \\ \end{array} } \right. $$
(48)
$$ \otimes^{2} :K_{f} \otimes^{2} x = \left\{ {\begin{array}{*{20}c} {x(i),} & {otherwise} \\ {0,} & {if\begin{array}{*{20}c} {rand(i) < K_{f} } \\ \end{array} } \\ \end{array} } \right. $$
(49)
$$ \oplus^{1} :x_{1} \oplus^{1} x_{2} = \left\{ {\begin{array}{*{20}c} {swap\_I,} & {if\begin{array}{*{20}c} {r\;and < 0.5} \\ \end{array} } \\ {insert\_I,} & {otherwise} \\ \end{array} } \right. $$
(50)
$$ \oplus^{2} :x_{1} \oplus^{2} x_{2} = \left\{ {\begin{array}{*{20}c} {swap\_II,} & {if\begin{array}{*{20}c} {r\;and < 0.5} \\ \end{array} } \\ {insert\_II,} & {otherwise} \\ \end{array} } \right. $$
(51)
$$ \oplus^{3} :x_{1} \oplus^{3} x_{2} = \left\{ {\begin{array}{*{20}c} {x_{1} (i),} & {if\;\begin{array}{*{20}c} {x_{1} (i) \ne 0} \\ \end{array} } \\ {x_{2} (i),} & {otherwise} \\ \end{array} } \right. $$
(52)

In Formulas (50) and (51), swap_I and insert_I are for the scheduling vectors, and swap_II and insert_II are for the factory assignment vectors. The four operators are described in detail as follows.

  1. (1)

    swap_I: iterate through the nonzero elements x2(i) to find their corresponding position x1(j). Then, swap the two elements x1(i) and x1(j).

  2. (2)

    insert_I: iterate through the nonzero elements x2(i) to find their corresponding position x1(j). Then, insert the x1(j) into x1(i).

  3. (3)

    swap_II: iterate through the nonzero elements x2(i). Then, find all positions, at which the elements x1(j) are equal to x2(i). Randomly select one of x1(j) and swap the x1(j) and x1(i).

  4. (4)

    insert_II: iterate through the nonzero elements x2(i). Then, find all positions, at which the elements x1(j) are equal to x2(i). Randomly select one of x1(j) and insert the x1(i) into x1(j).

Algorithm 4 is the procedure of DE-senior search phase and Algorithm 5 is the procedure of DE-junior search phase.

Algorithm 4
figure d

Procedure of DE-Senior search

Algorithm 5
figure e

Procedure of DE-Junior search

Dimension-aware local exploitation

The DTSLS is performed on each individual, which is not optimized after opt (\(opt = 1/20 \times G_{\max }\)) iteration times. It adaptively selects an encoding dimension of an individual and performs a two-stage local search method on the selected dimension (TSLSdim = {FA-LS, SC-LS, RU-LS}, where dim = 1, 2, 3). Specifically, TSLS is designed for three coding dimensions, i.e., for the factory assignment (FA-LS = {SMOP1,k, ADOP1,k’}), scheduling (SC-LS = {SMOP2,k, ADOP2,k’}), and resource usage (RU-LS = {SMOP3,k, ADOP3,k’}). Five operators are designed for each dimension, and divided into simple operators (SMOPdim,k = {FOPk, SOPk, ROPk}, k = 1, 2, 3) and advanced operators (ADOPdim,k’ = {AFOPk’, ASOPk’, AROPk’}, k’ = 1, 2).

  1. (1)

    FOP1 (subsequence-based swap): Randomly select c consecutive elements as a sub-sequence. Then, swap the subsequence and a random external element.

  2. (2)

    FOP2 (subsequence-based insert): Randomly select c consecutive elements as a sub-sequence. Then, insert the subsequence after a random external element.

  3. (3)

    FOP3 (subsequence-based mutation): Randomly select c consecutive elements as a subsequence. Then change elements in the sub-sequence within the constraint range.

  4. (4)

    AFOP1 (swap between critical factories): Select the critical factory fc with the maximum completion time. Then, randomly select a job Jfc from the fc, and swap Jfc with a job JfR from other factories.

  5. (5)

    AFOP2 (insert between critical factories): Select the critical factory fc with the maximum completion time. Then randomly select a job Jfc from the fc and insert into a random position in another factory.

  6. (6)

    SOP1 (simple swap): Swap jobs at two random positions.

  7. (7)

    SOP2 (simple insert): Insert a randomly selected job into any position.

  8. (8)

    SOP3 (simple inverse): Randomly select c consecutive jobs and inverse them.

  9. (9)

    ASOP1 (swap within critical factory): Select the critical factory fc with the maximum completion time. Then, randomly select a job Jfc from the fc and swap Jfc with another job in the fc.

  10. (10)

    ASOP2 (insert within critical factory): Select the critical factory fc with the maximum completion time. Then, randomly select a job Jfc and insert Jfc into another position in the fc.

  11. (11)

    ROP1 (multistage swap): For each stage, select two elements and swap their positions.

  12. (12)

    ROP2 (multistage insert): For each stage, select an element and insert it into the other positions within constraints.

  13. (13)

    ROP3 (multistage mutation): For each stage, regenerate a random resource allocation within the constraint range.

  14. (14)

    AROP1 (decreasing resource operator): For each machine, if there are jobs that satisfy the reducing resource allocation heuristic method (Heuristic 1), reduce the units of allocated resources by one.

  15. (15)

    AROP2 (increasing resource operator): For each machine, if there are jobs that satisfy the increasing resource allocation heuristic method (Heuristic 2), increase the units of allocated resources used by one.

The search will go through two stages. SMOPdim,k embed in the variable neighborhood search method (VNS) to search LS1 times in the first stage, and ADOPdim,k’ (execute one of the operators based on dim with a probability of 50%) uses to search LS2 times for the second stage. Since there are three dimensions for in-deep search, the meta-Lamarckian learning method is employed to self-adaptively select a dimension dim for local search and execute the corresponding operators.

The meta-Lamarckian learning method contains three operations. First, the initialization operation is the start of the DTSLS. A reward value \(\mathop \delta \nolimits_{{_{dim} }}\) is given for the three-dimensional vectors and initialize \(\mathop \delta \nolimits_{{_{dim} }}\) = 1/3. Each dimension executes searching based on the probability Pdim calculated by Formula (53). The roulette-wheel method is used to decide the dim. The working operation is to perform a two-stage local search for the selected dimension. The update operation is used to update \(\mathop \delta \nolimits_{{_{dim} }}\) according to Formula (54).

$$ P_{dim} = \delta_{dim} /\sum\limits_{i = 1}^{3} {\delta_{i} } $$
(53)
$$ \delta_{dim} = \delta_{dim} + \max ((Fit_{old} - Fit_{new} )/Fit_{new} ,0) $$
(54)

where Fitold and Fitnew are the individual fitness before and after DTSLS, respectively. The Algorithms 6 is the procedure of DTSLS.

Computational complexity

The computational complexity of the main modules of the DGSK is analyzed as follows.

There are three main heuristic initialization methods used in the initialization module, i.e., BNF, NEH_C, and NEH_R. The computational complexity of BNF is O(n) according to the Algorithm 1, the computational complexity of NEH_C is O(n!) according to the Algorithm 2 and the computational complexity of NEH_R is O(n!) according to the Algorithm 3. To conveniently analyze the initialization module, we define the number of individuals initialized by each method as Np_BNF, NP_NEHC, and NP_NEHR, respectively. Thus, the computational complexity of the initialization module is O(n × Np_BNF + n! × (NP_NEHC + NP_NEHR)).

There are two main search methods in the global search module, i.e., DE-based junior search and DE-based senior search. The computational complexity of the former is O(NP × DJunior) according to the Algorithm 4, and the computational complexity of the latter is O(NP × DSenior) according to the Algorithm 5. Thus, the computational complexity of global search module is O(NP × (DJunior + DSenior)), i.e., O(NP × n × S) according to the encoding strategy.

There is one main method in the local search module, i.e., the DTSLS. Since the Algorithm 6 presents two local search stages, the first stage complexity is O(n × S × LS1) and the second stage complexity is O(n × S × LS2), so the overall complexity is O(Np_opt × n × S × (LS1 + LS2)), where Np_opt is the number of solutions which is not optimized after opt iteration times.

Algorithm 6
figure f

Procedure of DTSLS

Experimental results

Experimental preparation

Total 27 instances were designed to participate in the comparative experiments. We considered three scales of jobs (n = 20, 40, 60) for 9 machining environments combinations, including the scales of factories (F = 2, 3, 4), processing stages (S = 2, 3, 4), and resource types (R = 2, 3, 4). The Taguchi design of experiment (DOE) [56] is used and the orthogonal array L9(33) is selected to design the combinations. For example, the ‘20–2-2–2’ means 20 jobs-2factories-2stages -2resource types.

The relative percentage increase (RPI) value is employed as the performance indicator. The RPI value can be calculated as Formula (55).

$$ RPI = \frac{{Fit_{A} - Fit_{B} }}{{Fit_{B} }} \times 100 $$
(55)

where FitA is the fitness obtained by each comparison algorithm and FitB is the best fitness obtained by all comparison algorithms.

Parameter calibration experiment

To achieve a better performance, the Taguchi method is employed for determining three key parameters in the DGSK algorithm (K, Kf, and Kr). Each parameter is programmed with four levels, as shown in Table 5. The orthogonal array L16 (43) is selected to generate 16 parameters combinations, shown as Table 6. The stopping condition is set to 1000 iterations. Each combination calculates all 27 instances 10 times. The average fitness value (Ave_Fitness) is taken as a composite performance indicator for each combination, which is provided in the last column in Table 6.

Table 5 Parameters and their levels
Table 6 The orthogonal array L16 (43)

From the results of Table 6, the influence ranking of parameters can be arrived. In Table 7, Delta stands for the difference between the maximum mean Ave_Fitness and the minimum mean Ave_Fitness for each parameter. Thus, the parameter with lower rank has greater influence in the DGSK algorithm. i.e., the parameter Kr has the greatest impact on the solving efficiency of the DGSK algorithm, followed by Kf, and finally K. Figure 8 is the trend of each factor level. From the analysis in the Fig. 8, when the three parameters are set to K = 8, Kf = 0.3, and Kr = 0.5, the DGSK algorithm can have better performance.

Table 7 The average fitness and the rank of parameters
Fig. 8
figure 8

The trend of each factor level

Effectiveness of the initial methods

To verify the performance of the proposed initialization methods, two experiments are designed, i.e., (1) to compare the differences between the BNF, NEH_C, NEH_R, and random initialization methods (denoted as Rand), and (2) to compare the performance of the hybrid initialization method (HIM) with the initialization using one of the four methods alone.

The purpose of the first experiment is to verify the validity of three designed initialization methods i.e., BNF, NEH_C, NEH_R. Thus, four variants of DGSK were encoded for comparative experiments, i.e., when initializing, (1) BNF is used only for the factory dimension and other dimensions are randomly initialized (denoted as BNF), (2) NEH_C is used only for the scheduling dimension and other dimensions are randomly initialized (denoted as NEH_C), (3) NEH_R is used only for the scheduling dimension and other dimensions are randomly initialized (denoted as NEH_R), and (4) all dimensions are initialized by random method (denoted as Rand). Note that all individuals are initialized using the proposed method and the parameters remain the same for the rest of the algorithm. Each algorithm is run 10 times for each instance and the average of the fitness values of 10 independent runs is considered as the result of the algorithm for each instance. The best results and the RPI values of the four comparison algorithms are shown in Table 8, which the first column is the scale of 27 instances, the second column is the best average fitness value obtained by the two algorithms, and the RPI values are listed in the next four columns.

Table 8 The comparison of four initialization methods

It can be concluded from Table 8 that (1) the DGSK with NEH_R method obtains 11 better results in 27 instances, followed by DGSK with BNF method getting 9 better results, and finally, DGSK with NEH_C obtaining 7 better results; (2) from the last row of Table 8, it can be seen that initialization using NEH_R has the best population quality, which can provide more convergence information for subsequent searches, and improves the performance by about 42% compared to Rand. The next best method is the BNF, which improves the performance by about 35% compared to Rand. The last is the NEH_C, which improves the performance by about 25% compared to Rand.

Furthermore, the ANOVA result of the four compared methods is shown in Fig. 9(a). It can be concluded that (1) all the three designed initialization methods provide high-quality solutions for the initial population, which lays the foundation for the fast convergence of the proposed algorithm to the optimal solution. (2) The p-value result is 1.487128e-02, which is less than 0.05, indicating the results obtained by the three designed methods are significantly different (significantly better) than Rand.

Fig. 9
figure 9

ANOVA results for initialization experiments

The purpose of the second experiment is to verify the validity of hybrid initial method (HIM) with other four methods. While initializing the population using only one method improves the quality of the population, too many dense high-quality connections will cause the algorithm to converge to a local optimum considering the discrete nature of the population. To avoid the algorithm from falling into a local optimum early, the HIM method balances the discrete nature and quality of the population. Specifically, when initializing each dimension of an individual, different methods are chosen based on probability. In DGSK, the probabilities are distributed according to the methods involved in the dimension. There are five variants of DGSK, i.e., the DGSK with HIM (HIM), the DGSK with random method (Rand), the DGSK only with NEH_C, the DGSK only with NEH_R, and the DGSK only with BNF. The details of the rest of the experiment are consistent with the first initialization experiment. The best results and the RPI values of the four comparison algorithms are shown in Table 9.

Table 9 The comparison of HIM method with other four methods

It can be concluded from Table 9 that (1) the DGSK with HIM obtained 11 better results and was the most. Analyzing the average RPI value, the HIM method obtained the smallest result of 0.23. (2) HIM improves performance by about 83%, 58%, 41% and 27% compared to Rand, NEH_C, NEH_R and BNF, respectively.

Figure 9b is the ANOVA of HIM compared with other method. In Fig. 8 the HIM evidently has a lower RPI value than the other four algorithms (p value less than 5%), i.e., the HIM initialization method can improve the quality and discreteness of the population and provide more valuable information for the junior and senior searching phases.

Effectiveness of the DTSLS

To prove the validity of the DTSLS, three variants are performed: (1) the original GSK algorithms only with DE-based senior and junior search (GSK-I); (2) add the ML-AMLS method [57] to GSK-I for local search (ML-AMLS); and (3) the GSK-I plus the DTSLS strategy for local search (DTSLS). Employ the following settings for all variants: (1) the same initialization method; (2) the same stopping conditions and the same parameters; (3) the average fitness value of each algorithm after running each instance ten times is used to calculate RPI values, shown in Table 10.

Table 10 The comparison of local search methods

The conclusions can be drawn from Table 10: (1) the DTSLS obtains 24 better results in 27 instances; (2) the DTSLS obtains better average results, which are 3.02 and 2.74 less than GSK-I and ML-AMLS respectively; Therefore, (1) the DTSLS in the DGSK algorithm is effective with multidimensions solution encoding; and (2) the DTSLS can effectively search the solutions in complex environments and adaptively search the most promising dimensions.

Figure 10 is the box plot for ANOVA of the RPI values obtained by three variants with 12 different scales of machining environments (i.e., n, F, S, and Rk). It can be seen from Fig. 10 that (1) all the p-values in the Fig. 10(a–l) is less than 5%, which indicates that the DTSLS is significantly different from the other two methods; (2) from the perspective of a complex processing environment (different scales of n, F, S, R), GSK algorithm with DTSLS achieves a lower RPI value than the other two variants, which indicates that DTSLS can effectively search for multidimensional solution problems.

Fig. 10
figure 10

ANOVA for comparison methods grouped by different scales

Comparison of DGSK with other algorithms

To prove the effectiveness of the DGSK algorithm, five algorithms are selected for comparison, i.e., the genetic algorithm (GA) [17], the simulated annealing (SA) [18] the self-adaptive artificial bee colony algorithm (SABC) [19], the hybrid algorithm (HA) [20], and the parameter-less iterated greedy (IGMR) [21]. The GA and SA are widely for solving HFSP, the SABC and HA are regarded as effective algorithms to solve HFSP with resource constraints and resource-dependent processing times, respectively, and the IGMR performs better in solving HFSP. Each of the five comparison algorithms is run independently for 27 instances 30 times. The average fitness value is calculated as the result of each instance. Because the five comparison algorithms are not used to solve the DHFSP-RPDT and no existing algorithms for addressing the proposed the problem. To ensure the fairness of the experiment, all algorithms set the same parameters: (1) the stopping criterion is 1000 iteration times; (2) the encoding and decoding methods are carried out as in mentioned; and (3) the HIM method is employed for the population initialization. Note that, for SA and IGMR, the best individual in the initial population is selected as the initial solution for the next steps. The remaining steps and methods of the comparison algorithm are implemented based on the methods mentioned in the respective papers and improved for solving the DHFSP-RDPT.

The experimental results obtained by the six algorithms are displayed in Table 11, where the first column indicates the scale of the instances, and the second column is the fitness value obtained by the proposed DGSK algorithm. The following five columns describe the gap value for the IG MR, HA, SA, SABC, and GA, respectively. The gap value can be calculated as Formula (56), where the FitC is the result obtained by the comparison algorithm and the FitDGSK is the result obtained by the DGSK algorithm.

$$ Gap_{C} = \frac{{Fit_{C} - Fit_{DGSK} }}{{Fit_{DGSK} }} \times 100 $$
(56)
Table 11 The gap results of six comparison algorithms

From the Table 11, it can be concluded that: (1) compared with the IGMR, HA, SA, SABC, and GA, the DGSK algorithm improves performance by 21.22%, 9.63%, 14.33%, 14.30% and 1.82%, respectively; and (2) DGSK algorithm achieved the best average fitness results for 81.48% of the instances. For the remaining 18.52%, the SABC achieved the optimal result in 3.7%, and the GA achieved the optimal result in 14.82%. In summary, the proposed DGSK algorithm is superior in solving the DHFSP-RDPT than its competitors.

In addition, Fig. 11 is the radar chart for RPI values classified by different scales. As observed in Fig. 11, the proposed DGSK algorithms achieve better results than other comparison algorithms with different scales of jobs (n = 20, 40, 60), factories (F = 2, 3, 4), processing stages (S = 2, 3, 4) and types of resources (R = 2, 3, 4), respectively. To demonstrate significant differences between RPI values, the 0.05 significance level of a Wilcoxon signed rank test is performed to validate the RPI values. Table 12 provides the relevant p-values between the DGSK algorithm and other comparative algorithms on instances classified by different n, F, S and R. All p-values belong to \([0, 0.05]\), which means that the comparison algorithms are significantly different. From a statistical point of view, the DGSK algorithm is advantageous in solving DHFSP-RDPT problems with different scales of jobs, factories, stages, and resource types.

Fig. 11
figure 11

Radar chart for RPI values

Table 12 The p-values for different scales classification

Furthermore, Fig. 12 presents the convergence curves of the comparison algorithms for instance ‘20–2-2–2’ and ‘40–2-4–4’. From Fig. 12, (1) the proposed DGSK algorithm converges better than the SABC IGMR and SA algorithms up to 200 iterations, and after approximately 400 iterations the convergence results are better than the those of HA and GA algorithms; (2) the results of the DGSK algorithm stabilize after approximately 600 iterations. The Fig. 13 is Gantt chart for an optimal solution obtained by the proposed DGSK algorithm for instance ‘40–2-2–2’, where there are two machines in each stage. In Fig. 12, each operation is represented by a rectangle with different colors, and the text in the middle of the rectangle indicates the ‘Job number—resource allocation’. For example, ‘J1-R1.04’ in stage 1 indicates J1 processing with resource type 1 and allocated unit is 4. It is intuitive from Fig. 12 and Fig. 13 that the DGSK algorithm outperforms its rivals.

Fig. 12
figure 12

Comparisons of the convergence abilities

Fig. 13
figure 13

Gantt chart for the best solution for instance ‘40–2-2–2’

Summary of experiments

The high efficiency of DGSK is mainly attributed to (1) the hybrid initialization method of the three heuristic methods to improve the quality of the initial population; (2) the designed DE-based global search operators are more adapted to adaptive learning among multiple dimensions; (3) the meta-Lamarckian learning based local search method can effectively perform for the designed multi-dimensional encoding and (4) the embedded resource allocation heuristic can reasonably reallocate resources for the solution.

However, the DGSK algorithm also has some limitations from analyzing the comparative experiment results. from the Table 11, we can conclude that the overall gap between between the GA and the DGSK is small and GA has four instances of superior results. Further, analyzing the trend of Gap values for different instance scales shown in Fig. 14 can conclude the limitation that (1) DGSK has a clear advantage in solving small-scale DHFSP-RDPT. However, it is not stable enough in solving medium-scale instances, as evidenced by the fact that the results are greatly affected by the complexity of the processing environment. When solving large-scale instances, the gap with other algorithms tends to decrease. (2) The difference between DGSK and the other four algorithms is not significant when addressing the simple processing environment instances, as can be verified in instance ‘20–2-2–2’ and ‘40–2-2–2’. Moreover, from the Fig. 12, we can conclude the limitation that (1) the convergence is slower at the early stages of the algorithm, compared to HA and GA, and (2) the algorithm converges to the optimal solution over a long period of time and tends to the optimal solution at a uniform rate as it evolves.

Fig. 14
figure 14

Trend graph of gap values for different instance scales

These limitations mentioned above may be attributed to (1) limitations of the operators in the junior search phase led to an insufficient search of the solution space in the early stages of the algorithm, (2) dimensionality judgments for senior search are incremental with the number of iterations, and (3) starting conditions for local search.

Conclusion

Both distributed model and resource constraints can be considered in HFSPs. Since in real production, the actual processing time of jobs is controlled by the type and number of allocated resources, such DHFSPs are formulated as DHFSP-RDPT. To solve such complex scheduling problems in polynomial time, i.e., finding the optimal solution to minimize makespan, this paper proposes a DGSK algorithm which combines the meta-Lamarckian learning technique and two heuristics on resource allocation. The proposed algorithm is simulated under 27 different production environment instances and the results are compared with five well-known algorithms used to solve similar problems. In all tests, the proposed algorithm finds the optimal solution more efficiently than the other five algorithms.

In future work, we will study other variants of DHFSP, such as distributed heterogeneous HFSPs, and considering transportation time and setup time. Meanwhile, resource constrained scheduling problems arising in real production will be investigated, such as the resource constraint problem in prefabricated systems, machine maintenance, and the consumption of fuel (non-renewable resource) in steel production. In addition, how to improve the DGSK algorithm to deal with multi-objective optimization problems to ensure the diversity and convergence of the obtained non-dominated solution sets while considering the algorithm's running time and solving efficiency is also worthy of deeper investigation. Furthermore, the speed of convergence for DGSK and the efficiency of solving large-scale instances are also important issues that need to be addressed. Therefore, designing other efficient heuristics embedded into the algorithm, as well as comparing with other variants of GSK algorithms and resource allocation heuristic rules are also interesting future research.