1 Introduction

Today, production scheduling in a multi-factory production environment is expressed as a distributed scheduling problem. By developing a culture of cooperation in the production of different products in several factories, distributed scheduling is very useful for better use of resources, increased productivity and profit, reduction of production costs, reduction of risks, and increased product quality. It can be said that a multi-factory production environment has become more important. In recent years, production in a distributed environment in a multi-factory production network has been one of the most attractive issues (Lohmer and Lasch 2021). Also, due to the globalization process in the field of production, the job shop production system is one of the most important and practical topics that has been studied in the distributed scheduling problem. Therefore, due to the practicality of this environment, in this research, a job shop production system is assumed. Applications of the distributed job shop scheduling problem include auto parts manufacturing, home appliances, etc. Sharing distributed resources in different geographical locations results in production networks. Two types of distribution networks have been introduced for multi-factory environments: (i) All factories belong to a single organization. They collaborate with each other to maximize the organization's profits. In this type of collaboration, despite the goal of maximizing profits, some factories may be unprofitable. (ii) A number of factories with independent ownerships make up a multi-factory production network which is called a virtual production network. Each factory in this type of network focuses on its own interests. In this research, it is assumed that the distribution network in the multi-factory environment is of the second type. In this type, the factories can achieve more benefits than the separate mode. In this problem, each factory is considered as an agent. In multi-agent scheduling, each agent has a set of jobs and wants to independently optimize its own objective function. Applications of this scheduling include the rail transport industry, aerial industry, and project-based organizations (Agnetis et al. 2014).

With the rapid development of globalization and information technology, quick response to the diverse needs of customers has become an important issue for modern manufacturing companies (Goli et al. 2019, 2021). In the real world, factories face various unpredictable disruptions in the production line, such as machine breakdowns, the arrival of new jobs, changes in delivery times, changes in the number of available employees, etc. In this paper, it is assumed that the arrival of new jobs and the unavailability of machines constraints at some time may occur in the production process. These events can disrupt the production system. Therefore, in order to prevent these changes, it is usually necessary to reschedule after the initial scheduling. Obviously, considering non-availability constraints reduces the sustainability of scheduling. The availability of machine constraints in manufacturing systems is classified into two categories, fixed and non-fixed. In fixed availability, the non-availability period starts and ends at fixed points in time. But in the non-fixed availability, the start time of the period is non-fixed. Furthermore, there are three policies in the face of periods of non-availability of machines due to breakdowns and repair: resumable, semi-resumption and no resumption (Lee 1999). Resumable means that job processing continues without wasting time after the end of the non-availability of machines period (Wang and Yu 2010). In semi-resumption after the end of the inaccessibility period, a percentage of the processing that was done before the inaccessibility period should be done in part (Lee 1999). In the resumption strategy, after the machine is available, the job is processed from the beginning (Allaoui and Artiba 2006). In this paper, it is assumed that the availability constraint is of non-fixed type and the policy is resumable.

According to the above, the main purpose of the research is to define, model and solve the distributed multi-agent network scheduling problem considering the real events such as machine breakdowns and the arrival of new jobs in the job shop production environment. The main research questions are (i) How to model and solve complex scheduling problems in distributed multi-agent systems? (ii) Considering the real events such as machine breakdowns and the arrival of new jobs, what changes and effects will they have on the job shop scheduling? (iii) Is the proposed approach, an efficient approach? Due to the novelty of the problem and, as a result, not being present in the literature, a mixed-integer mathematical model was developed for the problem. Also, due to the complex nature of the problem, a non-dominated sorting memetic algorithm has been proposed to solve it. According to the above explanations, research innovations are (i) considering the multi-agent approach with the virtual alliance in the distributed job shop scheduling problem, (ii) Considering the constraints of machine availability and arrival of new jobs, (iii) Development of a mathematical model, and (iv) Proposing a memetic algorithm based on a non-dominated sorting genetic algorithm-II (NSGA-II) and local search.

The rest of this paper is organized as follows. Section 2 presents a literature review of the problem. Section 3 introduces distributed multi-agent network scheduling problem and proposes mathematical modeling. Section 4 proposes the memetic algorithm (MA) and its structure. Section 5 presents the computational experiments. Finally, Sect. 6 provides the conclusion of the work and future research.

2 Literature review

