Enhancement of Computational E ﬃ ciency in Seeking Liveness-Enforcing Supervisors for Advanced Flexible Manufacturing Systems with Deadlock States

Featured Application: In the paper, we further propose two novel concepts called Pre Idle Transitions (PIT) and Pre Idle Places (PIP) for the IMFFP-2. Once PIT or PIP is identiﬁed from a deadlock Petri nets model, one can bypass all PIP under the process of solving MFFP, and the computational time can hence be shortened. Abstract: In industry 4.0, all kinds of intelligent workstations are designed for use in manufacturing industries. Among them, ﬂexible manufacturing systems (FMSs) use smart robots to achieve their production capacity under the condition of a high degree of resources sharing. As a result, deadlock states usually appear unexpectedly. For solving the damage deadlock problem, many pioneers have proposed new policies. However, it is very di ﬃ cult to make systems maximally permissive even if their policies can solve the deadlock problem of FMSs. According to our survey, the Maximal number of Forbidding First Bad Marking (FBM) Problems (MFFP) seems to be the best technology to obtain systems’ maximally permissive states in the existing literature. More importantly, the number of added control places (CP) is the smallest among the existing research works. However, when the complexity of a ﬂexible manufacturing system increases, the computational burden rises rapidly. To reduce computational cost, we deﬁne a new concept named Pre Idle Places (PIP) to enhance the computational e ﬃ ciency in Seeking Liveness-Enforcing Supervisors. We can bypass all PIP once they can be identiﬁed from a deadlock system under the process of solving MFFP. According to the data showed in three classical examples, our proposed Improved MFFP is better than conventional MFFP in terms of computational e ﬃ ciency with the same controllers.

