Minimizing makespan in a three-stage hybrid flow shop with dedicated machines

Article history: Received September 1


Introduction
The hybrid flow shop (HFS) scheduling problem consists of optimizing the processing of a set of n jobs in m stages of machines.At least, one stage has to contain more than one machine.The HFS problem is frequently encountered in practice, essentially in the industry process where many machines are available in each stage, as well as in the flexible manufacturing environment (Gupta et al., 1971(Gupta et al., , 1997;;Gupta & Stafford Jr, 2006).The HFS scheduling problems are NP-hard, with very few exceptions (Riane et al., 1998).Hence, it has been widely studied in the literature.In this paper, we tackle a special type of HFS scheduling problem that may arise in a large class of real manufacturing environments: the hybrid flow shop with dedicated machines.In various industrial applications, dedicated machines produce different variants of the same basic product (different product types).First, all the products require the same operations of the production process.Then, they are processed on dedicated machines specific to each product type.We take, for example, the pharmaceutical industry, where a drug may be in forms of tablets or powder sachets, (or even syrup and ampoules).These two variants of such a drug have to initially go through the same fabrication stages.Then, they must be processed in two different production lines of dedicated machines.The first one is dedicated to sachets, whereas the second line is dedicated to tablets.Similar examples can be found in label sticker manufacturing (Lin & Liao, 2003), pottery production, furniture assembly (Cheng et al., 2009), mass customization (Cheng et al., 2009) and global manufacturing firms (Yang, 2011).Many real applications may exist.In general, the production process is composed of many stages of dedicated and non-dedicated machines.
In this work, we study a HFS scheduling problem with two dedicated machines: Two product types are thus processed.Scheduling in such an environment with two or more stages tends to be NP-hard in the strong sense (Lin, 1999).The traditional regular flow shop is a particular case of the HFS problem with dedicated machines, where only one product type is treated.Moreover, with the presence of more than one dedicated machine in a same stage, this problem can be seen as a hybrid flow shop, in which the assignment problem of jobs to machines does not arise.Scheduling problem with dedicated machines can also refer to as a particular case of an assembly flow shop, since a job of type 1 can be processed on the dedicated machine of type 2 or vice versa, with a processing time equal to zero.Therefore, due to the special configuration of our problem, we examine, in addition to the HFS with dedicated machines, the existing studies accomplished on assembly and on flow shop problems, The two-machine flow shop problem is probably the first one to be successfully resolved, since Johnson (1954) proposed his well-known exact algorithm.After Johnson's paper, several researchers have dealt with the m-machine flow shop problem, with 3, which is known to be NP-hard (Garey & David, 1976).The review of literature reveals that for a flow shop with no more than three machines, we can consider only the permutation schedules (Conway et al., 1967).Unfortunately, for more than three machines, we cannot guarantee the optimality of permutation sequences.However, Conway et al. (1967) stated that for minimizing the makespan in m-machine flow shop, we can consider only permutation schedules for which the same job order is prescribed on the first two machines and the same job order is prescribed on the last two machines.To tackle such an NP-hard, several researchers have suggested heuristic approaches.Many of these heuristics are based on the Johnson's algorithm (Campbell et al., 1970;Chen et al., 1996).Campbell et al. (1970) proposed a heuristic (CDS) which consists essentially of splitting m-stage problem into 1 fictitious two-machine flow shop problems and solved them by Johnson's algorithm.In each case, we end up with a schedule and the best one is selected.The CDS heuristic's complexity is .Another approach is to give an index to every job and then schedule the sequence by sorting the jobs according to their assigned index.This idea was first used by Palmer (1965).He developed a simple heuristic in which for every job a "slope index" is defined.Then, the jobs having the greatest slope are sequenced first and so on, which leads to a computational complexity of .Nawaz et al. (1983) designed a heuristic method (NEH) to the m-machine flow shop problem.It gives priority to jobs with high total processing time.The heuristic builds the schedule in a constructive way.At each step, the job with high priority is added to the partial solution in a way that induces the best partial makespan.The NEH algorithm, of complexity , is one of the most popular algorithms in flow shop studies due to its high performance for the makespan minimization (Taillard, 1990;Framinan, 2004).For more details on the m-machine flow shop problem, a literature review may be found in (Ruiz & Maroto, 2005;Gupta & Stafford, 2006;Yenisey & Yagmahan, 2014).
The hybrid flow shop (HFS) problem consists of assigning jobs to parallel machines in each stage and sequencing the jobs assigned to the same machine.Although there is a vast literature on HFS, the most studied problem is the two-stage configuration, whereas very few studies have focused on the k stages.The two-stage HFS problem is NP -hard, even if there is only one machine in the first stage and two machines in the second stage (Gupta, 1988).An extensive review of the literature on hybrid flow shops can be found in (Riane et al., 1997;Linn & Zhan, 1999;Ruiz & Rodriguez, 2010).
The first study in assembly flow shop scheduling problem was performed by Lee et al. (1993).They considered the three-machine assembly flow shop denoted as 3MAF (3-Machine Assembly Flow shop) with the objective of minimizing the makespan.In their problem, each product is assembled from two types of parts.A first machine processes the first type, whereas the second type is processed on a second machine.Finally, the two parts are assembled into a product on the third machine.This problem has been proved to be NP -hard (Lee et al., 1993;Potts et al., 1995).Later, Haouari and Daouas (1999) defined the inverse of 3MAF as a two-stage scheduling problem with one machine in the first stage and two machines in the second one.This problem is referred to as the 3-machine dismantling problem (3MDF).The authors showed that 3MAF and 3MDF are equivalent problems: an optimal schedule for 3MAF can be reversed to obtain an optimal schedule for 3MDF, with the same makespan.Only few studies have considered the case of more than two stages, for more details, the reader is invited to consult the existing papers (e.g.Koulamas & Kyparisis, 2001;Yokoyama & Santos, 2005;Fattahi et al., 2014).For the HFS problem with dedicated machines, most literature is focused on the two-stage configurations.Some studies have proposed exact methods (Riane et al., 2002;Mosheiov & Sarig, 2010;Hadda et al., 2014).Mosheiov and Sarig (2010) proposed an integer programming model and a polynomial dynamic programming algorithm for the two-stage HFS with m dedicated machines and a common job's due date.A branch and bound method has also been proposed to minimize the makespan for the case of m dedicated machines in the second stage (Hadda et al., 2014).Riane et al. (2002) studied the HFS with two dedicated machines and developed a dynamic program.Other studies have proposed heuristic approaches (Oguz et al., 1997;Dridi et al., 2009;Wang & Liu, 2013).Oguz et al. (1997) proposed an efficient heuristic, based on the Johnson's algorithm, to minimize the makespan in a twostage flow shop with two dedicated machines in the first stage.Yang (2015) studied the same configuration with the objective of minimizing the total completion time.The author established the complexity of the problem and presented an optimal solution for the case where the processing times on the single machine of stage 2 are identical.For the case of m dedicated machines in the first stage, a set of dominance rules are provided and several polynomial cases are identified (e.g.Yang, 2013;Hadda et al., 2015).Riane et al. (2002) considered the problem with two dedicated machines in the second stage, where the objective is to minimize the makespan.They proved its strong NP-hardness and proposed several polynomial heuristics.Several researchers have also studied the case where the processing sequences of the two types of jobs are given and fixed: a polynomial-time dynamic programming algorithm (Huang & Lin, 2013) and a linear-time algorithm (Lin, 2015) was developed to minimize the makespan and the maximum lateness, respectively.Dealing with the makespan minimization for the case of m dedicated machines in the second stage, several heuristics were proposed (Dridi et al., 2009;Wang & Liu, 2013).For the same problem, Hadda et al. (2012) presented a new dominance rule.The efficiency of the rule is shown through an analysis of the dominating set cardinality.As well, Yang (2011) studied the same configuration with the objective of minimizing the total completion time and provided optimal solutions for many cases of the problem.
For the case of more than two stages, Riane et al. (1998) studied the minimization of makespan in a three-stage HFS with two dedicated machines in the second stage.They developed two heuristic approaches.The first one is a dynamic programming based heuristic, whereas the second heuristic is based on a branch and bound algorithm.As for the assembly flow shop, most of the researches on HFS with dedicated machines focus on two-stage problems.To the best of our knowledge, there is only one study that considered three stages (Riane et al., 1988), in which the dedicated machines are in the second stage.In our opinion, the lack of studies considering three stages represents a step that can be taken in order to obtain a more thorough view on the problem.Furthermore, we note that many approaches, minimizing makespan in flow shops, are used to construct new solution methods for general scheduling problems, such as HFS, assembly flow shop and HFS with dedicated machines.NEH and Johnson algorithms, for example, are widely used in elaborated approaches for solving different configurations.
In this paper, we consider a three-stage HFS with two dedicated machines.We focus on the case where there exists only one machine in each of the first and second stages and two machines in the third stage (Fig. 1).The two machines in stage 3 are dedicated (which means that the machine on which the job is processed is known in advance).Thus, the set of jobs is partitioned into two job families according to the dedicated machines.All jobs have to be processed on and consecutively, and then on the dedicated machine , 1,2.The objective is to minimize the maximum completion time, .makespan ( ).

Fig. 1. Schematic of the production process
Following the notation of | | offered by Graham et al. (1979), we denote the three-stage HFS scheduling problem with two dedicated machines as 3 |1, 1, 2 | .For notational convenience, let our problem be referred to as Problem P. To the best of our knowledge, there is currently no report on heuristic methods for this special kind of problem.In this context, we introduce some basic results including solutions for several variations of the problem.We also adapt a set of lower bounds from the literature and we propose a heuristic method based on the dynamic programming procedure to solve the problem P.
The rest of the paper is organized as follows.Section 2 introduces the notations and assumptions.In Sections 3 and 4, we develop some preliminary results and several lower bounds for the problem, respectively.In Section 5, we establish the complexity of the problem in the case where one of the machines requires a job-independent processing time: all processing times of jobs are identical on one of the machines.A description of the heuristic method is given in Section 6, while Section 7 reports the results of computational experiments to evaluate its performance.Finally, we provide a summary at the end of this paper.

Notations and assumptions
Throughout the paper, we will use the following notations: : The single machine in each of the first and second stage, 1,2.: The dedicated machine of type in the third stage,  We note that all machines and jobs are available at time zero.Also, no preemption is allowed.A job cannot be processed by more than one machine at the same time and each machine processes, at most, one job at a time.The aim is to find a feasible schedule that minimizes the makespan.Note that for a given sequence π, the makespan is , .

Preliminary results
In this section, we identify some of the optimal schedule's properties.The property below states that we can limit ourselves to the permutation schedules.
Property 1: For P, there exists an optimal permutation schedule.Proof: A permutation schedule is dominant on the first two machines and (Conway et al., 1967).Suppose that there exists an optimal schedule in which the processing order on , 1 or 2, differs from the order on .Then, there exists two consecutive jobs and on such that is sequenced just before on . By inserting the job before on , we can check that the solution ′ obtained from is no worse than ( .′ ).
As a result of Property 1, we restrict our search for an optimal solution to permutation schedules.Also, a schedule can be fully described by the job order.We note that this result is no longer valid when there are more than three stages.
The spirit of Property 2 is based on a generalization of the idea used by Haouari and Daouas (1993) about the equivalence between the problem studied and its inverse.We define the inverse of P as a three-stage scheduling problem with two dedicated machines in the first stage and one machine in each of the second and third stages.The job is processed first on the dedicated machine corresponding to its type.Then, it will be processed, consecutively, on the single machines in stages 2 and 3.
Property 2: An optimal schedule for P can be reversed to obtain an optimal schedule for its inverse, with the same makespan.
Proof: If is an optimal schedule for P, then we can perform a mirror transformation of this schedule with respect to vertical line , (fig.2).So, we obtain a feasible schedule , , … for the inverse problem of P with the same makespan.Thus, P and its inverse are equivalent problems.This result is still valid for the case of more than three stages.The first lower bound is based on the observation that all jobs must be first processed in stage 1 and it is not possible to complete the last processed job in less than ∈ , .

∈ , ∈
. 1 For the second lower bound , no job can be started on in the second stage sooner than ∈ and it is not possible to complete the last processed job in less than ∈ , The third lower bound is derived from the flow shops "backwards".The jobs in subset , 1,2 will be processed at a time at least equal to ∑ ∈ on , 1,2, and it is not possible for these jobs to start on in the third stage sooner than ∈ .Therefore, the lower bound may be described as follows: is based on the observation that one of the dedicated machines , 1or 2 cannot start its process until the second job has been completed on .In other words, it is not possible to begin processing jobs on sooner than the minimum completion date of the second job on , which can be given as: , where ∈ and ∈ .Thus, may be described as follows: The desired lower bound is given by: , , , .5 We note here that the relative performance of such lower bounds depends on the workload of the different machines.If the workload of (respectively ) is larger than that of the other machines then, (respectively ) tends to perform best.For the case where one of the two dedicated machines is a bottleneck, it is more likely that is the third lower bound, .Finally, if the dedicated machines are the most-loaded, then may correspond to .

Particular cases
In some cases, a machine may require a processing time that does not depend on the job, but rather on the nature of the operation to be performed, such as perforation, cutting operation or oven residence time.In such cases, the problem becomes much easier to study.Then, the question is: Is the problem still, in this case, NP-hard or can we find an optimal schedule?In the following, we seek to answer this question in the cases where the machine requires a job-independent processing time: , 1,2.Before discussing these cases, let us first introduce the following notations: Let || be the three-machine flow shop problem and be the processing time of job on machine , 1,2,3 .If or then P is identical to problem || .We further denote P' as the two-stage hybrid flow shop scheduling problem, which may be identified as 2 |1, 2 | (Fig. 3).There is one machine in the first stage and two dedicated machines in the second stage.

Fig.3. Schematic of the production process of P'
Consider a given permutation schedule , let be the completion time of job on in for P' and its completion time on , 1,2.When there exists no confusion, we replace and , respectively, with and for P; and we replace ′ and ′ respectively with ′ and ′ for P'.
In Lemmas 1 and 2, we show that under certain conditions, the three-stage problem P is equivalent to P'.
Lemma 1: For the particular case satisfying condition: ∀ ∈ and ∈ 1 P and P' are equivalent problems (withP' being composed by in the first stage).Proof: According to the hypothesis, processes all jobs without idle time since the date .Hence, for a given permutation  we have: ′ , with ′ being the value of the makespan for P'.Therefore, an optimal schedule for the two-stage HFS with dedicated machines is also optimal for the problem P (and vice versa).For the first job processed on , we have:

Corollary
Let be a permutation schedule of n jobs processed on .We have to prove, by induction, that 7 remains valid for all jobs ∈ .Suppose Eq. 7 holds for all jobs from to .Now, we have to check that it also holds for the 1 job, .Let be the 1 job and is the job of the same type that , such that ′ is sequenced just before on .
By induction of the hypothesis, we have: , ′ , .
As a consequence: . 8 Hence, an optimal schedule for the two-stage HFS with dedicated machines is also optimal for the problem P (and vice versa).
The following theorems establish three polynomial cases for the problem P.
Theorem 1: For P, if and then there exists a polynomial time optimal solution.Proof: Let us suppose that and ∀ ∈ We have two cases:  (1) If then, due to lemma 1, P is equivalent to P' such that is in the first stage, and ( 1,2) are in the second stage. (2) If then, due to lemma 2, P is equivalent to P' such that is in the first stage, and ( 1,2) are in the second stage.
In both cases, all processing times on the single machine in the first stage of P' are identical.Due to the equivalence between P' and its inverse (Haouari & Daouas, 1999), P' can be solved in polynomial time (Yang, 2013).Therefore, an optimal permutation schedule can be obtained for problem P with constant processing times on the first and second stages.
Next, we consider that only the processing times of jobs on are identical .∀ ∈ .
For problem || , even though the processing times of all jobs on the second machine are identical , it is still NP-hard (Kise, 1991).Nevertheless, we show, in the following, that there exists a polynomial case for some values of .Proof: In this case, the activity of the machine depends only on the processing time of the first job on .Let , , … , be the permutation obtained by the decreasing order of .The value of is, then, given by: ; . 9 The only way of finding a better solution is the existence of a job such that .Let ∈ / and let be the permutation obtained, from , by inserting the job before .The optimal solution is the one minimizing among the permutations and , ∈ .In Fig. 4, we illustrate the case where , .Proof: In this case, the equivalent problem P' (with the machines , and ) becomes polynomial (Yang, 2013).If is an optimal schedule for P', then the makespan given by for P is: ′ , with ′ being the value of the makespan for P'.The only way to decrease the makespan is to insert another job in the first place.The rest of the proof is identical to that of Lemma 3. Theorem 3: For P, if the second machine dominates the other machines such that: ∈ and ∈ 10 Then, P can be solved in polynomial time.
Proof: In such a case, for any permutation , we have:

Heuristic approach
In this section, we provide a heuristic method to find approximate solutions for the problem P.This heuristic consists of three steps.The first one solves two separate flow shop problems according to the job either type or .The second step combines the two resulting subsequences, to produce a single ordered sequence of n jobs for the original problem.Finally, the third step improves the quality of the achieved solutions, using a 2-opt Exchange operator.In the following, we present in detail the three steps of this proposed heuristic.

First step: Solving two flow shop problems
It consists to consider the actual flow of jobs as two separate ones.The first flow involves the jobs of the subset and corresponds to the routing --.While, the second flow involves the jobs of the subset and corresponds to the routing --.The jobs of each flow can be scheduled using several algorithms which are proposed in the literature for flow shop problems.The main idea, in this paper, is to exploit the existing heuristics which proved their efficiency for the flow shop, in order to solve the HFS with dedicated machines.In this work, we use the NEH algorithm (Nawaz et al., 1983) to process jobs in the two subsequences denoted as and .This algorithm, running in , has been commonly regarded as one of the best constructive methods for solving flow shop problems.It consists of two steps.First, the jobs are ordered in non-increasing order of their sum of processing times.Second, an iterative insertion of jobs into a partial sequence according to the job order of step 1, is used.The solution quality obtained by the NEH algorithm depends on the initial jobs order of step 1.Thus, we further propose to construct another initial order in our version of NEH, which is more appropriate to the problem we study.This order gives priority to the jobs that are expected to be at the end of the schedule.Thus, we define an index to every job .It is calculated as follows:

∀ ∈ . 15
To distinguish from the classical NEH algorithm, MNEH is used to denote the modified NEH algorithm.
In such an algorithm, the jobs are firstly sorted in the non-increasing order of the index .For notational convenience, we define H as the algorithm used to construct the two subsequences and , such as H = NEH or MNEH.

Second Step: Dynamic programming procedure
Once the two subsequences are determined, the jobs in have to be interleaved with those of to give a single schedule of n jobs denotes as .Many combination methods are proposed for this purpose in the literature on hybrid flow shops.For instance, Oguz et al. (1997) proposed to schedule the jobs in the nondecreasing order of their completion times on the dedicated machines for the two-stage HFS with two dedicated machines in the first stage.As well, Riane et al. (1998) studied the three-stage HFS with two dedicated machines in the second stage and developed a dynamic program to combine the resulting sequences.In this work, we use the dynamic programming procedure of (Riane et al., 1998) to achieve the best combination of the two subsequences.Our heuristic can be referred to as H-DP (Dynamic Programming-based Heuristic).The idea of H-DP is to keep the H-order in both subsequences when the jobs in are to be interleaved within the sequence .Thereby, the jobs of can be viewed as possessing"gaps" between them, in which the jobs of must fit.
Let ⊆ be the subset of the first jobs in such as 1 … .We denote as the minimal makespan where the subset is located in the first g gaps of .In such a dynamic program, the stages are the gaps in .The subset represents the state.Let denote the subset of the last jobs in placed in gap g, 0 . The decision is, thus, the determination of the subset .The dynamic program recursion equation is defined as follows (Riane et al., 1998): where represents the makespan when ⊆ is placed in gap g.The "º" indicates the composition of the makespan due to the assignment of the subset in gap g with the optimum of the subset .
In the experimental study, we compare the performance of NEH-DP and MNEH-DP with the heuristic of Riane et al. (1998) that we denote as CDS-DP.The objective of evaluating these three variants of H-DP is to prove the effect of the H-order on the performance of H-DP for the problem P.