In recent years, the multi-factory production system has attracted the attention of many researchers and manufacturers. This production system enables factories to respond faster to rapid environmental changes and maintain and increase their competitiveness in the global markets. In this system, factories must work in harmony, to be able to ensure a secure flow of goods, services, and information. In many of these studies in this field, the production environment is considered non-distributed. Williams was as first study in 1981, considered the multi-factory scheduling problem (Williams 1981). In this research, joint scheduling in production and distribution problem in complex networks with the objective of minimizing production and distribution costs in each time period has been investigated. Single machine, parallel, job shop and flow shop production environments have been previously studied. Considering that the job shop production environment is one of the most important and practical production environments, in this research, this production environment has been considered and studied. Jia et al. (2002) studied the distributed scheduling problem for the first time. In their paper, a web-based system for production scheduling was proposed to facilitate cooperation between factories distributed in different geographical areas. They proposed a genetic algorithm (GA) to solve the problem. It includes one crossover gene and two mutation genes. In another research, Jia et al. (2003) suggested a modified genetic algorithm. The proposed algorithm has a two-step encoding method. To evaluate the performance of GA, they used the samples suggested by Muth et al. (1963). Chan et al. (2005) examined the problem raised by Jia et al. (2003). To solve this problem, they proposed a GA with dominated genes. To solve this problem, in another paper, Jia et al. (2007) proposed a GA and Gantt chart. The computational results showed that the proposed algorithm is efficient.

Moon and Seo (2005) proposed a mathematical model and an evolutionary algorithm (EA) to solve this problem. In their paper, flexible sequences, precedence constraints, and alternative machines are considered. Liu et al. (2006) hierarchically decomposed the multi-factory planning and scheduling problem into several levels of problems, including planning, scheduling, and material tracking feedback. To solve this problem in the dynamic environment, they proposed an approach based on a genetic algorithm, multi-agent method, user cooperation, and multi-closed loop control. Moon et al. (2008) used topological sorting to create a set of operations sequences, and developed the evolutionary search approach to find possible solutions to the multi-factory scheduling problem in the job shop production environment. Wang et al. (2006) studied the problem of the dynamic distributed scheduling problem in the job shop production environment with the objective of minimizing production costs and delivery times. Chan and Chung (2007) proposed a GA with dominant genes for minimizing the makespan of the distributed job shop scheduling. Zhang et al. (2008) developed a multi-factory model for the distributed job shop scheduling problem. They proposed a distributed scheduling mechanism that combines the GA with a dynamic scheduling strategy. To solve the integrated scheduling and distribution problem in supply networks with different machines, Ławrynowicz (2008) proposed a metaheuristic algorithm. His/her hybrid approach is built upon the GA. In this problem, the author considered the constraints of priority and outsourcing and the sequences of different operations. Jeong and Yim (2009) investigated the problem of distributed scheduling in the job shop production environment with the objective of minimizing the makespan. Their study assumes that a production subsystem is responsible for maintaining its own private information and must work with others to achieve a global goal by sharing a minimum of private information. The authors proposed a Lagrangian relaxation method to solve the problem. Naderi and Azab (2014) proposed two mixed-integer programming models based on sequence and position variables for the distributed job shop production scheduling problem. To solve problems in medium- and large-size instances, they proposed three heuristic algorithms and three greedy heuristic algorithms. Also, Naderi and Azab (2015), in another paper, proposed a mixed-integer programming model with the objective of minimizing the makespan. They state that their proposed model is better than other proposed models in terms of size and complexity. To solve the problem, they developed a simulated annealing (SA) algorithm. Chaouch et al. (2017) proposed three algorithms named modified ant colony optimization for this problem. They showed that the modified ant colony optimization (MACO) algorithm has better performance than the other two algorithms. Xie et al. (2019) proposed a multi-objective artificial bee colony (MOABC) to solve the distributed job shop scheduling problem (DJSSP) with makespan and the total energy consumption criteria. Jiang et al. (2020) presented an effective modified multi-objective evolutionary algorithm with decomposition (MMOEA/D) to solve the energy-efficient distributed job shop scheduling problem (EEDJSP). In the proposed algorithm, they designed encoding and decoding schemes, several initialization rules, a collaborative search, and three problem-specific local intensification heuristics. Şahman (2021) proposed a discrete spotted hyena optimizer (DSHO) algorithm for this problem. In this research, the author compared the results of the proposed algorithm with four other heuristic algorithms. Wang et al. (2021) proposed an improved genetic algorithm (IGA) to solve this problem with the objective of minimizing the makespan. Fei et al. (2022) presented a mathematical model and simulation model for the joint distributed job-shop production and preventive maintenance scheduling. To solve the problem, they proposed the sequence exchange-based genetic algorithm. A summary of the reviewed papers is shown in Table 1.

Table 1 Distributed scheduling with job shop environment