Generally, three kinds of technologies are proposed to solve the deadlock problems of FMSs: deadlock avoidance, deadlock detection and recovery, and deadlock prevention [7]. Firstly, deadlock avoidance is adopted to prevent an FMS from reaching any deadlock state. Although it has a higher efficiency, it always fails to eliminate all deadlock states. The deadlock detection and recovery approach allows existing deadlock states to be reachable. Once deadlock occurs, the system detects and reallocates resources for recovery. Finally, deadlock prevention is proposed to prevent a deadlock situation from being reached. It is important to note that deadlock prevention does not need any run-time cost, since it solves the deadlock of FMSs in the design and planning stages.
In the deadlock prevention domain, two main analysis methods are designed to solve FMS deadlock problems: structural and reachability graph analysis, respectively. The former utilizes some structural items, such as all kinds of siphons [6,13,14,[17][18][19][20][21][22][23][24][25][26][27]. Some generated siphons are found in uncontrolled models, which may become unmarked or partially marked. A siphon denotes a general set of places. In the case of a deadlock, the siphon cannot regain any new marking from the original ones, i.e., all transitions in this model are disabled, and a deadlock is recognized. To prevent a deadlock state from being reached, no places in these siphons may be empty. The objective is reached by designing and adding a control subnet to the model with its initial marking. Huang et al. [13] develop a formalized and iterative approach with two main stages. These two stages are required in each iteration in order to create new siphons after attaching them to the FMS model. Li and Zhou [18] propose a method with a much smaller control subnet than in previous works, with the same results. Huang et al. [14] introduce an iterative method, adopting two kinds of control places: ordinary and weighted control places. They attempt to prevent siphons from losing their tokens and guarantee more permissive systems. However, structural analysis seems suboptimal and leads to low utilization rates of system resources, although it does lower computational cost.
Reachability graph analysis [28][29][30][31][32][33][34][35][36][37] requires the enumeration of all generated markings. The set of these markings is hence referred to as the reachability graph (RG). The RG includes all reachable markings, which can be classified as one of two parts: the live zone (LZ) and deadlock zone (DZ). The DZ contains deadlock markings and critical bad markings, which inevitably lead to deadlock zones. The LZ contains all live markings and is also recognized as a deadlock-free-zone (DFZ). The objective is to forbid all markings in the DZ and to make sure all markings in the LZ are still reachable. According to the characteristics of RG and system complexity, marking explosion problems may occur during the computation of reachability graph analysis, implying that the increase of FMS model size leads to a corresponding increase in computational cost. Uzam [28] develops a deadlock prevention policy based on a theory of regions that proves maximal liveness performance. However, the policy fails to determine all sets of event-state separation problems (ESSPs), and its application seems limited to certain special nets only. Therefore, some works [34][35][36][37] aim to develop a more computationally efficient optimal deadlock control policy based on the theory of regions. Uzam and Zhou [5] propose a reduction technique to simplify large FMS models. To reduce computation, first-met bad markings (FBMs) are adopted in these works. FBMs are the set of markings in the DZ and the first entrance from the LZ to the DZ. However, as indicated by [38], this process requires the repeated calculation of reachability graphs.
Pirrodi et al. [39] consider selective siphons to reduce redundancy problems and provide small-size controllers. The control policy solves the deadlock problems of FMSs successfully. It also makes FMSs optimal. However, as indicated by [40], the process of eliminating all critical markings is time-consuming, since all legal markings must be checked in each iterative step. According to the above descriptions, it is clear that determining how to obtain optimal (maximally permissive) controllers for solving the FMS deadlock problem seems an extremely time-consuming and difficult issue. Therefore, in [33] Pan et al. also propose a policy called the enhancement of selective siphon control method to improve the efficiency of deadlock prevention in FMSs.
For improving the above disadvantage, Chen et al. [1] brought forward a new concept named MFFP (i.e., the Maximal number of Forbidding First Bad Marking (FBM) Problems) to obtain maximally permissive reachable markings with a much smaller number of controllers based on the reachability graph analysis method and Place Invariant (PI) [41]. It successfully solves the problem of the excessive consumption of time. However, when the complexity of a flexible manufacturing system increases, the computational burden rises rapidly. Besides, in our survey the MFFP could only be applied in certain special nets, and outside S 3 PR [6], the method would fail. Therefore, in our previous paper [42], we proposed an iterative method called IMFFP-1 to solve the disadvantage of [1] so that it can be used in all general cases whether the controlled net is optimal or suboptimal. Subsequently, for reducing computational time, in [43] we proposed two novel concepts called Pre Idle Transitions (PIT) and Pre Idle Places (PIP). However, the proposed definitions seemed rough and immature. Therefore, in this paper, we aim to redefine and give the formal definitions of PIT and PIP. Please note that we can bypass all PIP once they can be identified from a deadlock flexible manufacturing system under the process of solving MFFP. From the resulting data based on three classical examples, the further improved MFFP (called IMFFP-2) method seems to achieve a better computational efficiency with the same controllers. Please note that in this paper we focus on enhancement of computational efficiency for the conventional MFFP. Therefore, in this paper we consider the same kind of Petri Net (PN) class as that in [1,2]. On the other hand, some deadlock preventions that can recover all reachable markings using transition-based controllers [44][45][46][47][48][49] and inhibitor arcs [50] are also proposed. In the future, we will follow the work in [51] to discuss a divide-and-conquer-method and try to enhance their computational efficiency. Section 2 gives a description of the basic definitions and properties of PNs. Section 3 presents the proposed policy. Section 4 shows examples and related experimental data. Section 5 makes comparisons with the existing literature. Finally, conclusions are drawn in Section 6.

Petri Nets (PNs)
A Petri Net [52], also called a Place/Transition Net, is a four-tuple N = (P, T, F, W). Both P and T are non-empty sets. Generally, P is a finite set of places, and T is a finite set of transitions, disjointed to each other. The set F ⊆ (P × T) ∪ (T × P) is the arcs of this net, which is represented by one-way arrows from its nodes to denote a flow relation in a PN model. The mapping W : (T × P) ∪ (P × T) → N assigns a weight to an arc: W(x, y) > 0 if (x, y) ∈ F, and W(x, y) = 0 otherwise; where x, y ∈ P ∪ T and N is the set of non-negative integers. We call x • = y ∈ P ∪ T |(x, y) ∈ F the postset of x, and • x = y ∈ P ∪ T |(y, x) ∈ F is called the preset of x. A marking M is a multi-set of its places, which allocates tokens to each place of PNM. We denote M(p) as the number of tokens in place p. The pair (N, M 0 ) is called a marked Petri net or a net system. A net is pure if ∀(x, y) ∈ (P × T) ∪ (T × P), W(x, y) > 0, implying that W(y, x) = 0. The incidence matrix [N] of the pure net N is a |P| × |T| integer matrix with [N](p, t) = W(t, p) − W(p, t).
A transition t ∈ T is enabled at marking M if ∀p ∈ • t, M(p) ≥ W(p, t), which is denoted as Let (N, M 0 ) be a net system with N = (P, T, F, W ).
A P-vector is a column vector I : P → Z indexed by P. P-vector I is called a P-invariant (place invariant, PI for short) if I 0 and I T [N] = 0 T . P-invariant I is said to be a P-semiflow if I ≥ 0. Let I be a PI of (N, M 0 ) and M be a reachable marking from M 0 . Then, I T M = I T M 0 .

Identify All FBMs
In the Reachability Graph (RG) method, all reachable markings in the initial reachability graph analysis can be divided into two main groups: illegal and legal markings [35]. Illegal markings include deadlock and quasi-deadlock markings. The set of deadlock markings M D is defined as follows: Definition 1 [35]. The set of deadlock markings M D = {M∈ R(N, M 0 )| at M; no transition can be enabled}.
The quasi-deadlock markings are defined as follows: Definition 2 [35]. The set of quasi-deadlock markings M Q = {M∈R(N, M 0 )| M must eventually evolve into a dead one regardless of transition firing sequences}.
The reachable markings, not including quasi-deadlock and deadlock markings, are called legal markings. The set of legal markings M L is the maximal number of reachable markings of a system, from which the initial marking M 0 is reachable without leaving M L . Further, the set of legal markings M L can be defined as follows: The M D ∩ M Q of Definition 3 signifies the set of illegal markings. Therefore, the set of illegal markings M I can be defined as: Definition 4 means that all dead and quasi-dead markings can also be viewed as the set of illegal markings. Further, M I can be reached directly from any legal marking in an RG of a PNM. Please note that the first-met illegal marking is the same as the first-met bad marking (FBM) [1]. In our opinion, the first-met illegal marking (FIM) seems to be superior to the FBM. Therefore, the definition of first-met illegal marking (FIM) is presented formally as follows: According to an example, one can understand the M FIM easily. Referring to Figure 1, the PNM has two idle places (i.e., p 1 and p 8 , both with three tokens in them), six operation places (p 2~p6 ), and three resource places (p 9~p11 , all with one token in them). Figure 2 is its reachability graph. In Figure 2 In the following section, an improved deadlock prevention policy with an enhancement of computational efficiency is proposed. In this deadlock policy, just a few FBMs need to be identified. Once the few FBMs in the reachability graph are forbidden, the system is deadlock-free. In other words, under the same number of controllers, the efficiency of our algorithm is better than the MFFP method [1]. The detailed information of the proposed policy is presented as follows.

Improved Policy with Enhancement of Computational Efficiency
In this section, we will present our improved policy and further try to redefine and give the formal definitions of PIT, PIP and Crucial Vector Covering Approach for enhancing the computational efficiency of the conventional MFFP. [5,8] According to the definitions in [5,8], three types of places are given for FBM based on PN theory, including Idle places , Resource places , and Activity places , respectively. The initial marking of a reachability graph of a PNM is denoted as . The activity places must be considered among all kinds of places in using the PI concept [41].

Finding controllers from Place Invariant (PI) concept
Therefore, the PI concept is the most important factor and will help in designing maximally permissive controllers in this section. In [3], Yamalidou et al. first proposed the PI concept as follows:

Improved Policy with Enhancement of Computational Efficiency
In this section, we will present our improved policy and further try to redefine and give the formal definitions of PIT, PIP and Crucial Vector Covering Approach for enhancing the computational efficiency of the conventional MFFP. [5,8] According to the definitions in [5,8], three types of places are given for FBM based on PN theory, including Idle places , Resource places , and Activity places , respectively. The initial marking of a reachability graph of a PNM is denoted as . The activity places must be considered among all kinds of places in using the PI concept [41].

Finding controllers from Place Invariant (PI) concept
Therefore, the PI concept is the most important factor and will help in designing maximally permissive controllers in this section. In [3], Yamalidou et al. first proposed the PI concept as follows:

Improved Policy with Enhancement of Computational Efficiency
In this section, we will present our improved policy and further try to redefine and give the formal definitions of PIT, PIP and Crucial Vector Covering Approach for enhancing the computational efficiency of the conventional MFFP.

Finding Controllers from Place Invariant (PI) Concept
According to the definitions in [5,8], three types of places are given for FBM based on PN theory, including Idle places P 0 , Resource places P R , and Activity places P A , respectively. The initial marking of a reachability graph of a PNM is denoted as M 0 . The activity places must be considered among all kinds of places in using the PI concept [41]. Therefore, the PI concept is the most important factor and will help in designing maximally permissive controllers in this section. In [3], Yamalidou et al. first proposed the PI concept as follows: where both β and l i are non-negative integers, and µ i denotes the number of tokens in place p i . Furthermore, for calculating the controllers of a system, more non-negative integers µ s are given and the new equality is as follows: By using Equation (2) every time, one can obtain control places so that some illegal markings can be removed until the FMS becomes deadlock-free. However, it could simultaneously eliminate some legal markings. Therefore, Chen et al. [1,11] propose a novel concept called MFFP to improve the above PI control method to hold the maximally permissive live legal markings.

MFFP
By identifying a few useful FBMs based on conventional PI control concepts, Chen et al. [1,11] proposed a novel PI control method, MFFP, to identify all maximally permissive controllers (i.e., control places). Accordingly, there are two kinds of algorithms based on the MFFP presented in their papers [1,11]. However, according to our study, the two algorithms seem logically identical. Therefore, in this paper, we select the first type of MFFP algorithm as the object to improve and enhance its computational efficiency. In this paper, we still call the two kinds of algorithms MFFP.
In [1], for obtaining maximally permissive PI controllers, there are two constraints used to design the Integer Linear Programming Problem (ILPP). In other words, once the optimal PI controllers are added into the original system, all FBMs can then be excluded from all legal markings. This system becomes live and keeps the maximally permissive (or optimal) markings since just FBMs are forbidden. In addition, only activity places need to be considered since the ILPP belongs to PI control. Therefore, based on Equation (1), a set N A = i p i ∈ P A is further used to redefine Equation (1) as follows.
In Equation (3), it is considered that each FIM can be forbidden by every relative controller added to the deadlock system. µ i can be replaced by M(p i ), and variable β can be redefined in Equation (4): Following Equation (4), variable β must smaller than n i∈N A l i ·M(p i ) since β = n i∈N A l i ·M(p i ) − 1 is true. Accordingly, one new constraint can be given as follows: On the other hand, for holding all legal markings, the calculation is as follows: By using Equations (5) and (6), the optimal PI controller developed by Chen et al. [1,12] can then be obtained.

Crucial Vector Covering Approach
Under the process of calculating all PI controllers, the computational cost is very high if all the reachable markings need to be considered. Computational cost and computer time could be reduced once crucial legal markings and FBMs can be identified. Based on the above reason, a Crucial Vector Covering Approach (CVCA) is proposed and defined in this subsection. Firstly, the conventional Vector Covering Approach (VCA) is introduced as follows: Theorem 1 [1]. Let M a and M b be any two markings in R(N, M 0 ) with M a ≥ M b . If M b is forbidden by one PI, M a will be also forbidden. On the contrary, if M a is not forbidden by a PI, M b will not be forbidden either.
Please note that Definition 6 seems imprecise according to our experimental results. For example (please refer to Figure 2), M 5 (p 2 + p 4 ) and M 19 (p 5 + p 6 + p 7 ) are any two markings, with M 5 (p) = 2 and M 19 (p) = 3, respectively. For comparison, the detailed information of all reachable markings in Figure 2 is presented in Table 1.  We also provide an example so that the readers can follow (please also refer to Figures 1 and 2). The markings M 6 and M 7 are any two markings in the reachability graph of Figure 1. Further, their properties are M 6 = p 3 , p 4 and M 7 = p 2 , p 3 , p 4 , respectively. The number of idle places in M 6 (p) is equal to 2 and M 7 (p) is equal to 3. Then, M 7 (p) ≥ M 6 (p). It is worth noting that M 7 ⊇ M 6 since p 2 + p 3 + p 4 ⊇ p 3 + p 4 and (M 7 ∩ M 6 ) = M 6 . Surely, M 7 (p) ≥ M 6 (p). We check if Definition 7 fits Theorem 1 by using M 7 (p) ≥ M 6 (p). It is obvious that once M 6 is forbidden, M 7 is forbidden. Theorem 1 is proved. In the following, the concept of a minimal covered set of FBMs is presented. In [2], Chen et al. use it to improve the conventional PI control method and determine the maximally permissive controllers. Therefore, we show its definition first. Please note that in this paper, we propose Pre Idle Places (PIP) so that the computational efficiency can then be enhanced further. First, we revise Definition 6 as follows: According to Definitions 8 and 9, if all M FIM are forbidden but all M L are not, the system will reach optimal control.

Pre Idle Places (PIP)
Based on Part A in Section 3, all places in a PNM can be divided into three groups: P 0 (idle places), P A (operation places) and P R (resource places), and just the P A is needed to identify Pre Idle Places (PIP). To reduce the computational cost of conventional MFFP, in this paper the authors give two definitions: Pre Idle Transitions (PIT, T PIT ) and Pre Idle Places (PIP, P PIP ). Once any PIP is found and identified in a PN model, the computational time of the MFFP deadlock prevention policy can then be reduced. In other words, the MFFP's computational efficiency can be enhanced further.

Definition 10. Let all pre idle transitions be denoted as T PIT
Definition 11. Let pre idle places be denoted as P PIP = {p ∈ P A , p • ∈ T PIT }.
According to Definitions 10 and 11, one can make sure that a PNM has { T PIT , P PIP } or not. For example, in Figure 1, the PNM has { T PIT , P PIP } in it. The detailed information is T PIT = {t 4 , t 8 } and P PIP = p 4 , p 7 . Therefore, when the MFFP deadlock prevention policy is used to solve Integer Linear Programming Problems (ILPP), just four idle places p 2 , p 3 , p 5 , p 6 } (i.e., 6 (total idle places) -2 (P PIP ) = 4) need to be considered. Please note that there are six idle places in total that need to be considered under the conventional MFFP deadlock prevention.