Third step: 2-Opt
For HFS scheduling problems, many neighborhood search approaches are used to improve the quality of solutions, and the performance is significant.In this paper, the idea is to perform the algorithm H-DP followed by a local search improvement procedure.Hence, a 2-Opt algorithm is applied: It starts with an initial solution S, which is considered as a current solution at the first iteration.Then, we use a 2-opt exchange operator to generate a new solution S', from S. This one is compared with the current solution.If it is better, then it is accepted and is used as a current solution in the next iteration.Otherwise, the candidate solution is rejected and we carry out the next iteration with the same current solution.Furthermore, we use 1 /2 as a maximum number of iterations.In the following, we present an illustrative flow diagram of the heuristic IH-DP.Hence, the heuristic approach IH-DP is of complexity .

Computational experiments
In this section, different computational experiments are conducted to evaluate the performance of the H-DP and IH-DP algorithms.The procedures are implemented in DEV C++ and the results are obtained in a personal computer with an Intel 2.60 GHz CPU and 1.96 GB RAM.

Data generation
We have conducted the computational experiments on four classes of test problems generated randomly.
In each class, first and second-stage processing times are random integers from a uniform distribution from 1 to 20, denoted by ~ 1,20 and ~ 1,20].The ease of finding a satisfying solution for the studied problem depends on whether there is a balance between average workloads of dedicated machines and the total workload on the single machines.Hence, the processing times of jobs on the dedicated machines are generated randomly from the following uniform distributions: Through these different classes, we seek to study the behavior of the heuristic on different types of data.
In CLASS 1, the dedicated machines are the least loaded, while in CLASS 2, the dedicated machines are more loaded than and but with processing times generated from 1 to 60 units.In CLASS 3, the dedicated machines are also the most-loaded but the processing times are the most important and dominate those on and .As for CLASS 4, we imposed that the increasing order of the processing times on coincides with the increasing order of the processing times on the dedicated machines.Also, each job has an integer parameter which defines its processing on the dedicated machine in stage 3.This parameter is chosen randomly between and , since there is no preference between the two dedicated machines.Several instances of various sizes are generated ( 40,80,120,160,200) for each of the four classes.For each problem size, we tested 20 instances.For each instance, the quality of solution is measured by a percentage deviation , which is calculated for each of the three variants of H-DP (H= NEH, MNEH and CDS), as well as for the IH-DP algorithms.The final results are presented in terms of mean percentage deviation .The of an algorithm is defined as: where 100.
represents the makespan value obtained by IH-DP (or H-DP) for problem instance .As well, denotes the lower bound value of instance .