According to Bagheri Rad and Behnamian (2022) and as shown in Table 1, all studies in the multi-factory job shop production system assume that all factories are owned by a central organization. Due to the globalization process in the field of production, factories can work together with independent ownership by creating a virtual production network. In this case, the factories can achieve more benefits than when they operate outside a network. In this problem, each factory may have a different objective function. Due to the mentioned reasons, in this study, it is assumed that the factories have independent ownership and are considered as single agents. Also, no research has been conducted considering a multi-agent approach with the arrival of jobs and the breakdown of machines in this problem. Most of the papers have focused on heuristic and metaheuristic algorithms, and a few have used hybrid algorithms. For this purpose, in this research, a hybrid algorithm based on the MA has been designed. In summary, the contributions of the current study compared to the reviewed research in the two areas of problem definition and solution approach are as follows:

  • Problem definition: (i) Considering the transportation of jobs between factories, (ii) Considering the dynamic factors, including machine availability and the arrival of new jobs, (iii) Considering the virtual alliance between factories, (iv) Considering the multi-agent approach, (v) Considering resumable non-fixed policy for the machine breakdown, and, (vi) for the first time, studying a real and complex scheduling problem with assumptions close to the real world.

  • Solution approach: (i) Developing a new mathematical model with several new constraints according to the assumptions under study, (ii) Designing a hybrid algorithm: Most of the papers in the literature review have focused on heuristic and metaheuristic algorithms and a few have used hybrid algorithms. So in this paper, a hybrid algorithm based on a non-dominated sorting genetic algorithm-II (NSGA-II) and local search has been proposed. This hybrid approach increases the speed of convergence, (iii) Introducing five well-defined problem-based neighborhood structures to increase the variety of solutions and a more comprehensive search within the solution space, (iv) Proposing a new solution representation method, and (v) Embedding local search in the proposed algorithm.

3 Problem description and mathematical formulation