The Proposed Improved MFFP-2 (IMFFP-2)
This section presents the full Improved MFFP-2 (IMFFP-2) based on the definitions in Section 3. By using constraints (5) and (6), one can hold all legal markings and forbid all illegal markings. IMFFP: Q is a huge positive integer constant. Under the improved MFFP-2 (IMFFP-2), M FBM and M L are also listed to determine all constraints and to obtain the system's maximally permissive controllers. Only one set of controllers is processed by every iteration of IMFFP-2. Please note that not all controllers can be obtained just through one iteration.
According to our proposed algorithm in Section 3, T PIT and P PIP must be identified first. The computational efficiency of the conventional MFFP can then be further enhanced, based on Definitions 5 and 6, and the T PIT = {t 4 , t 8 } and P PIP = p 4 , p 7 in Example 1.
Note that in fact the above two sets of controllers are the same since they can both make the system maximally permissive. Accordingly, one can just pick one set of controllers to process. For showing the two controllers are the same and the difference between this paper and [1], a second set of controllers is chosen by this paper. The second iteration is as follows.
The second iteration in the Improved MFFP-2: By running the above IMFFP-2 again, one new controller is obtained such that l 3 = 1, l 5 = 1, β = 1, and f 1 = 1. Therefore, two PI controllers, pc 1 : 2µ 2 + µ 5 + µ 6 ≤ 4 and pc 2 : µ 3 + µ 5 ≤ 1, are obtained. By putting the two control places into the original model (please refer to Figure 3), all 8 First Bad Markings are controlled while all 36 legal reachable markings are held. In other words, the PNM is not only live but also maximally permissive. Figures 5 and 6 show the controlled system and its reachability graph, respectively.

