Submitted:
26 August 2026
Posted:
26 August 2026
You are already at the latest version
Abstract
Flexible manufacturing systems are prone to deadlocks caused by shared resource competition, which may interrupt production flow and reduce system reliability. This study proposes a Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method (RF-GCAM) for flexible manufacturing systems modeled by S³PR Petri nets. The proposed framework integrates reachability graph generation, representative critical deadlock discovery, Random Forest-based deadlock classification, feature importance analysis, and recovery recommendation. In the case study, 364 reachable markings were generated, among which 4 deadlock states were identified. To reduce redundant analysis, 2 representative critical deadlocks were selected for recovery evaluation. The Random Forest classifier achieved an accuracy of 98.86%, precision of 94.12%, recall of 100.00%, and F1-score of 96.97%. Feature importance analysis further identified influential Petri net places associated with deadlock classification, including p14, p10, p0, and p17. Based on the nearest legal state search and feature importance ranking, the proposed method recommended p0 and p10 as primary recovery places for CD1 and CD2, respectively. The results show that RF-GCAM can provide accurate, interpretable, and deadlock-specific recovery recommendations for flexible manufacturing systems.
Keywords:
flexible manufacturing system
; Petri net
; S3PR
; reachability graph
; deadlock detection
; critical deadlock
; Random Forest
; feature importance
; recovery recommendation
; machine learning
1. Introduction
Flexible Manufacturing Systems (FMSs) have become a key technology in modern manufacturing because of their ability to accommodate product diversity, improve resource utilization, and support flexible production scheduling [1,2,3,4]. By integrating automated machines, robots, buffers, and material handling devices, FMSs can significantly enhance production efficiency and adaptability. However, the sharing of limited resources among concurrent processes may lead to resource contention and deadlock situations, resulting in production interruptions, reduced throughput, and increased operational costs [5,6,7].
Petri nets (PNs) have been widely recognized as an effective modeling and analysis tool for discrete-event systems because of their capability to represent concurrency, synchronization, conflict, and resource-sharing behaviors [8,9,10]. Numerous studies have applied Petri nets to model manufacturing systems and investigate deadlock-related problems [11,12,13]. Among the various Petri net subclasses, Systems of Simple Sequential Processes with Resources (S3PR) have received considerable attention because they provide a systematic representation of resource allocation structures in flexible manufacturing systems [14,15,16]. Deadlock analysis has long been an important research topic in Petri-net-based manufacturing systems. Traditional approaches generally focus on deadlock prevention, avoidance, and supervisory control policies. Structural methods based on siphons and traps have been extensively studied to guarantee system liveness [14,15,16,17]. Although these approaches can effectively prevent deadlocks, they often require significant computational effort and may lead to overly restrictive control policies that reduce system flexibility [13,14,15].
To overcome these limitations, researchers have investigated deadlock recovery strategies capable of identifying and resolving deadlock states after their occurrence [18,19]. Reachability-graph-based methods provide comprehensive information regarding state transitions and deadlock locations; however, as the size of the manufacturing system increases, the number of reachable states grows exponentially, leading to the well-known state-space explosion problem [8,13]. Consequently, not all deadlock states have equal practical importance, and identifying representative critical deadlocks becomes increasingly important for efficient decision-making. Recent advances in machine learning have created new opportunities for intelligent manufacturing systems [20,21,22]. Data-driven approaches have been increasingly applied to classification, anomaly detection, optimization, and decision-making problems in complex industrial systems [23,24,25]. Among these techniques, Random Forest (RF) has demonstrated excellent classification performance, robustness against overfitting, and strong interpretability through feature importance analysis [23]. Recent advances in interpretable machine learning have further enhanced the transparency of data-driven models by providing quantitative explanations of feature contributions and decision mechanisms [24,25]. Such capabilities are particularly valuable for identifying critical Petri net places associated with deadlock formation and supporting explainable recovery recommendations in flexible manufacturing systems.
2. Materials and Methods
This study proposes a Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method (RF-GCAM) for flexible manufacturing systems (FMSs) modeled by Systems of Simple Sequential Processes with Resources (S3PR) Petri nets. The proposed framework integrates Petri net modeling, reachability graph analysis, representative critical deadlock discovery, machine learning-based deadlock classification, and recovery recommendation into a unified decision-support framework. The proposed framework integrates Petri-net-based reachability analysis with machine learning to identify representative critical deadlocks and recommend effective recovery places.
Figure 1 presents the overall workflow of the proposed RF-GCAM framework. The proposed framework consists of eight sequential stages for critical deadlock discovery and recovery recommendation. First, an S3PR Petri net model is constructed to represent the flexible manufacturing system. Second, reachability graph generation is performed to enumerate all reachable markings and identify deadlock states. Third, representative critical deadlocks are identified through clustering analysis. Fourth, a Random Forest classifier is trained to distinguish deadlock markings from normal reachable markings while evaluating the importance of individual Petri net places. Finally, recovery recommendations are generated according to the feature importance ranking and nearest legal state search. The detailed implementation of each stage is presented in the following subsections.
2.1. S3PR Petri Net Modeling
Flexible Manufacturing Systems (FMSs) consist of multiple machines, robots, buffers, and shared resources operating concurrently to accomplish various manufacturing tasks. Owing to resource sharing and process synchronization, competition for limited resources may lead to deadlock situations that reduce production efficiency and system utilization. Therefore, establishing an accurate mathematical model is essential for analyzing system behavior and developing effective deadlock control strategies. Petri nets have been widely recognized as an effective modeling tool for FMSs because they can explicitly describe concurrency, synchronization, resource allocation, and conflict relationships in discrete-event systems [1,2,3]. Petri nets provide both graphical representation and rigorous mathematical formalism for modeling manufacturing systems [8,9,10]. A Petri net can be formally defined as follows:
where:
denotes the set of places;
denotes the set of transitions;
represents the set of directed arcs;
denotes the arc-weight function; and
denotes the initial marking of the Petri net.
where denotes the set of process places representing manufacturing operations, whereas denotes the set of resource places representing shared manufacturing resources.
Petri nets are particularly suitable for describing concurrent manufacturing processes and analyzing resource allocation, synchronization, and deadlock formation [8,9,10]. Among various Petri net subclasses, the System of Simple Sequential Processes with Resources (S3PR) has become one of the most widely adopted models for flexible manufacturing systems because it explicitly separates process places from shared resource places while preserving the structural characteristics required for deadlock analysis and supervisory control. Numerous studies have demonstrated that S3PR models provide an effective framework for deadlock prevention, liveness analysis, and supervisor synthesis in resource allocation systems [14,15,16,17]. Therefore, S3PR is adopted in this study as the underlying Petri net model for subsequent reachability analysis and recovery recommendation.
Figure 2 illustrates the S3PR Petri net model developed for the flexible manufacturing system considered in this study. The model consists of 19 places and 14 transitions, where each place represents either a manufacturing operation or a shared resource, and each transition corresponds to an event that changes the system state. The initial marking specifies the initial distribution of tokens and serves as the starting point for the subsequent reachability graph generation and deadlock analysis. Accordingly, the proposed RF-GCAM framework adopts the S3PR model as the system representation for subsequent reachability graph generation, discovery of representative critical deadlocks, Random Forest classification, and recovery recommendations.
2.2. Reachability Graph Generation
The reachability graph (RG) is generated to systematically enumerate all reachable markings of the proposed S3PR Petri net. Starting from the initial marking M_0, every enabled transition is fired according to the Petri net firing rules until no new markings can be generated. Each node in the reachability graph represents a reachable marking, whereas each directed edge represents the firing of an enabled transition. The reachability graph provides a complete representation of the system state space and serves as the foundation for subsequent deadlock detection, critical deadlock discovery, and recovery recommendation [8,9,10].
Deadlock states are identified during the reachability graph generation process. A marking is regarded as a deadlock if no transition is enabled under the current marking. These deadlock markings represent system states in which all manufacturing operations are blocked because of resource contention. Therefore, the reachability graph provides complete state-space information for deadlock analysis [2,7,14,15,16,17].
For a Petri net, the backward incidence matrix specifies the number of tokens consumed by each transition, whereas the forward incidence matrix specifies the number of tokens produced by each transition. The reachability graph and deadlock markings were generated using a MATLAB implementation based on the predefined and incidence matrices of the S3PR model. Accordingly, the incidence matrix is defined as
A transition is enabled if
where denotes the current marking vector.
Once transition fires, the new marking is updated as
These firing rules are repeatedly executed until all reachable markings have been explored. The reachability graph is generated using a breadth-first state exploration strategy, where newly generated markings are iteratively expanded until no unexplored reachable marking remains.
2.3. Representative Critical Deadlock Discovery
Although the reachability graph contains all reachable deadlock states, not every deadlock contributes equally to the recovery decision-making process. Some deadlock states exhibit highly similar resource allocation patterns and therefore require nearly identical recovery actions. Directly analyzing every deadlock state increases computational complexity and may introduce redundant information into the subsequent machine learning process. Consequently, identifying representative critical deadlocks is an essential step toward improving the efficiency of recovery recommendation and reducing computational redundancy [15,16,17,18,19].
To quantify the similarity between deadlock states, each deadlock marking is represented as a marking vector. The Euclidean distance between two deadlock markings and is computed as
where denotes the number of tokens in the -th Petri net place of marking , and denotes the number of Petri net places.
The pairwise distances between all deadlock markings are organized into a symmetric distance matrix. Smaller distances indicate highly similar deadlock structures, whereas larger distances represent distinct resource allocation configurations. The distance matrix provides quantitative information for identifying representative deadlock states prior to clustering. A zero distance indicates identical deadlock markings, whereas larger distances indicate greater structural differences between deadlock states.
In this study, four deadlock markings identified from the reachability graph were analyzed using the Euclidean distance matrix. Based on the clustering results, two representative critical deadlocks were selected for subsequent Random Forest training. This selection reduces redundant deadlock patterns while preserving the major structural characteristics of the original deadlock set.
2.4. Random Forest-Based Deadlock Classification
After representative critical deadlocks are identified, a Random Forest (RF) classifier is employed to distinguish deadlock markings from normal reachable markings. Random Forest is an ensemble learning algorithm that constructs multiple decision trees using bootstrap aggregation (bagging) and predicts the class by majority voting, thereby improving classification accuracy while reducing the risk of overfitting. Owing to its robustness, high predictive performance, and inherent interpretability, Random Forest has been widely adopted in manufacturing system analysis and intelligent decision-support applications [23,24,25].
Each reachable marking obtained from the reachability graph is represented as a feature vector whose elements correspond to the token numbers of individual Petri net places. Reachable markings are labelled as Normal or Deadlock according to the reachability analysis results. Each reachable marking is represented by the token distribution over all Petri net places and serves as one training sample for the classifier. To alleviate the class imbalance caused by the relatively small number of deadlock markings, the minority deadlock class is balanced through oversampling before classifier training. The resulting dataset is then randomly divided into training and testing subsets for model construction and performance evaluation.
Suppose the marking vector is
where denotes the number of tokens in the -th Petri net place.
For a Random Forest consisting of decision trees, the predicted class is determined by majority voting,
where ) represents the prediction of the -th decision tree.
where denotes the importance score of the -th Petri net place, represents the impurity reduction contributed by the corresponding feature in the -th decision tree, and is the total number of decision trees.
2.5. Recovery Recommendation Mechanism
The proposed recovery recommendation mechanism utilizes the feature importance values obtained from the Random Forest classifier to determine the priority of recovery places for each representative critical deadlock. Rather than treating all Petri net places equally, the proposed method assigns higher recovery priority to places that contribute more to deadlock classification. This strategy enables recovery decisions to focus on the most influential structural components while reducing unnecessary recovery operations [18,19,23,25].
For each representative critical deadlock, the nearest legal marking is first identified by searching the reachable state space generated in Section 2.2. Let denote a representative critical deadlock marking and denote its nearest legal marking. The recovery candidate set is defined as the set of Petri net places whose token numbers differ between the two markings:
where denotes the candidate recovery places.
For each candidate place , the recovery priority is determined according to its Random Forest feature importance value:
where is the feature importance value defined in Equation (9). Candidate recovery places are ranked in descending order according to . Places with higher scores are assigned higher recovery priority because they contribute more significantly to distinguishing deadlock markings from normal reachable markings.
Finally, the recovery recommendation list is generated by combining the nearest legal state search with the Random Forest feature importance ranking. The highest-ranked Petri net places are recommended as the preferred recovery locations for the corresponding representative critical deadlock. This recommendation mechanism integrates structural information from the reachability graph with data-driven feature importance analysis, thereby providing interpretable recovery decisions for flexible manufacturing systems.
3. Results
3.1. Reachability Analysis Results
Using the reachability graph generation procedure described in Section 2.2, all reachable markings of the proposed S3PR Petri net model were enumerated from the initial marking. The results show that 364 reachable markings were generated. Among these markings, 4 deadlock states were identified, corresponding to a deadlock ratio of 1.10%. This indicates that deadlock states occupy only a small portion of the overall reachable state space.
Although only a limited number of deadlock states were detected, direct analysis of all deadlock markings may still introduce redundant recovery information when similar deadlock structures exist. Therefore, the proposed representative critical deadlock discovery procedure was applied to reduce redundant deadlock patterns. As a result, 2 representative critical deadlocks were selected for subsequent Random Forest-based classification and recovery recommendation.
Figure 3 summarizes the reachability graph statistics, including the number of reachable markings, detected deadlocks, representative critical deadlocks, and the deadlock ratio.
The reachability graph generation results are summarized in Table 1. Starting from the initial marking of the proposed S3PR Petri net model, a total of 364 reachable markings were generated. Among these reachable markings, 4 deadlock markings were identified, resulting in a deadlock ratio of 1.10%.
These results indicate that deadlock states account for only a small portion of the reachable state space. Therefore, instead of analyzing all reachable markings directly, the proposed RF-GCAM framework focuses on identifying representative critical deadlocks for subsequent classification and recovery recommendation.
The statistics of the generated reachability graph are summarized in Figure 3. Using the proposed reachability graph generation algorithm, a total of 364 reachable markings were generated from the initial marking. Among these markings, 4 deadlock states were identified as summarized in Figure 3. To reduce the computational complexity of subsequent recovery analysis, only 2 representative critical dead-locks were selected through clustering analysis for further investigation. These representative critical deadlocks are further analyzed in the following subsection to support Random Forest-based deadlock classification and recovery recommendation.
As shown in Figure 3, only four deadlock markings were identified among 364 reachable markings, indicating that deadlock states occupy a very small proportion (1.10%) of the reachable state space. To improve computational efficiency, the proposed framework clusters the deadlock states to extract representative critical deadlocks instead of analyzing each deadlock state individually.
3.2. Representative Critical Deadlock Analysis
The representative critical deadlock discovery procedure was applied to analyze the structural similarity between deadlock markings. Each deadlock marking was represented as a vector of token distributions over the Petri net places, and the Euclidean distance between deadlock markings was calculated. The pairwise distance matrix was then used to evaluate the similarity among deadlock states.
Based on the pairwise distance matrix shown in Figure 4, clustering analysis is performed to group deadlock states exhibiting similar structural characteristics. Deadlocks belonging to the same cluster generally share similar resource contention patterns and can therefore be represented by a single representative critical deadlock. This strategy significantly reduces redundant analyses while preserving the essential structural characteristics required for Random Forest training and subsequent recovery recommendation. [18,19].
As shown in Figure 4, the diagonal elements of the distance matrix are zero, indicating the distance of each representative critical deadlock from itself. The off-diagonal elements represent the structural difference between CD1 and CD2. A larger distance indicates that the two representative critical deadlocks have different resource allocation patterns. Therefore, CD1 and CD2 were retained as representative deadlock patterns for further analysis.
The selection of representative critical deadlocks reduces redundant deadlock analysis while preserving the essential structural characteristics of the original deadlock set. These critical deadlocks are subsequently used as target deadlock patterns for Random Forest classification and recovery recommendation.
3.3. Random Forest Classification Performance
The Random Forest classifier was trained using reachable markings as input samples. Each marking was labeled as either a normal reachable marking or a deadlock marking according to the reachability analysis results. Because the original dataset was highly imbalanced, with 360 normal markings and only 4 deadlock markings, the minority deadlock class was balanced before model training.
The classification performance of the trained Random Forest model was evaluated using accuracy, precision, recall, and F1-score. The confusion matrix shows that the proposed classifier achieved strong performance, with an accuracy of 98.86%, precision of 94.12%, recall of 100.00%, and an F1-score of 96.97%.
The high recall indicates that the model correctly identified all deadlock markings in the testing dataset. This is particularly important for deadlock analysis because missing a deadlock state may lead to incorrect recovery decisions. The high precision and F1-score further demonstrate that the Random Forest classifier can effectively distinguish deadlock markings from normal reachable markings.
The classification performance of the Random Forest classifier was evaluated using accuracy, precision, recall, and F1-score. The performance metrics are summarized in Table 2.
Figure 5 shows the confusion matrix of the Random Forest classifier. The classifier correctly identified 71 normal markings and 16 deadlock markings, with only one normal marking misclassified as a deadlock. No deadlock marking was misclassified as a normal marking. Therefore, the recall value reached 100.00%, indicating that all deadlock markings in the testing set were correctly detected. This result is particularly important for deadlock analysis because missing a deadlock state may lead to ineffective or delayed recovery actions. The high F1-score further confirms that the proposed classifier achieves a good balance between precision and recall.
3.4. Feature Importance Analysis
After model training, the feature importance values generated by the Random Forest classifier were used to evaluate the contribution of each Petri net place to deadlock classification. The feature importance ranking provides an interpretable basis for identifying the Petri net places that most strongly influence deadlock formation [23,24,25]. The resulting feature importance ranking is shown in Figure 6.
Figure 6 shows that the feature importance values are unevenly distributed across the Petri net places. Several places have significantly higher feature importance values than others, indicating they play a more influential role in distinguishing deadlock markings from normal reachable markings. Specifically, places , , , and show relatively high importance scores and are therefore considered critical places in the proposed RF-GCAM framework.
The feature importance results provide quantitative evidence for identifying critical resources in the S3PR Petri net model. Instead of relying only on structural Petri net analysis, the proposed method uses Random Forest feature importance to support interpretable decision-making in deadlock recovery.
3.5. Recovery Recommendation Results
Based on the representative critical deadlocks and the Random Forest feature importance ranking, recovery recommendations were generated for each critical deadlock. The nearest legal state search was used to identify feasible recovery directions, while the Random Forest feature importance values were used to determine the recovery priority of candidate Petri net places.
Table 3 summarizes the recovery recommendation results for the representative critical deadlocks. For CD1, place was recommended as the primary recovery place with a recovery score of 0.158. For CD2, place was recommended with a higher recovery score of 0.211.
Figure 7 visualizes the recovery recommendation scores for the selected recovery places. The higher recovery score of indicates its stronger contribution to recovery decision-making compared with . These results demonstrate that different critical deadlock patterns correspond to different recovery places and that the proposed RF-GCAM framework can generate deadlock-specific and interpretable recovery recommendations by combining nearest legal state search with Random Forest feature importance analysis.
These results indicate that the proposed RF-GCAM framework can transform Random Forest feature importance into practical recovery recommendations for representative critical deadlocks.
4. Discussion
The results show that the proposed RF-GCAM framework effectively integrates Petri net-based reachability analysis with Random Forest-based feature importance analysis to support critical deadlock discovery and recovery recommendations. Unlike conventional Petri net deadlock analysis methods that mainly focus on deadlock detection, prevention, or supervisor synthesis, the proposed method also provides an interpretable mechanism to identify representative critical deadlocks and recommend recovery places.
In the reachability analysis, the proposed S3PR Petri net model generated 364 reachable markings, of which 4 were deadlock states. The deadlock ratio was only 1.10%, indicating that deadlock states occupy a small portion of the overall reachable state space. However, even a small number of deadlock states may significantly affect the operation of flexible manufacturing systems because they can block production flow and reduce system availability. Therefore, identifying and handling critical deadlock states remains important for reliable system operation.
The representative critical deadlock discovery process reduced the number of analyzed deadlock patterns from 4 to 2 representative critical deadlocks. This reduction is meaningful because deadlock states with similar resource allocation structures may require similar recovery actions. By selecting representative critical deadlocks, the proposed framework reduces redundant analysis while preserving the essential structural characteristics of the deadlock set. This improves computational efficiency and simplifies subsequent recovery decision-making.
The Random Forest classifier achieved an accuracy of 98.86%, precision of 94.12%, recall of 100.00%, and F1-score of 96.97%. In particular, the recall value of 100.00% indicates that all deadlock markings in the testing set were correctly detected. This is an important result because failure to detect a deadlock state may lead to delayed or ineffective recovery actions. The high F1-score further confirms that the proposed classifier provides reliable classification performance under the balanced dataset condition.
Another important advantage of the proposed framework is its interpretability. The feature importance analysis showed that only several Petri net places contributed strongly to deadlock classification. In particular, places such as , , , and exhibited relatively high importance scores. These results indicate that deadlock formation is not uniformly influenced by all places in the Petri net model. Instead, a small number of structurally important places play dominant roles in distinguishing deadlock markings from normal reachable markings.
The recovery recommendation results further demonstrate the practical value of the proposed RF-GCAM framework. For CD1, the results recommended placing as the primary recovery place, whereas for CD2, they recommended placing . These results show that different representative critical deadlocks may correspond to different recovery places. Therefore, the proposed method can provide deadlock-specific recovery guidance rather than applying a fixed recovery rule to all deadlock states.
Compared with traditional Petri net-based deadlock prevention approaches, the proposed RF-GCAM framework does not rely solely on structural control policies or additional supervisor synthesis. Instead, it combines state-space information, representative deadlock discovery, machine learning classification, and feature importance ranking. Compared with recovery-oriented approaches based only on reachability graph analysis, the proposed method provides an additional interpretable ranking mechanism for selecting recovery places. This makes the recovery recommendation process more transparent and easier to interpret.
Nevertheless, this study has some limitations. The proposed framework was evaluated using a specific S3PR Petri net model with 19 places and 14 transitions. Although the results demonstrate the method’s feasibility, further validation on larger and more complex flexible manufacturing systems is needed. In addition, the current framework uses offline reachability graph generation, which may still face scalability issues when the state space grows significantly.
5. Conclusions
This study proposed a Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method (RF-GCAM) for flexible manufacturing systems modeled by S3PR Petri nets. The proposed framework integrates reachability graph generation, representative critical deadlock discovery, Random Forest-based deadlock classification, feature importance analysis, and recovery recommendation into a unified decision-support procedure.
The reachability analysis generated 364 reachable markings, among which 4 deadlock states were identified. Through representative critical deadlock discovery, 2 representative critical deadlocks were selected for subsequent analysis. This selection reduced redundant deadlock patterns while preserving the major structural characteristics required for recovery recommendation.
The Random Forest classifier achieved strong performance, with 98.86% accuracy, 94.12% precision, 100.00% recall, and a 96.97% F1-score. The recall of 100.00% indicates that the model correctly detected all deadlock markings in the test set, which is essential for reliable deadlock recovery in flexible manufacturing systems.
The feature importance analysis showed that only several Petri net places contributed strongly to deadlock classification. In particular, places such as , , , and exhibited relatively high importance scores. Based on the representative critical deadlocks and feature importance ranking, the proposed recovery mechanism recommended as the primary recovery place for CD1 and as the primary recovery place for CD2.
Overall, the proposed RF-GCAM framework provides an interpretable, data-driven approach to critical deadlock discovery and recovery recommendations. By combining Petri net reachability analysis with Random Forest feature importance, the method can support both accurate deadlock classification and explainable recovery decision making.
Author Contributions
Conceptualization, H.-T.W. and Y.-L.P.; methodology, H.-T.W. and Y.-L.P.; software, H.-T.W.; validation, S.-C.L., H.-Y.W. and C.-C.C.; formal analysis, H.-T.W.; investigation, H.-T.W. and C.-C.C.; resources, Y.-L.P. and S.-C.L.; data curation, H.-T.W.; writing—original draft preparation, H.-T.W.; writing—review and editing, S.-C.L., H.-Y.W., C.-C.C. and Y.-L.P.; visualization, H.-T.W.; supervision, Y.-L.P.; project administration, Y.-L.P. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
The data generated and analyzed in this study were obtained from the proposed S3PR Petri net model and MATLAB-based reachability graph simulation. The generated reachable markings, deadlock markings, Random Forest classification results, feature importance values, and recovery recommendation results are available from the corresponding author upon reasonable request.
Acknowledgments
During the preparation of this manuscript, the authors used ChatGPT (GPT-5.5) for assistance with English language refinement, manuscript structure, formatting suggestions, and improving figure/table descriptions. The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| FMS | Flexible Manufacturing System |
| RF | Random Forest |
| GCAM | Generating and Comparing Aiding Matrix |
| RF-GCAM | Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method |
| PN | Petri Net |
| S3PR | System of Simple Sequential Processes with Resources |
| RG | Reachability Graph |
| CD | Critical Deadlock |
| FI | Feature Importance |
| Pre | Backward incidence matrix |
| Post | Forward incidence matrix |
| Initial marking | |
| ML | Machine Learning |
References
- Viswanadham, N.; Narahari, Y.; Johnson, T. Stochastic modelling of flexible manufacturing systems. Math. Comput. Model. 1992, 16, 15–34. [Google Scholar] [CrossRef]
- Banaszak, Z. A.; Krogh, B. H. Deadlock avoidance in flexible manufacturing systems with concurrently competing process flows. IEEE Trans. Robot. Autom. 1990, 6, 724–34. [Google Scholar] [CrossRef]
- Venkatesh, K.; Zhou, M. Modeling, simulation, and control of flexible manufacturing systems: A petri net approach; World Scientific, 1999. [Google Scholar]
- Koren, Y. The global manufacturing revolution: Product-process-business integration and reconfigurable systems; John Wiley & Sons, 2010. [Google Scholar]
- Coffman, E. G.; Elphick, M.; Shoshani, A. System deadlocks. ACM Comput. Surv. (CSUR) 1971, 3, 67–78. [Google Scholar] [CrossRef]
- Commoner, F.; Holt, A. W.; Even, S.; Pnueli, A. Marked directed graphs. J. Comput. Syst. Sci. 1971, 5, 511–23. [Google Scholar] [CrossRef]
- Chu, F.; Xie, X.-L. Deadlock analysis of petri nets using siphons and mathematical programming. IEEE Trans. Robot. Autom. 1997, 13, 793–804. [Google Scholar] [CrossRef]
- Murata, T. Petri nets: Properties, analysis and applications. Proc. IEEE 1989, 77, 541–80. [Google Scholar] [CrossRef]
- David, R.; Alla, H. Timed continuous petri nets. In Discrete, continuous, and hybrid petri nets; Springer, 2010; pp. 159–229. [Google Scholar]
- Peterson, J. L. Petri net theory and the modeling of systems; Prentice Hall PTR, 1981. [Google Scholar]
- Zhou, M.; DiCesare, F. Petri net synthesis for discrete event control of manufacturing systems; Springer Science & Business Media, 2012. [Google Scholar]
- Giua, A. Deadlock resolution in automated manufacturing systems–a novel petri net approach, by zw li, and mc zhou; Taylor & Francis, 2010. [Google Scholar]
- Reveliotis, S. A. Real-time management of resource allocations systems: A discrete event systems approach; Springer, 2005. [Google Scholar]
- Ezpeleta, J.; Colom, J. M.; Martinez, J. A petri net based deadlock prevention policy for flexible manufacturing systems. IEEE Trans. Robot. Autom. 2002, 11, 173–84. [Google Scholar]
- Huang, Y.-S.; Jeng, M.; Xie, X.; Chung, D.-H. Siphon-based deadlock prevention policy for flexible manufacturing systems. IEEE Trans. Syst. Man. Cybern.-Part A Syst. Hum. 2006, 36, 1248–56. [Google Scholar] [CrossRef]
- Uzam, M.; Zhou, M. An iterative synthesis approach to petri net-based deadlock prevention policy for flexible manufacturing systems. IEEE Trans. Syst. Man. Cybern.-Part A Syst. Hum. 2007, 37, 362–71. [Google Scholar] [CrossRef]
- Huang, Y.-S. Design of deadlock prevention supervisors using petri nets. Int. J. Adv. Manuf. Technol. 2007, 35, 349–62. [Google Scholar] [CrossRef]
- Pan, Y.-L.; Tseng, C.-Y.; Chen, J.-C. Enhancement of computational efficiency for deadlock recovery of flexible manufacturing systems using improved generating and comparing aiding matrix algorithms. Processes 2023, 11, 3026. [Google Scholar] [CrossRef]
- Tseng, C.-Y.; Chen, J.-C.; Pan, Y.-L. An improved deadlock recovery policy of flexible manufacturing systems based on resource flow graphs. IEEE Access 2024, 12, 65202–12. [Google Scholar] [CrossRef]
- Kusiak, A. Smart manufacturing. Int. J. Prod. Res. 2018, 56, 508–17. [Google Scholar] [CrossRef]
- Wang, J.; Ma, Y.; Zhang, L.; Gao, R. X.; Wu, D. Deep learning for smart manufacturing: Methods and applications. J. Manuf. Syst. 2018, 48, 144–56. [Google Scholar] [CrossRef]
- Tao, F.; Qi, Q.; Liu, A.; Kusiak, A. Data-driven smart manufacturing. J. Manuf. Syst. 2018, 48, 157–69. [Google Scholar] [CrossRef]
- Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Lundberg, S. M.; Lee, S.-I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 2017, 30. [Google Scholar]
- Molnar, C. Interpretable machine learning. In Lulu. com; 2020. [Google Scholar]
Figure 1.
Overall workflow of the proposed Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method (RF-GCAM).
Figure 1.
Overall workflow of the proposed Random Forest-Assisted Critical Deadlock Discovery and Recovery Recommendation Method (RF-GCAM).