In this problem, there are F factories (f = 1,…, F) with different production speeds. Each of them has a job shop production system. Each factory is considered as an agent and seeks to minimize one of the objectives of total energy consumption or makespan. The symbols G1 and G2 are used to indicate the objectives of minimizing the makespan and total energy consumption of all factories. G1 indicates factories that seek to minimize makespan. G2 indicates factories that seek to minimize total energy consumption. Processing time of job j is Psj,i and speed of machine i in factory f is vif. When job j is processed in factory f, the time Psj,i/Vi,f is needed to complete that job. If a job is not processed in its own factory, it needs trfq transfer time. In this state, job j will be processed in factory q instead of processing in factory f with time 2trfq +)Psj,i/Vi,f(. Also, N (j = 1, 2 … N) independent and non-priority jobs at zero time are ready to be processed and must be distributed among F factories. Each job contains a number of operations that must be processed on M machines (i = 1, 2… M) predefined in pi,j,k units of time. During the processing of jobs in the initial program, N' (j' = 1, 2… N') new jobs may be entered. In this case, based on the manager's decision, the program is rescheduled at time Ts considering the not scheduled jobs of the original program and the new jobs. Also, machine i in factory f has maintenance and repair operation time Prr,i,f which its completion time should be in the defined time window. Compared to classic job shop scheduling, in our problem, not only jobs should be scheduled in each factory, but also the assignment of the appropriate factory to the jobs and the schedule of maintenance and repair operation should be considered simultaneously.

The assumptions of this problem are as follows:

  • At a time, each machine can process only one job and each job can be processed on only one machine.

  • The processing time of jobs is deterministic.

  • After starting the processing of the job on a machine, it must proceed on it without interruption, except when the machine breaks down.

  • Each factory has a job shop production system.

  • Loading and unloading times of the jobs are embedded in the transportation time.

  • There are enough vehicles between factories to transport jobs.

  • Setup time is considered at processing time.

  • A resumable policy has been selected for periods of non-availability of machines due to breakdowns.

  • Interruption of maintenance operations is not allowed.

3.1 Mathematical model

According to these assumptions, the index, parameters and decision variables are as follows.

3.1.1 Index

N: Number of jobs

m: Number of machines

F: Number of factories

f: Factory index (f=1,2,..,F)

i,l: Machine index (i, l=1,2,…,m)

jo: Initial jobs index (jo=1,...,n)

jn: New jobs index (jn= n+1,...,N)

j,k: Sum of old and new jobs index (j, k=1,2,…,n+1,…,N)

r: Maintenance and repair operation index (r=1,2,…,Ri,f)

3.1.2 Parameters

Ri,f: Total number of maintenance and repair activities on machine i in factory f

Psj,i: Processing time of job j on machine i

vi,f: Speed of machine i in factory f

trf,q: Transfer time of job from factory f to factory q

L: A large number

aj,i,l: 1, if machine i is used immediately after machine l in the process of processing job j; 0, otherwise

wj,f: 1, if job jth is ordered to factory f; ; 0, otherwise

ETr,i,f: The earliest time of completion of the maintenance and repair operation rth on machine i in factory f

LTr,i,f: The latest time of completion of the maintenance and repair operation rth on machine i in factory f

Prr,i,f: Processing time of maintenance and repair operation rth on machine i in factory f

[ETr,i,f, LTr,i,f]: The time window to complete the maintenance and repair operation rth on machine i in factory f

Epj,i,f: Energy consumed of processing job j in factory f on machine i

Eidlei,f: The idle energy consumed of machine ith in factory f

E0: The common energy used by the general equipment of the factory

Ts: Rescheduling horizon

3.1.3 Variables

Xk,j,i: Binary variable; 1, if job j immediately is processed after job k on the machine i; 0, otherwise

Cj,i: Completion time of job j on the machine i

yj,f: Binary variable; 1, if the job j is processed at f factory; 0, otherwise

pj,i,f,q: Processing time of job j on machine i in factory q, if it was originally planned to be processed at factory f

ptj,i: Processing time of job j on machine i considering the speed of machines and the movement of jobs between factories

Crr,i,f: Completion time the maintenance and repair operation rth on machine i in factory f

yrr,j,i,f: Binary variable; 1, if job j is processed immediately after the maintenance and repair operation rth on machine i in factory f; 0, otherwise

Urr,j,i,f: Binary variable; 1, if the maintenance and repair operation rth is located between the processing time of job j on machine i is in factory f; 0, otherwise

Ecw: Amount of energy consumption of processing job j in factory f on machine i

Ecidle: The amount of idle energy consumption of machine i in factory f

Cmax, C'max: Makespan

TEC: Total energy consumption (Kw)

The proposed model is as follows.

$${ }Z_{1} = Min \, TEC$$
(1)
$${ }Z_{2} = Min \, C_{\max }$$
(2)
$$\begin{gathered} s.t.: \hfill \\ \mathop \sum \limits_{f = 1}^{F} y_{j,f} = 1\quad \forall j \hfill \\ \end{gathered}$$
(3)
$$p_{j,i,f,q} = w_{j,f} ((Ps_{j,i} /v_{i,f} ) + 2tr_{fq} )\quad \forall i,j,f,q$$
(4)
$$pt_{j,i} \ge p_{j,i,f,q} y_{j,q} - L(1 - y_{j,q} )\quad \forall i,j,f,q$$
(5)
$$C_{j,i} \ge pt_{j,i} + \mathop \sum \limits_{r} Pr_{r,i,f} Ur_{r,j,i,f} \quad \forall i,j,f$$
(6)
$$C_{j,i} \ge C_{j,l} + pt_{j,i} + \mathop \sum \limits_{r} Pr_{r,i,f} Ur_{r,j,i,f} \quad \forall j,f,i,l \ne i|a_{j,i,l = 1}$$
(7)
$$C_{j,i} \ge C_{k,i} + pt_{j,i} - L\left( {3 - X_{k,j,i} - y_{j,f} - y_{k,f} } \right) + \mathop \sum \limits_{r} Pr_{r,i,f} Ur_{r,j,i,f} \quad \forall j,i,f,k < N,j > k$$
(8)
$$C_{k,i} \ge C_{j,i} + pt_{k,i} - L\left( {2 + X_{k,j,i} - y_{j,f} - y_{k,f} } \right) + \mathop \sum \limits_{r} Pr_{r,i,f} Ur_{r,j,i,f} \quad \forall j,i,f,k < N,j > k$$
(9)
$$C_{j,i} y_{j,f} \le Cr_{r,i,f} - Pr_{r,i,f} + yr_{r,j,i,f} L + Ur_{r,j,i,f} L\quad \forall i,j,f,r$$
(10)
$$Cr_{r,i,f} \le C_{j,i} y_{j,f} - pt_{j,i} + (1 - yr_{r,j,i,f} )L\quad \forall i,j,f,r$$
(11)
$$Et_{r,i,f} \le Cr_{r,i,f} \le Lt_{r,i,f} \quad \forall r,i,j$$
(12)
$$C_{\max } \ge C_{j,i} y_{j,f} \quad \forall i,j,f \in R_{1}$$
(13)
$$C_{\max }^{^{\prime}} \ge C_{j,i} y_{j,f} \quad \forall i,j,f \in R_{2}$$
(14)
$$Ec_{w} = \mathop \sum \limits_{j = 1}^{n} \mathop \sum \limits_{i = 1}^{m} \mathop \sum \limits_{f = 1}^{F} E_{j,i,f}^{p} pt_{j,i} y_{j,f} /60\quad f \in R_{2}$$
(15)
$$Ec_{idle} = \mathop \sum \limits_{i = 1}^{m} \mathop \sum \limits_{f = 1}^{F} E_{i,f}^{idle} \left( {C_{\max }^{^{\prime}f} - \mathop \sum \nolimits_{j = 1}^{n} pt_{j,i} y_{j,f} } \right)/60\quad f \in R_{2}$$
(16)
$$TEC = Ec_{w} + Ec_{idle} + (E_{0} C_{\max }^{^{\prime}} )/60\quad f \in R_{2}$$
(17)
$$C_{j,i} - pt_{j,i} - \mathop \sum \limits_{r} Pr_{r,i,f} Ur_{r,j,i,f} \ge Ts\quad i,f,j \ge n + 1$$
(18)
$$C_{j,i} ,pt_{j,i} ,p_{j,i,f,q} ,C_{\max } ,C^{\prime}_{\max } ,Ec_{w} ,Ec_{idle} ,Cr_{r,i,f} \ge 0\quad \forall i,j,f,r,q$$
(19)
$$Ur_{r,j,i,f} ,yr_{r,j,i,f} \in \{ 0,1\} \quad \forall i,j,f,r$$
(20)
$$X_{k,j,l} \in \{ 0,1\} \quad \forall j < N,k > j,i$$
(21)
$$y_{j,f} \in \left\{ {0,1} \right\}\quad \forall j,f$$
(22)

In the above model, Objective function (1) minimizes the total energy consumption and Objective function (2) minimizes the makespan. Constraint (3) determines each job must be assigned to a factory. Constraints (4) and (5) calculate the amount of processing time of each task considering the transfer times between factories when it is assigned to specific factories. Constraint (6) represents the time to complete a job is longer than the processing time and the maintenance and repair operation time. Constraint (7) indicates that each job should be processed just by one machine at a time. Constraints (8) and (9) represent one machine can process one job at a time. In other words, the two last constraints indicate that if the two jobs j and k are to be processed on machine i, job j on machine i can start processing when its previous job (k) on this machine is finished. Constraints (10) and (11) state that the processing jobs and maintenance and repair operations do not overlap. Constraint (12) ensures that maintenance and repair operations must be completed within a specified time window. Constraint (13) calculates the makespan of jobs belonging to the first agent. Constraint (14) calculates the makespan of jobs belonging to the second agent. Constraint (15) calculates the amount of machine energy consumption in the processing time of jobs. Constraint (16) calculates the amount of energy consumed in idle time. Constraint (17) represents the total energy consumption. Constraint (18) indicates the start time of new jobs must be after the rescheduling horizon. Model variables are defined by constraints (1922).

3.2 Model solving

Since nonlinear models are more difficult to solve than linear ones, and our proposed model is nonlinear, a method for its linearization has been used. In this regard, suppose the variable V = p.y is the multiplication of a binary variable (y) in a continuous variable (p). In this case, when the binary variable takes a value of one, the variable V will be equal to the value of the continuous variable; otherwise, it will take a value of zero. Therefore, Constraints (23), (24) and (25) are used to linearize these constraints (Glover and Woolsey 1974).

$$V_{j,i,f,q } \le p_{j,i,f,q}$$
(23)
$$V_{j,i,f,q} \le L y_{j,q}$$
(24)
$${ }V_{j,i,f,q } \ge p_{j,i,f,q} - L(1 - y_{j,q} )$$
(25)

The augmented epsilon constraint (AEC) method is one of the methods for solving multi-objective problems. This method reports a number of Pareto solutions resulting from the balance of objective functions (Mavrotas and Florios 2013). This approach is used in this research. The steps of this approach are shown in Fig. 1.

Fig. 1
figure 1

Flow chart of augmented epsilon constraint method (Fei et al. 2022)

4 Solving approach

In a multi-factory job shop scheduling problem, if assumed that there is a single factory, the problem will become a classic scheduling problem (Behnamian and Fatemi Ghomi 2015). Since the classic job shop problem is Np-hard (Garey et al. 1976), the studied problem, which includes F factories, is at least as difficult as the single-factory problem, and therefore it is also Np-hard. On the other hand, in the distributed scheduling problem, in addition to the classical scheduling decisions, decisions must be made regarding the allocation of jobs to appropriate factories and this increases the complexity of the problem (Chung et al. 2009). Due to the complexities of this problem, it is impossible to solve it, especially in large-size instances, in a reasonable time. Therefore, here, to find good solutions in a reasonable time, metaheuristic algorithms are proposed. For this purpose, in this paper, a memetic-based non-dominated sorting genetic algorithm-II is proposed. Since the considered problem has two objectives, the proposed algorithm is designed based on the NSGA-II structure and is improved with several local searches.

4.1 Proposed memetic algorithm

The MA is a combination of one of the population-based algorithms and a local improvement method. In this research, due to the multi-objective nature of the problem, the NSGA-II structure has been used in the design of the proposed algorithm. The NSGA-II was proposed in 2002. In this algorithm, the initial population is first generated, then all members of the population are ranked based on the domination rules. Then the crowding distance of the members with the same rank is calculated. In the next step, based on the binary tournament, parents are selected. In the binary tournament, the member with the highest rank is given priority. If two members have the same rank, the member with the greater crowding distance is given priority. In the next step, the mutation and crossover operators are used to generate the offspring. As shown in Fig. 2, the steps of the proposed MA are similar to the NSGA-II, except that at the end of each generation, a local search is performed on a number of populations to find better solutions. The steps of the local search method are shown in Fig. 3.

Fig. 2
figure 2

Flowchart of the proposed algorithm

Fig. 3
figure 3

Pseudo-code of local search method

4.2 Implementation details

4.2.1 Solution representation

In this paper, matrix-based coding is used for solution representation. In this matrix, the jobs, machines and factories are in the first, second and third rows, respectively. The length of each row is equal to the total number of operations. The structure of the solution representation maintains the feasibility of each solution. Figure 4 shows an example with three jobs and two factories in which each job consists of three operations that must be processed on three machines.

Fig. 4
figure 4

Solution representation

4.2.2 Initial population

In the proposed algorithm, the initial population is generated randomly.

4.2.3 Crossover operator

In the proposed method, a single-point crossover operator is used.

4.2.4 Mutation operator

In this method, a pair swapping operator is used. In this method, two cells from the randomly selected row are selected and their locations are replaced with each other.

4.2.5 Local search

In the algorithm, five neighborhood structures were proposed as follows:

4.2.6 Neighborhood structure 1

In this structure, first, two columns are randomly selected, then the positions of the two operations (columns) are swapped together.

4.2.7 Neighborhood structure 2

In this structure, first, a random number r between 2 to n (vector length) is generated and then the priority of the two operations r and r-1 are swapped.

4.2.8 Neighborhood structure 3

In this neighborhood structure, first, two jobs are randomly selected. Then, the location of the operation of the two jobs (not just an operation of the job) is changed one by one (peer to peer), according to the operation number. An example of this neighborhood structure is shown in Fig. 5. In this instance, jobs 1 and 3 are randomly selected and then their operation locations are moved together.

Fig. 5
figure 5

Neighborhood structure 3

4.2.9 Neighborhood structure 4

In neighborhood structure 4, first, a factory with more workload is selected. Then, one of the remaining factories is randomly assigned to this job.

4.2.10 Neighborhood structure 5

In this neighborhood structure, first, two jobs (not just an operation of the job) from two different factories are selected. Then their factories are swapped. An example of the neighborhood structure is shown in Fig. 6. In this instance, jobs 1 and 2 are randomly selected and then their factories are swapped together.

Fig. 6
figure 6

Neighborhood structure 5

4.3 Complexity of proposed memetic algorithm

The Time complexity of non-dominated sorting genetic algorithm-II (NSGA-II) for each generation is equal to the order O(mN2) (Jafari and Rezvani 2021). In this order, m is the number of objectives and N is population size. In this problem, there are two objectives (m = 2). Since our proposed algorithm is based on NSGA-II, its O()is the same as NSGA-II.

5 Computational results

In this section, sample problems are defined to evaluate the performance of the proposed mathematical model and algorithm. The proposed mathematical model and algorithm are coded in GAMS 24.1.2/CPLEX SOLVER and MATLAB (R2011a), respectively. In small-size instances, validation of the proposed mathematical model has been done using GAMS software and the memetic-based non-dominated sorting genetic algorithm-II (MA). In order to validate the MA in large-size instances, a proposed algorithm entitled Hybrid Pareto-based Tabu Search Algorithm (HPTSA) by Li et al. (2018) is chosen. Furthermore, to evaluate and validate the proposed mathematical model and algorithm, all instances are generated randomly.

5.1 Performance evaluation metrics

To evaluate the efficiency of the solutions to multi-objective problems, various metrics have been proposed (Barma et al. 2022). In this research, three metrics of the mean ideal distance, diversification and runtime are used to evaluate the quality of results.

Mean ideal distance metric (MID): This metric calculates the closeness of Pareto solutions to the ideal point (Fattahi and Behnamian 2022). This metric calculates by Eq. (26), ci in which the Euclidean distance of each member of the Pareto solutions from the ideal point (coordinate origin in the minimization), and n is the number of solutions in the Pareto layer. Obviously, the smaller values of this metric are more desirable.

$${\text{MID}} = \mathop \sum \nolimits_{i = 1}^{n} c_{i} /n = \mathop \sum \nolimits_{i = 1}^{n} (f_{1i}^{2} + f_{2i}^{2} + f_{3i}^{2} + \ldots )/n$$
(26)

Diversification metric (DM): This metric shows the diversification of the Pareto solutions. This metric is calculated using Eq. (27). The higher value of this metric is better.

$${\text{DM}} = \sqrt {(\max f_{1i} - \min f_{1i} )^{2} + (\max f_{2i} - \min f_{2i} )^{2} }$$
(27)

In this equation, f1i and f2i are the values of the first and second objective functions for solution i.

5.2 Parameter tuning

In this research, the Taguchi method is used for parameter tuning of the proposed algorithm. Taguchi method is simpler than other methods of design of experiments and also has less runtime. Effective factors in the performance of MA and their levels are shown in Table 2.

Table 2 Parameters affecting the performance of the MA

Note that the “local search rate” indicates what percentage of the population members enter the local search algorithm at the end of each iteration of the algorithm. According to the orthogonal arrays of the Taguchi method, the L9 design has been selected as an experimental design for parameter setting for the proposed algorithm. Also, to achieve more reliable results, each combination is run ten times by the MA in Minitab16 software and their average is reported as the final output. The considered response variable is a composite index (Rahmati et al. 2013). The S/N ratio is calculated as Eq. (29).

$$MOCV = MID/DM$$
(28)
$$\frac{S}{N}{\text{Ratio}} = - 10\log \left( {\frac{{{\text{sum}}(y^{2} )}}{n}} \right)$$
(29)

The results of the Taguchi method for each level of factors are presented in Table 3.

Table 3 Results of design of experiment of MA

5.3 Numerical results

In the small size, twenty instances were solved by the proposed algorithm and the ε-constraint approach. In order to increase the validity, each instance was run ten times by the proposed algorithm and HPTSA and the average results are reported in Table 4

Table 4 Computational results the small-size instances

Considering the values of performance criteria (MID, DM and Time), it is observed that the values obtained from the MA are close to the values of the ε-constraint approach. Also, with increasing the sizes of the instance, the runtime of the proposed algorithm is less than the ε-constraint approach. Due to the long runtime of the ε-constraint approach in GAMS software, the final instances in Table 4 were solved only by the MA. To illustrate the Pareto layer created by different methods in small-size instances, two instances (i.e., instances 7 and 6) are considered. The obtained Pareto layers are shown in Fig. 7. As shown in the diagrams, the results of the MA and ε-constraint are very close to each other.

Fig.7
figure 7

Comparing the Pareto layer of algorithms by the ε-constraint approach

Due to the complex nature of the problem, large-size instances were solved by the proposed algorithm and the HPTSA. The obtained results are shown in Table 5.

Table 5 Computational results in large-size instances

Relative Percentage Deviation (RPD) values of large-size instances are calculated by Eq. (30).

$$RPD = 100({\text{Algorithm}}_{solution} - {\text{Minimum}}_{{{\text{solution}}}} )/{\text{Minimum}}_{{{\text{solution}}}}$$
(30)

A diagram of average RPDs is plotted considering the MID and DM in Fig. 8a and b, respectively. As shown in Fig. 8a, the RPD values of the MID of the MA are lower than the other algorithm, so the MA performs better. Also, as shown in Fig. 8b, the RPD values of the DM of the MA are less than the other algorithm. Since the higher DM, the better, and because the HPTSA has a higher DM, it has performed better.

Fig. 8
figure 8

a Diagram of average RPD of the MID for the MA and HPTSA algorithms in large-size instances). b Diagram of average RPD of the DM for the MA and HPTSA algorithms in large-size instances

