We introduce a novel approach that combines machine learning (data mining) and optimization techniques for addressing the integrated CAPP and Scheduling problem. The primary objective of this approach is to create a set of rules for guiding dispatching decisions to sequence setups within a flexible job shop scheduling environment. Thus, initial nominal solutions for small problem instances are generated as sources of learning rules for scheduling. Once the solutions have been obtained, they are transformed into learning data by constructing new attributes. In this research, the term ‘attributes’ refers to the set of all data related to the scheduling decisions. The proposed approach first assigns setups to available machines on the shop floor. Secondly, setups are sequenced on an assigned machine by learning the best dispatching rule through an ML-Optimization model. Finally, considering an event of a random machine breakdown, the initial schedule is adjusted by re-assigning disrupted setups on the new available machine and sequenced utilizing the mined dispatching rule.
3.1. Solving the FJSP
An FJSP instance can be divided into two sub-problems: a routing problem and a sequencing problem. The routing sub-problem involves assigning each operation to a suitable machine. In contrast, the scheduling sub-problem focuses on determining the order in which operations should be performed while considering precedence constraints. The sequencing problem is for sequencing assigned operations to machines and is equivalent to the classical job shop scheduling problem. These two sub-problems have been shown to be NP-hard (Jun, Lee, and Chun 2019).
The Flexible Job Shop Problem (FJSP) can be approached using two main strategies: concurrent approaches and hierarchical approaches. Hierarchical approaches provide a structured method by independently handling assignments and sequencing decisions, thus reducing the problem's complexity.
A hierarchical methodology is employed to address the research problem in this research study. Specifically, a rule-based algorithm is adopted to tackle the routing problem, thereby transforming the initial problem into a form that can be effectively analyzed and compared with a classical job shop sequencing problem.
3.1.1. Solving the Routing Sub-Problem / Machine Assignment
The routing sub-problem is a crucial aspect of production scheduling and involves the assignment of each operation or task to a suitable machine or workstation. This is a fundamental step in optimizing the production process, as it determines the sequence in which tasks are executed and the allocation of resources.
Solving the routing sub-problem aims to minimize production costs, maximize efficiency and utilization, reduce makespan, or achieve other specific objectives depending on the manufacturing environment and requirements. Various algorithms and techniques, such as mathematical optimization, heuristics, and simulation, can be used to address the routing sub-problem and find an optimal or near-optimal assignment of operations to machines.
In this study, we have employed the approach by localization (AL), summarized in
Table 2, which enables us to address the resource allocation challenge and construct an ideal assignment model (Pezzella, Morganti, and Ciaschetti 2008; Vital-Soto, Azab, and Baki 2020). This method considers both the time it takes to complete tasks and the load on each machine, which is the total processing time of the operations assigned to it. The process involves identifying, for each operation, the machine with the shortest processing time, locking in that assignment and subsequently adding this time to all the following entries in the same column (updating the machine's workload), as shown in
Table 3, where bold values correspond to workload updates.
3.1.2. Solving the Sequencing Sub-Problem/Job Shop Scheduling (JSP)
Once the assignments are settled, the problem becomes akin to a classical JSP problem. We just need to determine the sequence of the setups on the machines. The sequencing is feasible if it respects the natural precedence relationship among the setups of the same job, i.e., setup Si,j cannot be processed before setup Si,j+1. In this study, the sequencing of the initial assignments is obtained by solving the following Mixed Integer Linear Programming (MILP) model, which is formulated as follows:
The problem considers n jobs that must be processed in m machines. Each job consists of a total of nj setups. Each setup Sij must be assigned to a machine k and find the sequence of the job j. The setup planning solution includes and sets the precedence between the setups of a job. The objective is to minimize the maximum makepan.
The following assumptions are proposed for the FJSP:
- (1)
All the jobs and machines are available at time zero.
- (2)
Each machine can perform at most one operation at any time.
- (3)
Transportation time is not considered.
- (4)
procession time includes setup time.
- (5)
Job preemption is not allowed.
- (6)
The setup numbers are indicative of their natural logical sequence within a job.
The notations used in this paper are defined as follows:
Index:
J: Number of jobs
j: The index of jobs of {1,2,..,J}
m: Number of machines
k: The index of machine {1,2,..,m}
nj: Number of setup in a job j
i: The index of setup {1,2,..,nj
Parameter:
: Processing Time of setup i of job j on machine k
M: a very large positive number
=
Decision variables:
: start time of the setup i of job j on machine k
=
: Makespan
The objective function is defined by Eq. (1), which minimizes the makespan. Constraint set (Eq. (2)) defines the start time for each setup on the assigned machine. The disjunctive sets (Eqs. (3) and (4)) are feasibility constraints that ensure that only one setup of a job processed on a machine at a time and precedence relationship is followed. The disjunctive constraint sets (Eqs. (5) and (6)) avoid the overlapping of setup on same machines of different job at a time. Constraint sets (Eq. (7)) define the maximum make span. Constraint set (Eq. (8)) ensures that the starting time and make span should be either positive or zero. Constraint sets (Eqs. (9) define the types of variables.
The goal of the experiment is to solve the problem instance to generate quality solutions (makespan). OR-Tools2 (ORT), an open-source solver developed by Google(Da Col and Teppan 2019b). In this research, we employed Google’s OR-Tools to find the sequence of the initial assignment. Concerning the solvers’ version, we use version 9.6 for OR-Tools. We have decided to use the CP-SAT solver because CP-SAT has proven to be better on average, as reported in the literature, is fairly easy to implement, and is compatible with other necessary Python libraries and packages (Da Col and Teppan 2019b; 2019a). The experiment is conducted on a system equipped with a 3 GHz Intel Core i7 4-Core (11th Gen), 16GB of DDR4 RAM, and a 256GB M2 SSD.
3.2. Construction of Data Mining Dataset from Initial Solution
Creating an appropriate training dataset is a pivotal aspect of the entire rule-mining procedure. When viewed from the perspective of setup sequencing, the primary objective is to identify the preferred order in which setups should be prioritized for dispatching among a collection of schedulable setups, regardless of whether they belong to the same or different jobs and are intended for the same machine at a specific moment. By extracting this knowledge from the training dataset, we can determine the sequence for dispatching the next setup at any given time. Subsequently, this knowledge can be used to generate dispatching lists for any combination of jobs and machines, provided that the assignment or routing for each setup is known.
3.2.1. Attributes Selection
Attribute selection is the task of identifying the most appropriate set of attributes for a classifier, with the aim of reducing the number of attributes while maximizing the separation between classes (Shahzad and Mebarki 2012). This process is crucial for the effectiveness of subsequent model induction since it helps eliminate redundant and irrelevant attributes. However, it is also important to note that the attributes recorded as part of the available data may not always be the most relevant or useful for the data mining process, making the creation of new attributes a necessary consideration.
Priority relationship can be formed between the jobs while the sequencing based on their processing time, due date etc. (Shahzad and Mebarki 2012; Xiaonan Li and Olafsson 2005; Olafsson and Li 2010). This priority relationship can be reduced by only considering two setups on the same machine, among schedulable jobs, at any given instance for comparison. However, proper attribute selection is essential for capturing this relationship.
Furthermore, both the selection of raw attributes from production data and creation of new attributes are closely tied to the objectives of the scheduling problem. Objectives related to making span require different attributes to be considered compared to objectives related to flow time or tardiness. For example, attributes related to processing time, precedence relationship and associated statistics are more suitable for makespan or completion time-based objectives. Similarly, attributes related to deadlines and associated statistics are more suitable for tardiness-based objectives.
Additionally, the attributes that are recorded as part of the raw production data may not be the attributes that are the most useful for the data mining itself. Thus, new attributes creation must be considered. (Shahzad and Mebarki 2012; Xiaonan Li and Olafsson 2005; Olafsson and Li 2010). Combining raw attributes through arithmetic operations can lead to the creation of new valuable attributes, as pointed out by Olafsson and Li (2010). However, it is important to avoid having a large set of attributes, as they are often not independent of each other, which can make the process computationally impractical (L. Zhang et al. 2022).
This study considers 11 attributes belonging to two types, raw and constructed. The four raw attributes based on are the setup processing time (p
ijk) and the due date of the job (dj). These are considered directly from production data. Constructed attributes can further be divided into two types. Composite attributes and categorical attributes. 2 composite attributes are constructed with basic arithmetic operations following the methodology proposed by Li and Olafsson, (Xiaonan Li and Olafsson 2005; Olafsson and Li 2010). The categorical attributes represent binary variables used to indicate a direct comparison between two setups, A and B. When the raw attribute value of A exceeds that of B, the categorical value is set to 1. Conversely, when the raw attribute value of A is less than that of B, the categorical value is set to -1. For all other situations, the categorical value is set to 0. In this research, 5 categorical attributes are also constructed to capture the priority, delay, and precedence relationship among setups. Details of the attributes are shown in
Table 4.
3.2.2. Creation of Training Dataset
The goal of this step is to convert the initial nominal scheduling solution into training data. From the previous steps, nominal solutions for each problem instance are saved as a flat data file. The columns represent separate data attributes, and each row of the file represents the schedule of a setup. Then the training dataset for sequencing setups is generated by following 2 steps, as shown in
Figure 3.
First, the first setup in the schedule list is selected and all setups that can be processed at the start time are taken. Subsequently all possible combinations of setup pairs are selected. Thus, for a problem instance with j job each having i setups, there will be 2 x possible setup pair.
Then, rows for all possible pairs of setups are appended to a dataset with their attributes.
3.3. Development of Dispatching Rule Mining Model
The setup sequencing rule or dispatching rule is mined using the following supervised learning methodology. The implementation details are described in the following sections.
3.3.1. Preprocessing of the Data
Preprocessing the data, including feature selection and data cleaning, such as handling missing, outliers, inconsistent, skew values, removing duplicates, ensuring data format consistency, correcting typos, errors, dealing with irrelevant or redundant information etc. In the present scenario, case studies have been meticulously crafted through simulation. Nevertheless, it is imperative to emphasize the significance of this step, particularly when dealing with datasets derived from real-world manufacturing systems.
3.3.2. Model Selection
The choice of potential classifiers suitable for the problem depends on the problem's complexity, dataset size, interpretability needs, and available algorithms. For this research, Random Forest, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Naive Bayes, and Logistic Regression is chosen which represent a mix of ensemble, instance-based, linear, and probabilistic algorithms. These classifiers offer a range of strengths and weaknesses, and they are widely recognized and applied in various classification scenarios. Given the relatively small dataset size and the need to understand the behavior of different algorithm families, these choices provided a comprehensive baseline for assessment.
3.3.3. Parameter Tuning
Identify hyperparameters specific to the chosen models (e.g., learning rate, number of trees, regularization strength) that affect model performance. We investigated the typical variation of parameters for each learning algorithm. This section provides a summary of the parameters employed for each learning algorithm (Caruana and Niculescu-Mizil 2006).
Random Forest (RF): The number of trees in the forest varies between 50 to 500. The number of features to consider when looking for the best split was 1, 2, 4, 6, 8 and 11.
KNN: We used 10 values of k ranging from k = 1 to (number of sample). The standard Euclidean distance was used as distance computation matric.
SVM: The following kernels were used: linear, polynomial degree 3 and radial with kernel varying coefficient (1 / (n_features * X.var()), 1 / n_features, 0.001, 0.01, 0.5, and 1)
Naive Bayes (NB): We employed Gaussian Naive Bayes.
Logistic Regression (LR): Regularized logistic regression is employed. Tolerance was varied by a factor of 10 from 10-5 to 105.
3.3.4. Cross Validation
This study uses stratified K-fold CV on the dataset to perform 5- and 10-fold cross-validation. The dataset is shuffled to have representative folds.
3.3.5. Model Evaluation Metrics
In this research, the best-performing model based on its performance on the cross-validation set is selected and assessed against the test set, which it has never seen before. This gives an estimate of its generalization ability. To evaluate the performance, the approach proposed by Caruana and Niculescu-Mizil (2006) has been adopted. In this evaluation process, we have calculated performance metrics based on seven evaluation parameters: Accuracy (ACC), F-score (FSC), Receiver Operating Characteristic (ROC) score, Precision (APR), Recall (REC), Root Mean Square Error (RMS), and Cross-Entropy (MXE), as well as the execution time (TIME).
3.4. Reconfiguration of Initial Nominal Schedule Under Disruption
This section explains the rescheduling strategy. The rescheduling strategy employs dynamic adjustments to the existing schedule, prioritizing the reassignment of affected jobs to alternative available machines. This ensures production can resume as swiftly as possible following a breakdown event. In this research, we have considered an FJSP with a machine breakdown problem based on the following definitions and assumptions:
Index:
J: Number of jobs
j: The index of jobs of {1,2,..,J}
m: Number of machines
k: The index of machine {1,2,..,m}
nj: Number of setup in a job j
i: The index of setup {1,2,..,nj}
: A subset of machines for setup i
⊆ (m1, m2,.., mk)
Parameter:
: Processing Time of setup i of job j on machine k
=
= Mean time between breakdown of machine k
: Processing Time of setup i of job j on machine k
: Breakdown probability threshold of machine k
Decision variables:
=
: start time of the setup i of job j on machine k
: end time of the setup i of job j on machine k
: Breakdown time of machine k,
Assumptions:
The occurrence of machine failures is modeled as following an exponential distribution
During a production cycle, only one machine will experience breakdown
3.4.1. Machine Breakdown Distribution
According to the assumption of He and Sun (He and Sun 2013), breakdown probability follows the exponential distribution.
Here, Pk = Probability of machine failure, rbk = Estimated repair time, ʎ = 1/Mean time between two successive breakdowns
Following this assumption, this thesis introduces a Monte Carlo simulation-based approach to model the probability of breakdowns occurring over a production cycle. The simulation model is implemented using Python, leveraging the random and matplotlib libraries.
Simulation model for Machine Breakdown:
Setting the Mean Time Between Breakdowns (lambda): The mean time between breakdowns (lambda) is a key parameter that influences the simulation's behavior. This parameter is user-adjustable, allowing different real-time scenarios and system characteristics to be explored.
Generating Random Breakdown Times: Using an exponential distribution, the simulation generates random breakdown times for each machine independently. We conduct 1000 simulations for each machine to collect data on breakdown times.
Calculating Breakdown Probability: We compute each machine's breakdown probabilities at various time points. This allows us to construct cumulative probability curves specific to each machine.
In this research, If the probability function exceeds a specified threshold, the machine will experience a breakdown. Multiple breakdowns are not considered to simplify the problem.
3.4.2. Rescheduling Framework
To address rescheduling in response to machine breakdowns, a comprehensive strategy is proposed, which is outlined in the following framework (
Figure 4):
Assuming an initial state at t = 0, where the probability of machine breakdown is zero, the prescheduling process is initiated on the job floor, and setups are executed in accordance with the initial nominal scheduling solution. In instances where no machine breakdown occurs, this schedule becomes the realized schedule. As the probability of machine breakdown surpasses a predefined threshold, machine failures are anticipated. Subsequently, the following decision criteria must be evaluated:
Identification of Interrupted Setups: A critical assessment is conducted for all setups in progress on the broken machine at the time of breakdown. Setups categorized as "interrupted setups" if their scheduled end time exceeds the breakdown time.
Reassignment of Interrupted Setups: To resume production without delay, these interrupted setups must be reassigned to currently available eligible machines. This reassignment is executed following a localization heuristic approach.
Sequencing of Interrupted Setups: Once the setups have been reassigned to new machines, their sequence is determined using a dispatching rule derived from the RF-PDR mining model.
Continuation of the Rescheduling Process: The rescheduling process is iteratively executed until the machine is repaired and brought back into operational condition. Throughout this process, the current availability of resources is continuously considered to ensure optimal scheduling decisions.
This rescheduling framework is designed to effectively address machine breakdowns, minimizing disruption to production processes and optimizing resource utilization systematically and adaptively.
3.4.3. Robust and Stability Measures of Rescheduling
The rescheduling implemented on the job floor is characterized by two crucial attributes: robustness and stability. Developing a rescheduling system that embodies robustness and stability is imperative to mitigate the impact of unforeseen disruptions. In this study, the robustness and stability metrics are adopted from He and Sun’s (2013)and defined as follows:
Here, CmaxR = makespan after rescheduling, Cmaxp = makespan of prescheduling.
The stable measures can be articulated as follows:
Here, n′ = no of unfinished and currently in-progress jobs, n = total number of jobs, q′ = no of unfinished and currently in-progress setup of job I, Cijp = predicted completion time for setup i of job j in the prescheduling phase, CijR = completion time for setup i of job j in the rescheduling process.
Figure 4.
Rescheduling Framework.
Figure 4.
Rescheduling Framework.