A Batch Scheduling Model for a Three-stage Flow Shop with Job and Batch Processors Considering a Sampling Inspection to Minimize Expected Total Actual Flow Time

Purpose: This research develops a batch scheduling model for a three-stage flow shop with job processors in the first and second stages and a batch processor in the third stage. The model integrates production process activities and a product inspection activity to minimize the expected total actual flow time. Design/methodology/approach: The problem of batch scheduling for a three-stage flow shop is formulated as a mathematical model, and a heuristic algorithm is proposed to solve the problem. This model applies backward scheduling to accommodate the objective of minimizing the expected total actual flow time. Findings: This research has proposed a batch scheduling model for a three-stage flow shop with job and batch processors to produce multiple items and an algorithm to solve the model. The objective is to minimize total actual time. The resulting production batches can be sequenced between all types of products to minimize idle time, and the batch processor capacity affects the sample size and indirectly affects the production batch size. Originality/value: This research develops a batch scheduling model for a three-stage flow shop constituting job and batch processors and carrying out integrated production and inspection activities to minimize the expected total actual flow time


Introduction
Production shop floors carry out many activities, such as production processes and product quality tests. The activities must be conformable to avoid delays in completed product delivery to consumers and described as a multi-stage flow shop. In a multi-stage flow shop, it can involve various activities and characteristics of the machines used as in the research conducted by Halim, Suryadhini and Toha (2006). They discussed a batch scheduling model for a two-stage flow shop in an electronics manufacturing company with a common machine in the first stage comprises a surface mounting machine assembling micro-components to the printed circuit board and a parallel dedicated-machine in the second stage assembling the other components. The machines in the first and second stages constitute job processor machines that process parts one by one. Two-stage scheduling models for a flow shop consisting of a common machine in the first stage and a dedicated machine in the second stage have been discussed in Huang and Lin (2013) and Gerstl and Mosheiov (2013) for batch scheduling, and Wang and Liu (2013) for job scheduling. Suryadhini, Sukoyo, Suprayogi and Halim (2018) developed the model in Halim et al. (2006) to accommodate a three-stage flow shop case in which the third stage performs a functional test on a shared machine to ensure that the finished products satisfy the specifications. The machine of the third stage constitutes a batch processor machine that processes a group of parts simultaneously at once. Scheduling research for shops with batch processor machines has been discussed in Hidayat, Cakravastia, Samadhi and Halim (2013) and Suhaimi, Nguyen and Damodaran (2016) for single stage and Chen, Zhou, Li and Xu (2014) and Tan, Mönch and Fowler (2017) for two-stage flow shop. Furthermore, Li, Meng and Liang (2015) dealt with scheduling problems for shops with job processors and batch.
This paper addresses a three-stage flow shop scheduling problem that integrates production process and product inspection activities as an extension of the model proposed in Suryadhini, Sukoyo, Suprayogi and Halim (2019). Note that the model in Suryadhini et al. (2019) is a developed model from that in Suryadhini et al. (2018). The difference is that this research includes the type of inspection and the numbers of product type, i.e., the previous research applies 100% inspection and involves two types of products; in contrast, this research applies sample inspection and involves more than two types of products. Several pieces of research discussing the integration between production and inspection activities have been conducted by Indrapriyatna, Suprayogi, Iskandar and Halim (2007) and Pandey, Kulkarni and Vrat (2011).
The objective of the model addressed in this research is to minimize the total actual flowtime defines by Halim, Miyazaki and Ohta (1994a); this objective applies a backward scheduling approach to fulfill the on-time delivery. This objective has been widely adopted, such as in Hidayat, Cakravastia, Samadi and Halim (2015) dealing with the scheduling for the heterogeneous batch processor and Maulidya, Suprayogi, Wangsaputra and Halim (2017) dealing with the scheduling for Hybrid Assembly Differentiation Flowshop and many others.