To observe the effect of increasing the number of machines and factories on the performance of algorithms criteria, additional analyzes were performed and the results are shown in Fig. 9 a–e. As shown in Fig. 9a and c, with the increase in the number of machines and factories, the MA performs better than the HPTSA in terms of MID. Considering the DM, the solutions of HPTSA have a better dispersion than the MA. Also, it can be concluded from Fig. 9a that with an increase in the number of machines, the performance of both algorithms deteriorates in terms of the MID. With the increase in the number of factories, the performance of both algorithms improves in terms of the MID (see Fig. 9c). It can be concluded from Fig. 9b that with the increase in the number of machines, the performance of both algorithms improves in terms of the DM. Furthermore, as shown in Fig. 9d, with the increase in the number of factories, the efficiency of the MA decreases, and the efficiency of the HPTSA improves. Another important factor for comparing metaheuristic algorithms is their runtime. According to Fig. 9e, the runtimes of the algorithms increase with increasing dimensions of the instance. As shown in this figure, the runtimes of both algorithms are approximately close to each other.

Fig. 9
figure 9

Comparison of performance of algorithms in the large-size instances

Also, in this research, for comparing the capabilities of metaheuristic algorithms in large-size instances in finding good solutions in a reasonable time, they are statistically examined. In this regard, first, one of the basic analysis assumptions of variance (Normality of data) was examined. Shipro-Wilk test has been used to check the normality of the data (MID, DM, and run times). The test results of the normality of the algorithms according to the DM, MID, and run times are shown in Tables 6, 7, 8, respectively. The output of this test shows that the P-value of the MID, DM, and run times values of at least one of the two algorithms is less than 0.05. It can be concluded that the MID, DM, and run times values of the algorithms do not have a normal distribution. Therefore, the non-parametric Kruskal–Wallis (KW) test is used for statistical analysis. In this test, the Null-hypothesis is the equality of the average criterion of the proposed algorithm with the average criterion of the HPTSA. The results of the DM, MID and run times are shown in Tables 9, 10, 11, respectively.