7.2.Computational Results
The main objectives of the computational experiments are to compare the performance of CDS, NEH and MNEH used in H-DP, and to assess the improvement brought by the 2-Opt procedure in the solutions' quality.In our study, the best resulting sequence of the three variants of H-DP is considered as the initial solution of 2-Opt.The results are presented in Tables 3-7.Tables 3-6 show the mean percentage deviation for the three variants of H-DP and IH-DP algorithms, whereas Table 7 gives the percentage of instances for which IH-DP finds the optimal solution which is equal to LB out of 20 instances.According to the results, the following observations about the problem P can be concluded: Considering the results per problem class, we can see from Table 3 that for all the instances of CLASS 1, the values of the three variants of H-DP are less than 1%.With the IH-DP, the values do not even exceed 0.04%.CLASS 1 is, thus, relatively easy to solve.CLASS 2, CLASS 3 and CLASS 4, whose results are presented respectively in Tables 4, 5 and 6, are however more difficult as the values are larger.We note that values obtained for these classes are about 6% for CDS-DP, 4% for NEH-DP, 3% for MNEH-DP and 0.5% for IH-DP.Nevertheless, for most cases, the values of CLASS 2 and CLASS 3 are smaller than those in CLASS 4. Comparing the results of three variants of H-DP, we notice that in almost all cases, NEH-DP and MNEH-DP perform much better than CDS-DP whose values are larger.Although both NEH-DP and MNEH-DP are very effective to solve CLASS 1, MNEH-DP results were slightly better.Overall, for almost all the instances of CLASS 2 and CLASS 4, MNEH-DP performs better than NEH-DP, with a mean percentage deviation that does not exceed 4.47%, while it can reach 6.49% for NEH-DP.We can therefore conclude that MNEH-DP outperforms NEH-DP in finding near optimal solution.For CLASS 3, the superiority of MNEH-DP is however not so clear since the best results are being shared between NEH-DP and MNEH-DP.This can be explained by the fact that the processing times on the dedicated machines are very important in this class of problems, and the determination of the relative order of jobs with high priority can be done randomly.
Despite the great quality of these obtained solutions, we notice that IH-DP still brings a significant improvement for nearly all of them.In fact, for all cases, the mean percentage deviation ( ) of IH-DP solutions from the lower bound are less than 0.80%.This can also be observed from the percentage of instances for which IH-DP heuristic finds the optimal solution ( . .a solution equal to LB) as shown in Table 7.We can thus conclude that the addition of the 2-Opt moves is beneficial for the performance of IH-DP in terms of high-quality solutions.Further, the performed tests show that the quality of the initial solution has a significant impact on the outcomes of IH-DP, as the latter performs better than a 2-Opt algorithm starting from a randomly generated solution.
IH-DP heuristic is able to solve the generated medium-size instances (200 jobs) in a very reasonable CPU time ( .less than 2 minutes).This can be observed from the Fig. 5 below.Also, as the number of jobs n, increases, the average CPU time increases for almost all cases.This is an expected result due to the increasing search space of the 2-Opt procedure.