Problem Statement
The paper addresses a three-stage flow shop batch scheduling producing n types of products with a common due date. The flow shop produces two types of batches, that is, production and inspection batches. In the first stage, all types of products are produced on a common machine with the same processing time. The second stage consists of n parallel dedicated machines; all types are processed on respective dedicated machines and with respective processing times. Production batches are processed in the first and the second stage with the same size and sequence of the batch. The batching process assumes that each production batch consists of only one type of product.
In the third stage, all types of products will be inspected in a common machine that constitutes a batch processor. In this stage, the batch to be inspected is called the inspection batch consisting of the sample from the production batch; the sample size is determined using the Dodge-Romig sampling scheme (Schilling & Neubauer, 2009). The inspection batch could consist of one or more types of products because all types have the same test, but the sample size cannot exceed the batch processor capacity. Each production batch that has been processed in the second stage will be sampled and grouped according to the production batch sequence until the total number of samples are equal or close to the batch processor capacity. The purpose of the inspection batch is to inspect the sample and to inspect the remaining parts from the rejected production batch due to 100% inspection.
The following notations are used in this paper:

Model Development
Let G types of products be indexed by g from 1 to G; each product type consists of h g parts. Each part of each type of product will be grouped into a production batch and will be processed in the first two stages; all production batches will be processed in the common machine at the first stage denoted by M 0 with processing time denoted by t 0 . In the second stage, which consisting of G parallel dedicated machines, the production batches from each type of product will be processed on a respective dedicated machine denoted by M g with different processing times indicated by t g . Before starting the process in the third stage, each production batch will be sampled and each sample will be grouped into inspection batches. An inspection batch may consist of samples of the same or different types of products, but the total parts must be equal or close to the batch processor capacity. If a rejected production batch is found in the third stage, the production batch must be 100% inspected and the rejected parts will be replaced.

Production Batch
The production batch is formed before the processing in the first stage, and as previously mentioned, a production batch consists of one type of product. The size of the production batch represents several parts in a batch, and it is influenced by the proportion of non-conforming parts (p) because it is assumed that there is no rework process to replace non-conforming parts, and to anticipate this, the number of production units was increased. If the batch size denoted by Q and the size of the production batch to be produced is denoted by Q', then Q' can be formulated as follows: (1) The production batch size is indirectly affected by the sample size of the production batch because the sample size should not exceed the batch processor capacity. If exceeded, the number of production batches will increase, and the size will decrease.

Inspection Batch
The inspection batch is used to inspect the sample and to inspect 100% of the rejected production batch. The inspection batch used to inspect the sample is formed from a group of samples, and to determine the number of samples (A) is done by the following Dodge-Romig rule: (2) In Equation (2), P L is the average outgoing quality limit, whereas the value of y can be found in Schilling and Neubauer (2009).
To determine the number of inspection batches, we must know the number of parts to be inspected, and the Dodge-Romig scheme is used to determine the sampling. Deciding the number of parts inspected, for both the sample and the rejected production batches uses the Average Total Inspection (ATI) (Schilling & Neubauer, 2009). The following equations calculate the Average Total Inspection (ATI), the total number of inspection batches (Z), and the number of inspection batches to inspect the samples (Z'):  g and I (4)  g and I In contrast to the production batch, an inspection batch may consist of one or more types of products, but in this research, it is assumed that the samples from the same production batch cannot be inspected on a different inspection batch. Therefore, the inspection batch size may not be full or not equal to the batch processor capacity. The remaining capacity for sample inspection can be used to inspect remaining parts from rejected production batches so that the inspection batches can inspect both samples and parts from rejected production batches simultaneously. However, an inspection batch might only inspect the parts from the rejected production batch if the total number of inspection batch is greater than the total number of inspection batch for the sample (Z >Z').

Sequencing Rule for Production and Inspection Batch
The sequencing process in this research refers to the research conducted by Halim, Miyazaki and Ohta (1994b), and the research develops multi-item scheduling intending to minimize the total actual flowtime. In the proposed algorithm, after obtaining the number and size of the production batches, the batches are sequenced, the resulting sequence should minimize the total actual flow time. The sequencing process is carried out by an index that reflects the actual flowtime of the batch. The index is calculated using the following equation: The production batches are sequenced by index, starting from the smallest to the largest index. The sequencing process is carried out twice. First, the sequencing is carried out between production batches for the same product type, and the second, sequencing is carried out between types of products. The second sequencing is performed to minimize the idle time in the second stage.