Table 6 Shapiro–Wilk test results for the DM values of algorithms
Table 7 Shapiro–Wilk test results for the MID values of algorithms
Table 8 Shapiro–Wilk test results for run times of algorithms
Table 9 KW test results for the DM values of algorithms
Table 10 KW test results for the MID values of algorithms
Table 11 KW test results for the run times of algorithms

As shown in the tables, the P-value of the two criteria of MID and DM of algorithms is less than 0.05, so the null hypothesis is rejected. Therefore, we conclude that there is a significant difference between the proposed MA and the HPTSA. According to the statistical test results and diagrams drawn in Fig. 9a–d, it can be concluded that the proposed algorithm performs better than the HPTSA considering the MID. Also, considering the DM, the HPTSA performs better than the proposed algorithm. Also, a statistical test has been used to compare the runtimes of the proposed algorithm with the HPTSA in large-size instances. As shown in Table 11, since the p value of the runtimes of the algorithms is more than 0.05, we conclude that there is no significant difference between the runtimes of the MA and the HPTSA.

The results of this study can be applied to the car manufacturing industry. More than 30,000 parts are needed to make a car. All the parts cannot be made in a single parts manufacturing factory. Thus in practice, multiple parts manufacturing companies distributed in different locations constitute a virtual production network.

6 Conclusion and future research