Additional
C p i M 0 (C p i ) ·(C p i ) (C p i )· C p 1 14 3t 5 , 5t 6 , t 12 , 7t 13 4t 1 , 4t 2 , t 4 , t 9 , 7t 11 C p 2 9 2t 7 , 3t 11 t 1 , t 2 , t 4 , 3t 9 The third PN model taken from [6] is presented in Figure 9. Due to the limitation of space in this paper, the detailed information concerning the process of seeking controllers is not presented here. According to the definitions in this paper, there are 16 activity places that need to be calculated in MFFP. However, there are just 13 activity places that need to be calculated in IMFFP-2, since three PIPs (i.e., p 4 , p 10 , and p 19 ) can be identified in Example 3.

Comparison
In this section, we make a comparison with the conventional MFFP [1,2] in terms of the computational efficiency by comparing (1) system complexity and (2) time complexity. Here, |P A | MFFP represents the number of activity places needed by the MFFP method , |P PIP | represents the number of P PIP identified in one PN-based system, and |P A | IMFFP represents the number of activity places needed by the IMFFP-2 method. Further, O(n?) MFFP and O(n?) IMFFP represent time complexity under MFFP and IMFFP-2, respectively. Firstly, based on Table 7 one can realize that there are 6, 11, and 16 variables (i.e., activity places) in Examples 1, 2, and 3, respectively, that need to be considered under the conventional MFFP control policy. However, there are just 4, 9, and 12 variables to consider since there are 2, 2, and 4 P PIP identified in Examples 1, 2, and 3, respectively, under IMFFP-2. Firstly, from the viewpoint of system complexity, the computational efficiency of IMFFP-2 must be better than conventional MFFP since the number of variables of IMFFP-2 is much less than in the conventional MFFP method. On the other hand, according to the book Introduction to the theory of computation (second edition) [55] and Wikipedia [56], the definition of time complexity for computer science is as follows: the time complexity of an algorithm can be expressed commonly by using big O notation "O", which excludes coefficients and lower-order terms. When expressed this way, time complexity is said to be described asymptotically, i.e., as the input size goes to infinity. For instance, if the time required by an algorithm on all inputs of size n is at most 6n 3 + 2n 2 + 20n + 45 for any n (n is a variable), then obviously, there are four terms in total and the highest order term is 6n 3 . Thus, the asymptotic time complexity is O(n 3 ). Therefore, the time complexity of Chen's MFFP method in Example 1 could be viewed as O(n 6 ). The time complexity of our IMFFP-2 is viewed as O(n 4 ) based on Table 7. Similarly, the time complexity of Chen's MFFP method in Example 2 is viewed as O(n 11 ), and our IMFFP-2 is O(n 9 ); the time complexity of Chen's MFFP method in Example 3 is O(n 16 ), and our IMFFP-2 is O(n 13 ). Accordingly, in Examples 1 and 2, the computational efficiency of the proposed IMFFP-2 is 100 times better than that of the conventional MFFP control policy. In addition, in Example 3, the computational efficiency of the proposed IMFFP-2 is 1000 times better than that of the conventional MFFP method.