Conclusion
In this paper, we have dealt with the three-stage hybrid flow shop problem with two single machines in the first and the second stages, and two dedicated machines in stage three.Considering the NP-hardness of the problem, several particular cases, which can be considered in many industrial activities, were studied.For some cases in which the processing times on are identical, an optimal solution was proposed for the problem.As well, a heuristic method was proposed for the general case and its implementation was described.A local search approach was also included to improve the quality of the obtained solutions.Then, an extensive experimental study was conducted to evaluate the performance of the proposed method.The results emphasized its high performance and showed that the mean percentage deviation ( ) of the reached solutions from the lower bound was less than 0.8% for all the instances.By adapting the lower bounds and restricting ourselves to permutation schedule, the proposed heuristic can still be used to solve the k-stage HFS with dedicated machines.We further note that all of the obtained results in this paper are still valid for the inverse problem.Going forward, we are interested in studying more realistic situations, such as multiple stages with dedicated machines.Different objective functions as well as other heuristic approaches and metaheuristic algorithms, such as genetic algorithm or tabu search, can also be assessed.

Fig. 2 .
Fig.2.The Illustration of the proof for Property 2 4. Lower BoundsIn the following, we adapt four lower bounds from the literature to problem P.These bounds will be used in the computational experiments.The first three lower bounds are derived from flow shop problems.The last one is a generalization of the lower bound previously proposed byDridi et al. (2009)   for the two-stage HFS with dedicated machines in the second stage.
|| can be solved in polynomial time.

Fig. 4 .
Fig.4.Illustration of the case where , Theorem 2: For the case where

Fig. 6 .
Fig. 6.Flow diagram of the proposed heuristic IH-DP We note that the first step of the heuristic IH-DP (NEH or MNEH algorithm) is of complexity , while the second one (Dynamic programming procedure) is a algorithm.The third step (2-Opt algorithm) runs in time.Hence, the heuristic approach IH-DP is of complexity .

Fig. 5 .
Fig. 5. Average CPU time of IH-DP according to the problem size

:
For the case where ∈, the problem || can be solved in polynomial time.

Table 3
Computational results for CLASS 1 problems

Table 4
Computational results for CLASS 2 problems

Table 5
Computational results for CLASS 3 problems

Table 7
Percentage of instances for which IH-DP finds the optimal solution which is equal to LB