In this paper, a distributed multi-agent job shop scheduling problem in the dynamic environment with the constraints of availability of machines and new job arrivals is studied. In this problem, independently owned factories are distributed in different geographical locations and each one is interested in minimizing one of the objective functions of total energy consumption or makespan. To solve the problem, first, a bi-objective mathematical model was developed. Then, due to the high complexity of the problem, a memetic-based non-dominated sorting genetic algorithm-II was proposed for solving large-size instances and improved by several local searches. To validate the proposed model and algorithm, the results of the proposed algorithm were compared to the ε-constraint approach. Also, to examine the performance of the MA on large-size instances, the results obtained from the proposed algorithm were compared to the HPTSA. For small-size instances, the results showed that the solutions obtained from the proposed algorithm are very close to the solutions of the ε-constraint approach. The difference between the proposed algorithm and the ε-constraint approach in small-size instances is that with increasing the size of the problem, the runtime of the proposed algorithm is less than the ε-constraint approach. Furthermore, large-size instances were statistically analyzed. The P-value of the criteria of MID and DM of algorithms was less than 0.05. Therefore, the proposed algorithm performs better than the HPTSA considering the MID. Also, the HPTSA performs better than the proposed algorithm, considering the DM. Therefore, in general, the large-size validation results showed that the proposed algorithm has a better performance than the HPTSA. There were three major limitations to this study. First, new performance metrics such as green scheduling and TBL could be studied. Note that the triple bottom line aims to measure the financial, social, and environmental performance of a company over time. The second is the lack of study of uncertainty in the problem. Failure to address solution methods based on the exact method is also a limitation of the current study. On the other hand, major limitations of the model include its resumable policy for periods of non-availability of machines, job shop production system, and embedment of loading/unloading times of jobs in the transportation time. Given the introduced limitations and shortcomings of current research, suggestions can be made for future research: (i) considering other objective functions, (ii) adding probability and uncertainty to the problem parameters, (iii) presenting exact algorithms, (iv) presenting other effective meta-heuristic algorithms, and (v) and our final suggestion is to add realistic assumptions such as considering loading/unloading times of jobs in the transportation time or changing the production workshop.