Conclusions
Solving flexible manufacturing systems' deadlock problems is extremely difficult work. Just a few excellent mathematicians or researchers can work in this field. For decades, these outstanding pioneers have concentrated their efforts into proposing various algorithms to solve the deadlock problems of flexible manufacturing systems. In the authors' previous study, the conventional MFFP method proposed by Chen et al. [1] seemed to be the best one (i.e., least control places and relative arcs) among all control place-based deadlock prevention policies in the existing literature. The greatest advantage of conventional MFFP is that just a few controllers are needed to hold the maximally permissive states in solving deadlock problems. In fact, the method could become better if (1) it could be applied for all kinds of nets not just for certain special nets or (2) we could further enhance its computational efficiency. Based on the above reason, firstly, in our previous paper we proposed an improved iteration method called IMFFP-1 [42] so that it could be used for all Petri nets' general systems.
In the present paper, we further propose two novel concepts, namely, PIT and PIP, for the IMFFP-2. Once PIT or PIP is identified from a deadlock Petri nets model, one can bypass all PIP under the process of solving MFFP, and the computational time can hence be shortened. Undoubtedly, computational cost can then be decreased. Three examples prove that the IMFFP-2 is more efficient than the conventional MFFP in obtaining the same maximally permissive control places. Finally, and most importantly, in this paper, we redefine the conventional vector covering approach technology, named the improved vector covering approach technology (IVCAT), so that the definition can be solidified. We also identify the correct solution in the second example of Chen's paper [1] so that all readers and researchers can easily follow Chen's paper. In summary, the IMFFP-1 makes the conventional MFFP able to be used in all kinds of nets, and IMFFP-2 enhances the computational efficiency. In the future, we will further merge IMFFP-1 and IMFFP-2 so that it can be used for all kinds of PN-based FMSs and still have very great computational efficiency.