Actual Flow time
The actual flow time is defined by Halim et al. (1994a) as the time interval between the arrival time of a job at the shop and their common due date, and can be formulated as follows: where d is the common due date and B [i] is the starting time of a job. This criterion shows that a job does not have to arrive at the shop floor at the same predetermined time, i.e., at time zero, but may come to the shop floor at the starting time of processing the job. Hence, this criterion reducing the shop time and satisfy the due date simultaneously. This criterion applies the backward scheduling method to fulfill customer satisfaction in on-time delivery.
In a batch scheduling problem, the actual flowtime is calculated by multiplying part processing time (t) by the number of parts in a batch (Q [j] ), can be written as follows: Equations (7) and (8) are used for a single machine case.
The actual flow time of each part in a batch is the same as the actual flowtime of a batch because each part in the batch must wait until all the parts in the batch are processed completely. The total actual flow time of all parts through the shop can be written as follows: The total actual flow time of parts processed in a two-stage flow shop with a common machine in the first stage and a parallel dedicated-machine in the second stage has been developed by Halim et al. (2006) as follows: The processing time in the first stage is denoted by t 0 ; in contrast, processing time in the second stage is represented by t g , and the variable X g [i] is a binary number that indicates the existence of a product type in a batch.
The actual flow time in a three-stage flow shop with a common machine in the first stage, parallel dedicatedmachine in the second stage, and common machine for inspection activity have been developed by Suryadhini et al. (2018). In the inspection activity, the inspection position for samples can affect the production batch's starting time at the first stage and the second stages. Therefore we can use the due date and starting time in the first stage ( B 1[i] ) to calculate the total actual flowtime, it can be written as follows:

Starting Time Determination
Suppose the three-stage flow shop processes three types of product, called TP1, TP2, and TP3. If the production batches of each type of product are divided into two batches, and the production batches sequenced in positions counted from the end position on a time scale, the schedule will be as follows. The production batches of TP1 will be at Positions 1 and 4, the production batches of TP2 will be at Positions 2 and 5, and the production batches of TP3 will be at Positions 3 and 6. The samples from each production batch will be grouped as inspection batches; for example, the total number of inspection batches (Z) is 3 batches, and the number of inspection batches for inspecting the samples (Z') is 2 batches. Thus, one inspection batch was used for 100% inspection of the rejected batch. The samples from the production batch at Positions 1, 2, 3, and 4 will be inspected in the inspection batch at Position 1, and the samples from the production batch at Positions 4 and 5 will be inspected in the inspection batch at Position 2. Figure 1 shows the Gantt chart of the illustrated problem.
Regarding Figure 1. the starting time of inspection batch for sampling inspection affected by the number of inspection batch for 100% inspection, to determine the starting time of the inspection batch for sample inspection at Position 1 and Position 2 can be formulated as follows: According to Equations (12) and (13), the general formulation of the starting time in the third stage can be formulated as follows: The starting time of the production batch in the second stage (B 2[z][i] ) is affected by the inspection position of the sample. The sample from the production batch at Position 1 is certainly inspected in the inspection batch at Position 1, and the starting time for the production batch at Position 1 in the second stage can be formulated as follows: Equations (16) and (17) show that the starting time of the production batch is in the second stage. The starting time of a production batch at a particular position in the second stage is affected by the starting time of the inspection batch, which inspects the production batch and the processing times in the second stage for the production batch and also the production batch at the previous position for the same type of product.
The starting time of the production batch at Position i in the first stage (B 1[i] ) can be affected by the starting time of the production batch at Position i in the second stage or the starting time of the previous batch in the first stage; therefore the start time of the first stage can be formulated as follows:

Mathematical Formulation
The problem of batch scheduling for a three-stage flow shop, where a common machine in the first stage and parallel dedicated machines in the second stage constitute job processors, and where a common machine comprising a batch processor in the third stage, to minimize expected total actual flowtime can be formulated as the following model: Constraint (20) shows the production batch at Position 1 backwardly must be completed at the common due date. Constraint (21) shows the formulation of the starting time of the production batch at Position i in the first stage, for i  2. Constraint (22) shows that the starting time of the batch sequenced at the last Position backwardly in the first stage must be equal to or greater than time 0. Constraint (23) shows that the completion time of the last production batch processed in the second stage must be equal to the starting time of the last inspection batch processed. Constraint (24) shows the formulation of the starting time of the production batch at Position i in the second stage, which exists in the inspection batch in the first position. Constraint (25) shows the starting time of the production batch in the second stage, which exists in the inspection batch at position z. Constraint (26) shows the last batch inspection that inspects the samples, and the expected batch inspection that runs the 100% inspection must be completed at the common due date. Constraint (27) (31) shows that the size of the inspection batch must be equal to or less than batch processor capacity. Constraint (32) represents a material balance for each type of product. Constraint (33) shows the existence of the product type in the production batch at position i. Constraint (34) shows that the last sample of the production batch must be processed in the last inspection batch processed for sample inspection. Constraint (35) shows that the first sample of the production batch must be processed in the first inspection batch processed for samples inspection. Constraint (36) is a binary number that states the existence of a production batch in an inspection batch. Constraint (37) is the lower bound of production batch size.

Proposed Algorithm
To solve the problem, we propose a heuristic algorithm developed by Halim et al. (1994b), i.e., an algorithm is used to solve the problem of batch scheduling for multiple items in a single machine. Therefore, some adjustments need to be made so that it can be used to solve batch scheduling problems for a flow shop processing multiple items. Halim et al. (1994b) solved the problem by proposing sub-algorithms and algorithms where the sub-algorithms were to determine whether the problem was feasible, and to determine an initial schedule. The sub-algorithm is to get initial variables used in the completion algorithm, while the algorithm is to solve the entire problem until achieving the goal.
In this research, all parts through two assembly processes, i.e., the process at the first stage and the second stage. Accordingly, the processing time used to complete the calculation of the number and size of production batches is the processing time that occurs in the first and second stages. Processing time in the third stage is not included in calculating the number of batch productions and batch sizes because the process that occurs in the third stage is a process for samples, not for all parts.
The sub-algorithm will generate initialization variables such as the number of initial production batches for each product type ( 0 g ), and the time interval required to process the entire initial production batch ((T) min ), and also the initial sequence of the production batches. This sub-algorithm is also used to ensure that the problem is feasible; The problem is feasible if the starting time for the first production batch processed in the first stage is equal to or more than 0 (B 1[N]  0), or the time interval required to process the entire initial production batch ((T) min ) less than or equal to the common due date ((T) min ≤ d).
After the initial variable is determined, then execute the algorithm to achieve the research objectives. The proposed algorithm is implemented iteratively; in each iteration, the starting time of the production batch will be shifted, with the shifting interval is from V 1 to V T , where V 1 is equal to the common due date (V 1 = d), and V T equal to (T) min (V T = (T) min ), and it will affect the number of production batches produced and the size of the production batch.
The available time interval will affect the length of the allowable time to process all parts in each type of product denoted by T g ; if the limit of available time is the due date, the allowable time (T g ) can be calculated as the following equation: Since the starting time is shifted to be V y , then the allowable time to process all parts will change; for that, we can rewrite the Equation (38) as follow: where  g e-1 denotes the number of production batches of product type g obtained from iteration e. The following equation may determine the number of production batches of product type g: The maximum number of the production batch of product type g, (N g ) max can be derived as follows: The formulation for determining batch production sizes of item g as follows: where j denotes the batch identification number when determining the sizes of the production batches of product type g. Q g[j] is integer value.
The resulting production batches sequenced by the index shown in Equation (6) refers to the proposition developed by Halim et al. (1994b) in which the following condition must be satisfied: In this research, the algorithm is used to solve the problem of batch scheduling for multiple items on a single machine, so that some adjustments need to be made so that it can be used to solve batch scheduling problems on a flow shop that processes multiple items.

Sub-algorithm
Step 1. Set all parts of each product type as one production batch, so as N = G and Q g [l] = h g . Go to Step 2.
Step 2. Calculate the size of the production batch to be produced (Q' g[l] ) using Equation (1) and Calculate the sample size (A g [l] ) for each production batch using Equation (2). Go to Step 3.
Step 3. Does the sample size exceed the batch processor capacity? If yes, go to Step 4. Otherwise, go to Step 5.
Step 4. Add one production batch for product types that have sample sizes exceeding the batch processor capacity.
To determine the production batch size (Q [i] ), divide equally or nearly the same number of items for that product type. Go to Step 2.
Step 5. Sequence the production batch specified according to Equation (44) based on the index shown in Equation (6). Determine (T') min constituting the time interval from the starting time in the first stage (B 1[N] ) of the production batch which processed first until the finishing time in the second stage of the production batch which processed last. Go to Step 6.
Step 6. Calculate the Average Total Inspection of each production batch using Equation (3) and calculate the total number of inspection batches (Z) using Equation (4). Go to Step 7.
Step 7. Calculate the number of inspection batches to test the sample (Z') using Equation (5), and then calculate samples consecutively according to the production batch sequence before the number of samples in each inspection batch is close to or equal to the batch processor capacity. Go to Step 8 Step 8. Is the number of inspection batches for sample testing less than the total number of inspection batches (Z' < Z)? If yes, calculate (T) min = (T') min + t u + (Z -Z')t u + (Z -Z')s. If no, calculate (T) min = (T') min + t u . Determine V 1 = d and V T = (T) min . Go to Step 9.
Step 9. The problem is feasible if and only if (T) min  d.

Illustrative Example
To show the implementation of the proposed algorithm, let us look at the following example. There are three types of product called PT1, PT2, and PT3 consisting of 60 units (h 1 = 60), 50 units (h 2 = 50), and 45 units (h 3 = 45). All types of products processes at Machine M 0 in the first stage with processing time t 0 = 2. In the second stage PT1 processes in Machine M 1 with processing time t 1 = 3, PT2 processes in Machine M 2 with processing time t 2 = 4, while PT3 processes in Machine M 3 with processing time t 3 = 5. In the third stage, the samples of all types of products will be tested in Machine M u , with processing time t u = 100 and the capacity of the machine is 20 units. All machines are required to setup before starting the process, and the setup time s = 1. All types of products require at the common due date, d = 1600. The expected proportion of non-conforming items, p, is 0.02, acceptance number c = 0, and AOQL 4%. The computational work of the proposed algorithm is shown as follows.
Step 2. Calculate the size of the production batch to be produced (Q' g[l] ) using Equation (1) and Calculate the sample size (A g [l] ) for each production batch using Equation (2). The result for the production batch size to be produce is Q' Step 3. Is the sample size exceed the batch processor capacity? Since the sample size is less than the batch processor capacity, then there is no replenishment in the number of production batches.
Step 5. Sequence the production batch according to index and determine (T') min . the index for each production batch is L . The resulting (T') min based on the sequence produce is 504.
Step 6. Calculate the Average Total Inspection of each production batch and calculate the total number of inspection batches (Z Step 7. Calculate the number of inspection batches to test the sample (Z'), and then group the samples consecutively. The resulting Z' is 2. The first batch inspection consists of the samples from the production batch at the first and second position, and the total number of samples is 17 units, while the second inspection batch consists of the sample from the production batch at the third Position (8 units).
Step 8. Is the number of inspection batches for sample testing less than the total number of inspection batches (Z' < Z)? Z' = 2, and Z = 3, so the (T) min = 605.
Step 4 -Step 9. The result is shown in Table 1.
The total number of inspection batch (Z) is 12 and the number of inspection batches for sample (Z') is 11 Step 10. Sequence the production batch by index  Step 12. Z = 12, Z' = 11 and Z" = 11, in this case Z' < Z, then B 3[1] = 1,399.
Step 17. The following table shows some of the results of the expected total actual flowtime between 1600  V y  605 The following table shows the resulting sequence, batch production size, and the total number of inspection batch of the final result::

Concluding Remark
This paper presented the problem of batch scheduling for three-stage flow shop processing g types of products with common and parallel dedicated machines constitutes a job processor in the first and the second stages, and a common machine in the third stage constitutes a batch processor. The result of the example shows that the proposed algorithm could work well. In this research, the determination of batch size is indirectly influenced by the capacity of the batch processor because the sample size must not exceed the capacity of the batch processor. The sequence of production batches depends on each production batch's index, and sequencing of the production batches is carried out either on the same product type or between different product types. This condition is gainful for reducing idle time.