Figure 2.
S3PR Petri net model of the investigated flexible manufacturing system.

Figure 3.
Statistics of the generated reachability graph, including reachable markings, deadlock states, and representative critical deadlocks.
Figure 3.
Statistics of the generated reachability graph, including reachable markings, deadlock states, and representative critical deadlocks.

Figure 4.
Pairwise Euclidean distance matrix used for representative critical deadlock discovery.

Figure 5.
Confusion matrix and classification performance of the Random Forest classifier.

Figure 6.
Feature importance ranking of Petri net places obtained by the Random Forest classifier.

Figure 7.
Recovery recommendation scores for representative critical deadlocks based on Random Forest feature importance.
Figure 7.
Recovery recommendation scores for representative critical deadlocks based on Random Forest feature importance.

Table 1.
Summary of reachability analysis results.
| Item | Value |
|---|---|
| Reachable markings | 364 |
| Normal markings | 360 |
| Deadlock markings | 4 |
| Representative critical deadlocks | 2 |
| Deadlock ratio | 1.10% |
Table 2.
Random Forest classification performance.
| Metric | Value |
|---|---|
| Accuracy | 98.86% |
| Precision | 94.12% |
| Recall | 100.00% |
| F1-score | 96.97% |
Table 3.
Recovery recommendation results for representative critical deadlocks.
| Critical deadlock | Recommended place | Recovery score |
|---|---|---|
| CD1 | 0.158 | |
| CD2 | 0.211 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.