74
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
Resource-Transition Circuits and Siphons for Deadlock Control of Automated Manufacturing Systems Keyi Xing, MengChu Zhou, Fellow, IEEE, Feng Wang, Huixia Liu, and Feng Tian
Abstract—The resource-transition circuit (RTC) and siphon are two different structural objects of Petri nets and used to develop deadlock control policies for automated manufacturing systems. They are related to the liveness property of Petri net models and thus used to characterize and avoid deadlocks. Based on them, there are two kinds of methods for developing deadlock controllers. Such methods rely on the computation of all maximal perfect RTCs and strict minimal siphons (SMSs), respectively. This paper concentrates on a class of Petri nets called a system of simple sequential processes with resources, establishes the relation between two kinds of control methods, and identifies maximal perfect RTCs and SMSs. A graph-based technique is used to find all elementary RTC structures. They are then used to derive all RTCs. Next, an iterative method is developed to recursively construct all maximal perfect RTCs from elementary ones. Finally, a one-to-one correspondence between SMSs and maximal perfect RTCs and, hence, an equivalence between two deadlock control methods are established. Index Terms—Automated manufacturing system (AMS), controller, deadlock, discrete event systems, Petri net, resourcetransition circuit (RTC), siphon.
I. I NTRODUCTION
A
N AUTOMATED manufacturing system (AMS) is a computer-controlled manufacturing system that consists of a set of workstations, each one capable of processing different kinds of parts according to a prescribed sequence of operations. In such a system, the competition for finite shared resources by concurrent processes of various parts can lead to deadlock conditions. Deadlock is a phenomenon in which a system or a part of it remains indefinitely blocked and cannot terminate its intended tasks. Thus, to effectively operate an AMS and meet its production objective, it is necessary to coordinate shared resources to ensure that deadlock never occurs.
Manuscript received June 8, 2009; revised December 4, 2009; accepted February 23, 2010. Date of publication June 21, 2010; date of current version November 10, 2010. This work was supported in part by the National Natural Science Foundation of China under Grants 60774083, 50975224, and 60773001, and the National High Technology Research and Development (863) Program of China under Grant 2008AA04Z109. This paper was recommended by Associate Editor M. P. Fanti. K. Xing, F. Wang, H. Liu, and F. Tian are with the State Key Laboratory for Manufacturing Systems Engineering and Systems Engineering Institute, Xi’an Jiaotong University, Xi’an 710049, China (e-mail:
[email protected]). M. C. Zhou is with the Department of Electrical and Computer Engineering, New Jersey Institute of Technology, Newark, NJ 07102 USA and also with School of Electro-Mechanical Engineering, Xidian University, Xi’an, 710071, China. Digital Object Identifier 10.1109/TSMCA.2010.2048898
The development of efficient deadlock control policies for AMSs has received significant attention for over a decade because an AMS controller that allocates resources in real time without causing deadlock plays a crucial role in ensuring its high efficiency and resource utilization [2], [4], [7]–[10], [12], [18]–[24], [26]–[28], [30]–[45]. However, the computation of the optimal or maximally permissive deadlock control policy for a general AMS is NP-hard since it involves the problem of determining the safety of a given resource allocation state or enumerating all deadlock structures in the systems, which is NP-hard [1], [11], [28]. Many researchers use Petri nets as a formalism to describe AMSs and develop appropriate deadlock resolution methods. In the context of Petri nets, the use of two different structural objects yields two kinds of deadlock control policies. One relies on the siphons and another on resource-transition circuits (RTCs). Both are structural objects related to the liveness of Petri net models and can be used to characterize and prevent/ avoid deadlocks. Siphon-based methods for avoiding deadlocks are to add new places and related arcs for some siphons such that they contain tokens all the time [4], [7], [12], [21], [23], [26], [31]. Here, a siphon is a place set whose input transition set is included in its output one. The presence of unmarked siphons, i.e., those containing no token, is a direct cause of deadlocks. A siphon is said to be minimal if it does not contain other siphons. A Petri net model of AMSs is deadlock-free if no siphon eventually becomes empty. The deadlock control policy determines the set of minimal siphons that can be emptied, called strict minimal siphons (SMSs), and introduces additional places, called control places, to the initial Petri net model, which constrain the behavior of the net. The number of such siphons exponentially grows in the worst case with respect to the model size. Most of siphon-based deadlock control policies need to compute all SMSs and are hence NP-hard. Places in a process-oriented Petri net model of an AMS are classified into process-idle, operation, and resource places [13]. An RTC in a Petri net model is a circuit that contains only resource places and transitions. Deadlocks are linked to particular RTCs, called maximal perfect RTCs (MPCs) [41]–[44]. Deadlock is characterized as an MPC that is saturated at a reachable state, i.e., all tokens in its resource places go to their related operation ones. An MPC-based method for synthesizing deadlock-avoidance Petri net controllers is to add a control place and related arcs to MPCs such that no MPCs can reach
1083-4427/$26.00 © 2010 IEEE
XING et al.: RESOURCE-TRANSITION CIRCUITS AND SIPHONS FOR DEADLOCK CONTROL
saturated states. In the context of Petri net models, to the best of our knowledge, based only on MPCs, optimal deadlock Petri net controllers can directly be obtained [40]–[44]. Hence, the computation and enumeration of MPCs are needed to obtain optimal deadlock control policies. This paper develops two novel methods to find all MPCs. On the basis of graph-theoretic approaches, Fanti et al. present algorithms for deadlock detection and avoidance [8], [9]. The necessary and sufficient condition of deadlock in systems is the existence of a cycle in the transition digraph. Lawley et al. use a digraph named resource allocation graph to detect deadlock [18]–[20]. A production process circuit is used to model deadlock [31]–[39]. Cycles in transition digraphs, resource allocation graphs, and production process circuits are similar to RTCs. Deadlock-avoidance methods based on siphons or MPCs rely on their identification. Since the numbers of siphons and MPCs are exponential with the size of the system, their determination can be very time consuming. Many different methods have been developed for siphons [3], [5], [6], [14], [15], [17], [29], [47], while none exists for MPCs. This paper focuses on a particular class of AMSs, which can be modeled by means of systems of simple sequential processes with resources (S3 PRs). First, a graph-based technique is developed to solve the MPC enumeration problem. A well-known method for elementary circuit computation developed by Johnson [16] is adopted to find all elementary RTC structures. An MPC can be expressed as the union of some elementary RTCs. Hence, an iterative method is developed to recursively construct all MPCs from the already-found elementary RTCs. Then, this paper establishes the one-to-one correspondence between SMSs and MPCs in S3 PRs and presents simple mappings between MPCs and SMSs. Hence, new algorithms to compute SMSs from MPCs and MPCs from SMSs are obtained. Based on SMSs and MPCs, two kinds of methods to characterize and prevent/avoid deadlocks are found in the literature. Having conclusively established the one-to-one correspondence relation between SMSs and MPCs allows us to finally establish the equivalence between SMS- and MPC-based deadlock characterization and control theories. This paper is organized as follows. Section II reviews basic definitions of Petri nets and S3 PRs used throughout this paper. In Section III, the structure and properties of MPCs and some useful results on siphons and MPCs are introduced. The MPC enumeration algorithm and its complexity are presented in Section IV. An example is provided to illustrate the presented concepts and MPC enumeration algorithm. In Section V, the one-to-one correspondence between SMSs and MPCs is established. Based on this relation, new enumeration algorithms are obtained. Section VI compares two kinds of deadlock characterizations and controllers based on SMSs and MPCs, respectively. Section VII concludes this paper. II. P RELIMINARIES AND THE S3 PR C LASS First, this section presents the basics of Petri nets. More details can be found in [13], [25], and [48]. Then, S3 PR is reviewed. MPC and the related concepts are finally introduced.
75
A. Basic Definition of Petri Nets A Petri net is a 3-tuple N = (P, T, F ), where P and T are finite and disjoint sets. P is the set of places, and T is the set of transitions. F ⊆ (P × T ) ∪ (T × P ) is the set of directed arcs. Let N = (P, T, F ) be a Petri net. Given a vertex x ∈ P ∪ T , the preset of x is defined as • x = {y ∈ P ∪ T |(y, x) ∈ F }, and the postset of x is defined as x• = {y ∈ P ∪ T |(x, y) ∈ F }. The notation can be extended to a set, for example, given X ⊆ P ∪ T , • X = ∪x∈X • x and X • = ∪x∈X x• . N is pure if ∀(x, y) ∈ F , (y, x) ∈ / F . We assume that in this paper all Petri nets are pure. A state machine is a Petri net in which each transition has exactly one input place and exactly one output place. A marking or state of N is a mapping M : P → Z, where Z = {0, 1, 2, . . .}. Given a place p ∈ P and a marking M , M (p) denotes the number of tokens in p at M . Let S ⊆ P be a set of places. The sum of tokensin all places of S at M is denoted by M (S), i.e., M (S) = p∈S M (p). A Petri net N with an initial marking M0 is called a marked Petri net or net for simplicity, denoted as (N, M0 ). A transition t ∈ T is enabled at a marking M , denoted by M [t >, iff ∀p ∈ • t, M (p) > 0. An enabled transition t at M can fire, resulting in a new marking M , denoted by M [t > M , where M (p) = M (p) − 1, ∀p ∈ • t \ t• ; M (p) = M (p) + 1, ∀p ∈ t• \ • t; and otherwise, M (p) = M (p), ∀p ∈ P . A sequence of transitions α = t1 , t2 , . . . , tk , ti ∈ T, i = 1, 2, . . . , k, is feasible from a marking M if Mi [ti > Mi+1 , i = 1, 2, . . . , k, where M1 = M , and Mi ’s are called reachable markings from M . Let R(N, M0 ) denote the set of all reachable markings of N from M0 . The incidence matrix of N is a matrix [N ] : P × T → {−1, 0, 1} such that [N ](p, t) = −1, p ∈ • t \ t• ; [N ](p, t) = 1, p ∈ t• \ • t; and otherwise, [N ](p, t) = 0 for all p ∈ P and t ∈ T . A nonzero |P |-vector I : P → Z is a P -invariant if I ≥ 0 and I T ∗ [N ] = 0T . The support of a P -invariant I is the set of places: I = {p ∈ P |I(p) = 0}. A P -invariant I is minimal if there does not exist a P -invariant I = I such that
I ⊂ I . A nonempty subset of places S ⊆ P is a siphon iff • S ⊆ S • , i.e., its input transition must also be one of its output transitions. A siphon is minimal iff there does not exist a siphon contained in it as a proper subset. A minimal siphon is strict if it does not contain the support of any P -invariant in N . Let E ⊆ P ∪ T . The subnet generated by E is a Petri net N [E] = (PE , TE , FE ), where PE = P ∩ E, TE = T ∩ E, and FE = F ∩ (E × E). A Petri net N = (P, T, F ) is a bigraph in which the vertex set consists of the set of places P and the set of transitions T . A path in N is a sequence of vertices and arcs αuv = (u = x1 , x2 , . . . , xk+1 = v), where xi ∈ P ∪ T and (xi , xi+1 ) ∈ F, i = 1, 2, . . . , k, and k is the length of α. A circuit is a path in which the first and last vertices are identical. A vertex may appear more than once in a circuit. Two circuits are same if the sets of their vertices and arcs are the same, respectively. A circuit α can determine a unique subnet whose vertices and arcs are in α. We call this subnet a circuit too for simplicity. Hence, a circuit is a strongly connected subnet. A path
76
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
(x1 , x2 , . . . , xk+1 ) is elementary if xi = xj , ∀i = j, 1 ≤ i, j ≤ k + 1. A circuit (x1 , x2 , . . . , xk+1 is elementary if xi = xj , ∀i = j, 1 ≤ i, j ≤ k, and x1 = xk+1 . Hence, a circuit is an elementary one or the union of some elementary ones. The composition of two Petri nets Ni = (Pi , Ti , Fi ), i ∈ {1, 2}, via the same elements, denoted as N1 N2 , is a Petri net N1 N2 = (P, T, F ), where P = P1 ∪ P2 , T = T1 ∪ T2 , and F = F1 ∪ F2 . Two marked Petri nets (Ni , Mi0 ) = (Pi , Ti , Fi , Mi0 ), i ∈ {1, 2}, are compatible if ∀p ∈ P1 ∩ P2 , M10 (p) = M20 (p). The composition of two compatible marked nets (N1 , M10 ) and (N2 , M20 ) is a marked net (N1 , M10 ) (N2 , M20 ) = (N1 N2 , M0 ) = (P, T, F, M0 ), where N1 N2 = (P, T, F ), and ∀p ∈ P1 , M0 (p) = M10 (p), and ∀p ∈ P2 , M0 (p) = M20 (p). B. S3 PR Class The system of simple sequential processes with resources (S3 PR) is originally developed by Ezpeleta et al. [7] for flexible manufacturing systems and widely studied by others [12], [21], [31], [42]–[45]. It can formally be defined in a recursive way as follows. Definition 1: 1) A simple sequential process (S 2 P ) is a Petri net N = (PA ∪ P0 , T, F ), where: a) PA = ∅, p ∈ PA is called an operation or activity place, P0 = {p0 }, PA ∩ P0 = ∅, and p0 is called a process-idle place; b) N is a strongly connected state machine; and c) every cycle of N contains place p0 2) A simple sequential process with resources (S 2 P R) is a Petri net N = (PA ∪ P0 ∪ PR , T, F ), where PR = ∅, r ∈ PR is called a resource place, F = FP ∪ FR , N = (PA ∪ P0 , T, FP ) is an S 2 P , FR ⊆ (T × PR ) ∪ (PR × T ), and for each p ∈ PA , there exists a unique resource place r ∈ PR such that ∀t1 ∈ • p, (r, t1 ) ∈ FR , and ∀t2 ∈ p• , (t2 , r) ∈ FR (in this case, we say that p requires resource r, denoted as R(p) = r). There are no other arcs between T and PR . Let N = (PA ∪ P0 ∪ PR , T, F ) be an S2 PR. M0 is called an acceptable initial marking of N iff: 1) M0 (p0 ) ≥ 1 for p0 ∈ P0 is a finite number; 2) M0 (p) = 0, ∀p ∈ PA ; and 3) M0 (r) ≥ 1, ∀r ∈ PR , where M0 (r) is the capacity of the resource r. In an S2 PR, each r ∈ PR models a resource type in the system. If two S2 PR’s share some resources, they can be composed together as follows. Definition 2: A system of S 2 P Rs, S 3 P R, is defined recursively as follows: 1) An S2 PR is an S3 PR. 2) The composition of two S3 PRs Ni = (PAi ∪ P0i ∪ PRi , Ti , Fi ), i = 1 and 2, denoted N1 N2 , is an S3 PR, where (PA1 ∪ P01 ) ∩ (PA2 ∪ P02 ) = ∅, PR1 ∩ PR2 = ∅, and T1 ∩ T2 = ∅. The places in PR1 ∩ PR2 represent shared resources in the system. From Definition 2, an S3 PR N is composed of some S2 PRs by shared resources. Let Q denote the set of subscripts i of S2 PR Ni contained in an S3 PR N . That is, N is composed from |Q| S2 PRs by step 2 in Definition 2.
Let N be an S3 PR; (N, M0 ) is an acceptably marked S 3 P R (for short, a marked S 3 P R) iff (N, M0 ) is an acceptably marked S2 PR or (N, M0 ) = (N1 , M01 ) (N2 , M02 ), where (Ni , M0i ), i = 1 and 2, are two compatible acceptably marked S3 PRs. M0 is called an acceptable initial marking of N . Let (N, M0 ) = (PA ∪ P0 ∪ PR , T, F, M0 ) be a marked S3 PR and a transition t ∈ T , let A t and tA denote the input and output operation or process-idle places of t, respectively, and let R t and tR denote the input and output resource places of t, respectively. For a given marking M ∈ R(N, M0 ), t is process enabled at M if M (A t) > 0, and t is resource enabled at M if M (R t) > 0. Only transitions that are resource and process enabled at the same time can fire. The finiteness of the resource capacities and initial marking of places in P0 imply that the set of distinct reachable markings of (N, M0 ) is finite. For a given resource place r ∈ PR , let H(r) denote the set of all operation places that require resource r, that is, H(r) = {p ∈ PA |R(p) = r}. This notation can be extended to sets, for example, if R is a subset of resources H(R ) = ∪r∈R H(r). Similarly, let M0 (R ) denote thesum of the capacities of resources in R , that is, M0 (R ) = r∈R M0 (r). C. MPCs in S3 PRs To study the deadlock characterization of S3 PRs, we first review the concept of an MPC in S3 PRs [42]–[44], [46] and then relate it to deadlock. Definition 3: Let θ be a directed circuit in S3 PR N . θ is called an RTC if it contains only resource places and transitions. Let [θ] and [θ] denote the sets of resource places and transitions in θ, respectively. An RTC θ does not contain any operation or processidle places and is uniquely determined by its resource set [θ] and transition set [θ]. Hence, θ = N [[θ] ∪ [θ]], a subnet generated by [θ] ∪ [θ]. It is also denoted as θ = [θ], [θ]. Let R1 = [θ]. Then, θ is said to be with resource set R1 . Let A(R1 ) denote the set of all RTCs with resource set R1 . Let R1 be a set of resource places and θ1 and θ2 be two RTCs with [θ1 ] = [θ2 ] = R1 . Clearly, θ1 , θ2 ∈ A(R1 ). If θ2 contains θ1 or [θ1 ] ⊂ [θ2 ], that is, θ1 is a subcircuit of θ2 , denoted by θ1 θ2 , then the inclusion relation is a partial ordering relation defined on A(R1 ). The union of any two RTCs with R1 is also an RTC with R1 . Therefore, A(R1 ) contains a unique maximal RTC with R1 . Any RTC with R1 is a subcircuit of the maximal RTC with R1 . Definition 4: An RTC θ is perfect if (A [θ])• = [θ]. Let B(R1 ) denote the set of all perfect RTCs (PRTCs) with resource set R1 . Given a resource set R1 , if θ1 , θ2 ∈ B(R1 ), then their union is a PRTC with R1 , that is, θ1 ∪ θ2 ∈ B(R1 ). Therefore, B(R1 ) contains a unique Maximal Perfect RTC (MPC), denoted as ξ(R1 ). Any PRTC with R1 is a subcircuit of MPC ξ(R1 ). Let C denote the set of all MPCs in N . Given a resource set R1 , MPC ξ(R1 ) is unique. If B(R1 ) = ∅, then ξ(R1 ) = ∅. Definition 5: A PRTC θ is said to be saturated at a marking M iff M (A [θ]) = M0 ([θ]).
XING et al.: RESOURCE-TRANSITION CIRCUITS AND SIPHONS FOR DEADLOCK CONTROL
Fig. 1.
Simple S3 PR.
With the aforementioned concept of MPCs, the liveness characterization of S3 PRs is established in [34] and [35] and can be stated as follows. Lemma 1: S3 PR (N, M0 ) is live iff no MPC of N is saturated at M, ∀M ∈ R(N, M0 ). Let R1 be a resource subset and M ∈ R(N, M0 ). Then, ξ(R1 ) is saturated at M iff there is some PRTC θ ∈ B(R1 ) such that θ is saturated at M . Hence, we have the following corollary from Lemma 1. Corollary 1: S3 PR (N, M0 ) is live iff no PRTC of N is saturated at M, ∀M ∈ R(N, M0 ).
77
are RTCs. The net contains only one split operation place p1 . By Lemma 2, if a PRTC contains one output transition of p1 , then it must contain all of its output transitions. Since Λ• ∩ [θ1 ] = ∅ and p1 • ∩ [θ5 ] = p1 • , θ1 and θ5 are perfect. θ2 , θ3 , and θ4 contain one or more transitions in p•1 but do not contain all of them. Hence, they are not perfect. θ1 , θ2 , and θ4 are elementary RTCs, while θ3 and θ5 are not. [θ1 ] = [θ2 ] = [θ3 ] = {r1 , r3 , r4 , r5 }, and [θ1 ]• ∩• [θ1 ] = {t5 , t6 , t7 , t9 , t10 , t11 }. γ(θ1 ) = γ(θ2 ) = θ3 is not perfect. The PRTC with [θ1 ] is only θ1 . Thus, θ1 is an MPC. That is, ξ([θ1 ]) = θ1 . [θ5 ] = {r1 , r2 , r3 , r4 , r5 }, and [θ5 ] = {t2 , t3 , t5 , t6 , t7 , t9 , t10 } ⊂ [θ5 ]• ∩• [θ5 ] = θ5 γ(θ5 ) = ξ([θ5 ]) = {t2 , t3 , t5 , t6 , t7 , t9 , t10 , t11 }. r2 t2 r1 t10 r5 t7 r3 t6 r4 t5 r1 t10 r5 t9 r1 t10 r5 t7 r3 t6 r4 t11 r1 t10 r5 t7 t3 r2 , and γ(θ5 ) is also an MPC. An RTC can be expressed as a union of some elementary circuits. Let θ be an MPC with resource set R1 , and there exists a set of k elementary RTCs, i.e., Ω = {θi , i = 1, 2, . . . , k}, such that θ = ∪i∈K θi , where K = {1, 2, . . . , k}. If γ(θi ) is perfect, then γ(θi ) θ by the perfectness and maximality of θ. If all γ(θi ), θi ∈ Ω, are MPCs, then θ = ∪i∈K γ(θi ). Let θi ∈ Ω be an elementary RTC. If [θi ] ∩ Λ• = ∅, then θi is not perfect by Lemma 2. Let t ∈ [θi ] ∩ Λ• . Then, for each transition tj ∈ (A t)• , there exists an elementary circuit θj ∈ Ω such that tj ∈ [θj ], and for each elementary circuit θi ∈ Ω, there exists a subset Ωi of Ω such that the union of all elements in Ωi is a PRTC. Hence, for each nonperfect RTC θ contained in an MPC θ, we can construct a perfect subcircuit α of θ such that it contains θ .
III. S TRUCTURAL P ROPERTIES OF MPCs
IV. A LGORITHM FOR F INDING MPCs IN S3 PRs
The perfectness of an RTC θ implies that if an output transition of an operation place is in θ, then all its output transitions are in θ. Let Λ = {p ∈ PA : |p• | > 1}. A place in Λ is called a split place. It is an operation place that leads to different subroutes. That is, from p ∈ Λ, a part in the AMS can choose different processing subroutes to continue. Let θ be an RTC in N and t ∈ [θ]. If |(A t)• | = 1, then A • ( t) = t ∈ [θ]. Hence, to check the perfectness of θ, we only need to check if p• ⊆ [θ] for all p ∈ Λ ∩A [θ]. Lemma 2: Given an RTC θ, if ∀p ∈ Λ, p• ∩ [θ] ⊆ [θ], then θ is perfect. By Lemma 2, if a PRTC contains one output transition of a split place, then it contains all its output transitions. Let θ be an RTC in N . Then, [θ], [θ]• ∩• [θ] is connected, and there is a maximal RTC with the resource set [θ]. For simplicity, let γ(θ) denote [θ], [θ]• ∩• [θ]. Furthermore, if γ(θ) is perfect, then γ(θ) is an MPC, that is, ξ([θ]) = γ(θ). Example 1: Consider the S3 PR shown in Fig. 1, Λ = {p1 }, and p1 • = {t2 , t5 , t9 }. From p1 , there are three different processing routes for a part.
RTCs are only related to the transitions and resource places. If a transition is on an RTC, then it must have input and output resource places. Hence, a transition without input or output resource places cannot be in any RTC. Any transition in an RTC is in PR • ∩• PR . Hence, to establish an algorithm for finding all MPCs, we only need to consider the subnet of N as defined below. Definition 6: Let N = (PA ∪ P0 ∪ PR , T, F ) be an S3 PR. The resource-transition net of N , i.e., NR = N [PR ∪ (PR • ∩ • PR )], is a subnet generated by PR and PR • ∩• PR . In order to compute MPCs, all elementary RTCs in N must first be found. The algorithm proposed by Johnson [16] is used to enumerate them its complexity is O((v + e)(c + 1)) if the graph has v vertices, e edges, and c elementary circuits. Fig. 2 shows Johnson’s algorithm. It begins by ordering all the nodes in the graph. It finds the strongly connected component with the least vertex, that is, the vertex with the least index value. Recurrences are done by building elementary paths in this component from the least vertex. The procedure CIRCUIT() is responsible for appending a node to the path, determining if a recurrence is found, and unblocking the node once it exits. Nodes are blocked whenever they are added to the path in order to guarantee that a node can never be used twice on the same path. The process of unblocking a node is delayed as long as possible, usually until a recurrence is found. It repeats the process for each strongly connected component in
θ1 θ2 θ3 θ4 θ5
= r4 t11 r1 t10 r5 t7 r3 t6 r4 = r4 t5 r1 t10 r5 t7 r3 t6 r4 = r4 t5 r1 t10 r5 t7 r3 t6 r4 t11 r1 t10 r5 t9 r1 t10 r5 t7 r3 t6 r4 = r2 t2 r1 t10 r5 t7 r3 t3 r2 = r2 t2 r1 t10 r5 t7 r3 t6 r4 t5 r1 t10 r5 t9 r1 t10 r5 t7 r3 t3 r2
78
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
Step 1 Find all elementary circuits in NR by using Find-AllElementary-Circuits (NR ). Let ΞEC be the set of all elementary circuits in NR . Step 2 For each θ = [θ], [θ] ∈ ΞEC , if γ(θ) is perfect, then delete all θ with [θ ] = [θ] from ΞEC and then add γ(θ) into ΞEC . Step 3 Construct recursively the set ΩC of RTCs from ΞEC as follows: (1) Let ΩC := ΞEC ; (2) For each θ1 ∈ ΞEC , and for every RTC θ2 ∈ ΩC , if [θ1 ] ∩ [θ2 ] = ∅ and θ1 ∪ θ2 is not in ΩC , then add θ1 ∪ θ2 into ΩC . If γ(θ1 ∪ θ2 ) is perfect, then delete all θ ∈ ΩC with [θ] = [θ1 ∪ θ2 ] and add γ(θ1 ∪ θ2 ) into ΩC . Step 4 (A) Delete all nonperfect RTCs in ΩC ; and (B) For θ ∈ ΩC , let Ω = {θ ∈ ΩC |[θ ] = [θ]} and add ∪θ ∈Ω θ into C, and delete all RTCs with resource set [θ] from ΩC .
Fig. 2. Pseudocode of the algorithm finding all elementary circuits.
the graph, on the order of node indices. The algorithm outputs all elementary circuits of NR , that is, all elementary RTCs of N , after it is applied to NR . An MPC can be expressed as the union of some elementary RTCs. Hence, it can be obtained by an iterative method from the already-found elementary ones. The MPC enumeration algorithm is presented as follows. Algorithm A (MPC Enumeration): Input: NR , a resource-transition net of an S3 PR N ; Output: C, the set of all MPCs in N ; At the beginning, C = ∅;
Vertices in NR include all resource places and their input and output transitions. The number of transitions in NR is not greater than the number of all operations |PA |, and the edge number of NR is twice the number of transitions. Therefore, there are about (|PA | + |PR |) vertices and 2 × |PA | edges. Thus, the time complexity of step 1 is O((3|PA | + |PR |)(c + 1)), where c is the number of elementary RTCs in NR . If an RTC θ is contained in an MPC α and γ(θ) is perfect, then γ(θ) is contained in α. Thus, if γ(θ) is perfect, then any θ ∈ ΞEC with [θ ] = [θ] can be replaced by γ(θ), and step 2 deletes all RTCs from ΞEC that are not useful for constructing MPCs. The time complexity of step 2 is O(c). An MPC is an RTC and can be expressed as a union of some elementary RTCs. To enumerate all MPCs in N , first, all different RTCs are constructed in step 3. Then, in step 4, all MPCs are chosen and added into C. Thus, the algorithm can enumerate all MPCs in N . Let C denote the number of all different RTCs. Since, for any new RTC, the algorithm needs to compare it with the already-constructed RTCs to check if it is an already-constructed RTC, that is, it has been in ΩC , the number of comparisons is at most C 2 times. Thus, enumerating all RTCs in N can be done in time O((3|PA | + |PR |)C 2 ) since each RTC contains at most all nodes and edges in NR . Therefore, the complexity of step 3 is O((3|PA | + |PR | + 1)C 2 ), and the complexity of the entire algorithm is O((3|PA | + |PR |)(c + 1)) + O(c) + O((3|PA | + |PR | + 1)C 2 ), where c and C are the numbers of elementary and different RTCs in NR , respectively. Clearly, c ≤ C. Hence, the complexity does not exceed O((3|PA | + |PR | + 1)C 2 ). Theorem 1: Algorithm A can find all MPCs in N with complexity O((3|PA | + |PR | + 1)C 2 ), where C is the number of different RTCs. Example 2: Let us consider S3 PR N shown in Fig. 3 [7]. Since MPCs and SMSs in S3 PR are only related with the structure of Petri net models, the initial marking of N in Fig. 3 is omitted. PR = {p20 , p21 , p22 , p23 , p24 , p25 , p26 }. N contains only one split place p7 , Λ = {p7 }, and p7 • = {t6 , t11 }. NR is shown as in Fig. 4, where for programming simplicity and directly using algorithm Find-All-Elementary-Circuits(),
XING et al.: RESOURCE-TRANSITION CIRCUITS AND SIPHONS FOR DEADLOCK CONTROL
79
TABLE I ALL NINE ELEMENTARY CIRCUITS IN NR SHOWN IN FIG. 4
Fig. 3.
S3 PR model N .
Step 3) From ΞEC , construct the set of different RTCs ΩC , which contains 25 RTCs. They are listed in Table II, where only their resource sets are listed because each of them is uniquely determined by its resource set. Step 4) Check if an RTC θ ∈ ΩC is perfect. Since N contains only one split operation p7 , consider θ contain/ [θ], then θ ing θ6 (or α4 in Table II). If p20 (1) ∈ is not perfect. Finally, there are 18 PRTCs, and they are all MPCs in N (Table III). V. O NE - TO -O NE C ORRESPONDENCE B ETWEEN SMSs AND MPCs AND A N EW A LGORITHM FOR F INDING SMSs IN S3 PRs Although SMSs and MPCs are different structural objects, we can prove that there exists a one-to-one correspondence between them in S3 PRs. This section first establishes the relation and then presents a new SMS enumeration algorithm based on it. A. One-to-One Correspondence Between SMSs and MPCs
Fig. 4.
Resource-transition net NR of N shown in Fig. 3.
all place and transition nodes in NR are renumbered into 1, 2, . . . , 21. Step 1) All elementary circuits in NR , via Find-AllElementary-Circuits (NR ), are listed in Table I. Step 2) Test the perfectness of γ(θ) for each θ ∈ ΞEC . Only γ(θ6 ) is not perfect. [θ2 ] = [θ4 ], and [θ3 ] = [θ5 ]. Therefore, delete θi , i = 1, 2, 3, 4, 5, 7, 8, 9, from ΞEC and then add γ(θi ), i = 1, 2, 3, 7, 8, 9, into ΞEC . Finally, ΞEC has seven elements, and ΞEC = {γ(θ1 ), γ(θ2 ), γ(θ3 ), θ6 , γ(θ7 ), γ(θ8 ), γ(θ9 )}.
Let N = (PA ∪ P0 ∪ PR , T, F ) be an S3 PR and S denote the set of all SMSs in N . Lemma 3: Let N = (PA ∪ P0 ∪ PR , T, F ) be an S3 PR. If S is an SMS in N , r ∈ PR , and H(r) ∩ S = ∅, then r ∈ S. Proof: Assume to the contrary that there exists a place p ∈ H(r) ∩ S such that r ∈ / S. We do the up and down analysis along paths through p, respectively, and derive some contradictions. Here, for simplicity, we suppose that only one path passes through p. For cases in which there is more than one path, the proof is similar. Up-analysis: Let t11 = • p and p11 = A t11 . By assumption, S is a siphon, p ∈ H(r) ∩ S, and r ∈ / S; then, p11 ∈ S, and / S. R(p11 ) = ∅. Assume to the contrary that r11 = R(p11 ) ∈ Then, let t12 = • p11 and p12 = A t12 , and hence, p12 ∈ S. For p12 , repeat the aforementioned analysis. Since the process path is finite, the analysis cannot be repeated in infinite times. Note that, otherwise, all places in the paths passing through p are in S and form a support of a P -invariant. This contradicts that S is an SMS. Hence, in some step, for example, in step k, there exist a place p1k and resource r1k such that p1k ∈ S and r1k ∈ S, but / S, i = 1, 2, . . . , k − 1. p1i ∈ S, i = 1, 2, . . . , k, and r1i ∈
80
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
TABLE II RTCs IN ΩC AND MPCs IN NR SHOWN IN FIG. 4
Down-analysis: Let t21 = p• and p21 = tA / S or 21 . If p21 ∈ R(p21 ) = ∅ or p21 ∈ S and R(p21 ) = ∅ and r21 ≡ R(p21 ) ∈ S, then S \ {p, p11 , p12 , . . . , p1(k−1) } is a siphon. This is con/ S. tradicting to the minimality of S. Hence, p21 ∈ S, and r21 ∈ Let t22 = p21 • , p22 = tA 22 , and r22 ≡ R(p22 ). Then, p22 ∈ S, / S. Repeat the aforementioned analysis. Then, there and r22 ∈ must exist a processing path passing through p, p21 , p22 , . . ., / S, i = 1, 2, . . .. Besuch that {p, p21 , p22 , . . .} ⊆ S and r, r2i ∈ cause of the finiteness of paths, all places in the paths passing through p are in S and form a support of a P -invariant, again leading to a contradiction. Hence, if p ∈ H(r) ∩ S, then r ∈ S. Lemma 4: Let N = (PA ∪ P0 ∪ PR , T, F ) be an S3 PR; define g(θ) = [θ] ∪ (H ([θ]) \• [θ]) ,
TABLE III CORRESPONDENCE RELATION BETWEEN SMSs AND MPCs IN FIG. 3
θ ∈ C.
Then, g is an injection from C to S. Proof: Let θ ∈ C and S = g(θ). We need to prove that: 1) g is a mapping from C to S, that is, for any θ ∈ C, S = g(θ) is a member of S; and 2) g is injective. 1) S is a siphon: Let t ∈ • S. If t ∈ • (H([θ]) \• [θ]), that is, ∃p ∈ H([θ]) \• [θ] and r ∈ [θ] such that p ∈ H(r) and t ∈ • p, then t ∈ r• ⊆ R(p)• ⊆ [θ]• ⊆ S • . If t ∈ • [θ] and t is on θ, then we can assume that there exist r1 , r2 ∈ [θ] such that r1 tr2 is a part in θ. Then, t ∈ r1 • ∈ [θ]• ⊆ S • . / If t ∈ • [θ] but t is not on θ, let t ∈ • r. Then, t ∈ and [θ], A t ≡ p ∈ H(r) \• [θ] ⊆ H([θ]) \• [θ], t ∈ p• ⊆ (H([θ]) \• [θ])• ⊆ S • . Therefore, S is a siphon. 2) Minimality of S: Assume to the contrary that there exists a minimal siphon S1 such that S1 ⊆ S but S1 = S. Let SA = S ∩ PA , SR = S ∩ PR , S1A = S1 ∩ PA , and S1R = S1 ∩ PR . Case 2-a: If S1R = SR , then SA \ S1A = ∅. Let p ∈ SA \ S1A and t1 ∈ p• , and denote r1 = R t1 . From / S1 , and S1 ber = R(p) ∈ [θ] = S1R ⊆ S1 , p ∈ ing a siphon, we know that r1 ∈ S1 ⊆ S, and t1 ∈ r1 • ∩• r. Hence, t1 is on θ. By the definition of S, / S, which is a contradiction. p = A t1 ∈ Case 2-b: If S1R ⊆ SR but S1R = SR , let r ∈ SR \ S1R . Then, r is on θ, and there exist a transition t1 ∈ r• and a resource place r1 = t1 R ∈ [θ] such that rt1 r1 is a part of θ. By the structure of S, A t1 ∈ / S. Hence, A t1 ∈ / S1 . By r ∈ / S1 , we have r1 ∈ / S1 . Similarly, from r1 ∈ SR \ S1R , there exist a transition t2 ∈ r1 • A and a resource place r2 = tR / S1 and 2 such that t2 ∈ / S1 . Repeating the aforementioned procedure, r2 ∈ we can have the following conclusion: Any resource place reachable from r through θ is not in S1 . Since θ is a circuit and any resource place on θ can be reached from another through θ, S1 does not contain / S; hence, S1 = ∅. any resource place. ∀q ∈ Q, pq0 ∈ Therefore, S is minimal. 3) Strictness of S: It can easily be proved that {pq0 } ∪ Pq , q ∈ Q, and H(r) ∪ {r}, ∀r ∈ PR , are only supports of minimal P -invariants of (N, M0 ). Since P0 ∩ S = ∅,
XING et al.: RESOURCE-TRANSITION CIRCUITS AND SIPHONS FOR DEADLOCK CONTROL
pq0 ∈ / S, ∀q ∈ Q, S does not contain any set {pq0 } ∪ Pq , q ∈ Q, and any RTC contains at least two resource places. Thus, ∀r ∈ [θ], ∃r1 ∈ [θ] and t1 ∈ [θ] such that t1 ∈ / S. By p ∈ r1 • ∩• r. Hence, A t1 = p ∈ A [θ], and p ∈ H(r), S does not contain any set H(r) ∪ {r}, ∀r ∈ PR . Therefore, S is strict. Items 1, 2, and 3 imply that g is a mapping from C to S. 4) g is an injection: Suppose that θ1 , θ2 ∈ C. If g(θ1 ) = g(θ2 ), then [θ1 ] = [θ2 ], and hence, θ1 and θ2 are MPCs with the same resource set [θ1 ] = [θ2 ]. By the uniqueness of MPCs, we know that θ1 = θ2 . Thus, g is injective and, hence, an injection from C to S. Lemma 5: Let N = (PA ∪ P0 ∪ PR , T, F ) be an S3 PR. Define h(S) = N [SR ∪ TS ],
S∈S
• where SR = S ∩ PR , SA = S ∩ PA , TS = • SR \ SA , and N [SR ∪ TS ] is a subnet of N generated by SR ∪ TS . Then, h is an injection from S to C. Proof: Let S ∈ S and θ = h(S) = N [SR ∪ TS ]. Similar to the proof of Lemma 4, we need to prove that h is a mapping from S to C, that is, ∀S ∈ S, h(S) ∈ C, and h is injective. • 1) TS = • SR \ SA = ∅: First, by the strictness of S and • Lemma 3, SR = ∅, and SA = ∅. If TS = • SR \ SA = ∅, then ∀r ∈ SR , H(r) ⊆ SA . Hence, H(r) ∪ {r} ⊆ S, resulting in a contradiction. Thus, TS = ∅. 2) N [SR ∪ TS ] is an RTC passing through every node in SR ∪ TS : ∀t ∈ TS = • SR \ SA • , ∃r ∈ SR such that t ∈ • r. Denote A t = p. Then, p ∈ H(r), and p ∈ / SA . By t ∈ • r ⊆ • SR ⊆ • S and • S ⊆ S • , we know that ∃r1 ∈ SR such that t ∈ r1 • . Then, t ∈ r1 • ∩• r ⊆ SR • ∩• SR . For any resource r ∈ SR , S does not contain H(r) ∪ {r}. Then, there exists p ∈ H(r) and p ∈ / SA such that p• ⊆ • r ⊆ • S. By • S ⊆ S • , we know that ∀t ∈ p• , ∃r1 ∈ SR such that t ∈ r1 • . Then, t ∈ TS ∩• r = ∅. If there exists a resource r ∈ SR such that r• ∩ TS = ∅, then / SR , or r1 ∈ SR , A t ∈ SA . Hence, ∀t ∈ r• , tR = r1 ∈ S \ (H(r) ∪ {r}) is a siphon, which is a contradiction. Then, r• ∩ TS = ∅. That is, ∀r ∈ SR , ∃t1 , t2 ∈ TS such that t1 ∈ • r and t2 ∈ r• . Hence, ∀u ∈ SR ∪ TS , there exist input and output nodes of u in N [SR ∪ TS ]. If N [SR ∪ TS ] is not strongly connected, then there exists at least a strongly connected subnet θ1 in N [SR ∪ TS ] such that there exist no paths from other strongly connected subnets to θ1 . Let R1 = [θ1 ] and P1 = H(R1 ) ∩ S. Then, R1 ∪ P1 ⊆ S is a siphon, which is a contradiction. Therefore, N [SR ∪ TS ] is a strongly connected subnet, that is, it is an RTC, denoted as θ. 3) θ is perfect: ∀t ∈ TS , let A t = p and R(p) = r. ∀t1 ∈ p• , / S, and • S ⊆ S • . Hence, ∃r1 ∈ SR such that t1 ∈ • r, p ∈ • t1 ∈ r1 . t1 ∈ r1• ∩ (• r \ p• ) ⊆ • SR \ SA • = TS . Therefore, (A TS )• ⊆ TS , i.e., θ is perfect. 4) θ is maximal: ∀p ∈ SA , there exists a transition t ∈ p• such that R t ∈ / SR . This is because if R (p• ) ⊆ SR , then S \ {p} is a siphon, which is a contradiction. Hence,
81
by the perfectness of θ, any RTC with resource set SR does not contain any transitions in SA • . Hence, • SR \ SA • is a maximal set of transitions that a PRTC with resource set SR can contain. [θ] = TS = • SR \ SA • . Hence, N [SR ∪ TS ] is an MPC with resource set SR . Items 1–4 together show that N [SR ∪ TS ] is an MPC and h is a mapping from S to C. 5) h is an injection: Let S1 , S2 ∈ S and h(S1 ) = h(S2 ). If Then, S1R = S1 ∩ PR = S2 ∩ PR = S2R . S1A = PA ∩ S1 = PA ∩ S2 = S2A , we can assume that p ∈ S1A \ S2A = ∅. By Lemma 3, R(p) ∈ S1R = S2R , p• ∩ h(S1 ) = ∅, but p• ⊆ h(S2 ). This contradicts with h(S1 ) = h(S2 ). Thus, S1 = S2 , and h is an injection. Lemma 6: Let S be an SMS in (N, M0 ). Then, S can be written as S = SR ∪ (H(SR ) \• TS ), where SR = S ∩ PR , SA = S ∩ PA , and TS = • SR \ SA • . Proof: We need only to prove that H(SR ) \ • TS = SA . Let p ∈ SA , then r = R(p) ∈ SR by Lemma 3. ∀t ∈ p• , t ∈ • r ⊆ • SR , but t ∈ p• ⊆ SA • , and p• ∩ TS = ∅. Therefore, p ∈ H(SR ) \• TS , and SA ⊆ H(SR ) \• TS . On the other hand, ∀p ∈ H(SR ) \• TS , there exists a resource r ∈ SR such that p ∈ H(r) and p ∈ / • TS . That is, p• ∩ TS = ∅ and p• ⊆ • r. • • Hence, p ∩ SR = ∅. Thus, p ∈ SA , and H(SR ) \• TS ⊆ SA . Hence, H(SR ) \• TS = SA , and S = SR ∪ SA = SR ∪ (H(SR ) \• TS ). Theorem 2: There exists a one-to-one correspondence relation between S and C in S3 PR N . Proof: Let g and h be mappings defined in Lemmas 4 and 5, respectively, and S ∈ S. Then, g(h(S)) = g(N [SR ∪ TS ]) = SR ∪ (H(SR ) \• TS ) = S, where SR = S ∩ PR , SA = S ∩ PA , and TS = • SR \ SA • . Hence, g and h are inverse and bijective. Since S is finite, g and h are the one-to-one correspondence relations between S and C. B. Algorithm for Finding SMSs in S3 PRs By using the one-to-one mapping from MPCs to SMSs and the MPC Enumeration Algorithm in Section IV, we can obtain a new algorithm to find all SMS as follows. Algorithm B (SMS Enumeration): Step 1. Find all MPCs in N with Algorithm A. Let C be the set of all MPCs in N . Step 2. Compute all SMS by the mapping g from C to S. On the other hand, we can first find all SMSs in N with any existing algorithm [3], [5], [6], [14], [15], [29], [47] and then compute all MPCs by using the mapping f from S to C. It is easy to compute all SMSs in S from all MPCs in C by the mapping g. Thus, SMS Enumeration Algorithm B and MPC Enumeration Algorithm A have the same time complexity. Example 3: Let us reconsider S3 PR N shown in Fig. 3. In Example 2, all 18 MPCs of N are computed, as shown in Table III. Hence, by Theorem 2, we know that N contains
82
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
18 SMSs. By SMS Enumeration Algorithm B, all 18 SMSs can be enumerated. For example, MPC θ1 ∈ C has resource set [θ1 ] = {p20 , p22 , p24 , p25 }, and its corresponding siphon is S1 = g(θ1 ) = [θ1 ] ∪ (H([θ1 ]) \• [θ1 ]), where and H([θ1 ]) = {p4 , p6 , p7 , p8 , p9 , p12 , p13 , p17 , p18 , p19 }, • [θ1 ] = • ([θ1 ]• ∩• [θ1 ]) = • {t6 , t7 , t11 , t12 , t18 , t19} = {p7 , p8 , p12 , p17 , p18 }. Thus, S1 = {p20 , p22 , p24 , p25 } ∪ ({p4 , p6 , p7 , p8 , p9 , p12 , p13 , p17 , p18 , p19 }\{p7 , p8 , p12 , p17 , p18 , }) = {p4 , p6 , p9 , p13 , p19 , p20 , p22 , p24 , p25 }. MPC θ2 ∈ C has resource set [θ2 ] = {p21 , p25 }, and its corresponding siphon is S2 = g(θ2 ) = [θ2 ] ∪ (H([θ2 ]) \• [θ2 ]), where H([θ2 ]) = {p4 , p5 , p6 , p9 , p10 , p13 , p17 }, and • [θ2 ] = • ([θ2 ]• ∩ • [θ2 ]) = • {t2 , t3 , t8 } = {p4 , p5 , p9 }. Thus, S2 = { p21 , p25 } ∪ ( { p4 , p5 , p6 , p9 , p10 , p13 , p17 } \ {p4 , p5 , p9 }) = {p6 , p10 , p13 , p17 , p21 , p25 }. All 18 MPCs and SMSs of N in Fig. 3 and their correspondence relation are listed in Table III. VI. E QUIVALENCE B ETWEEN C IRCUIT- AND S IPHON -BASED D EADLOCK C ONTROL M ETHODS Two special structural objects in Petri net models of AMSs lead to the different methods for deadlock control. One relies on siphons and another on RTCs. Based on SMSs, one of the liveness characterizations of S3 PRs as presented in [7] can be restated as follows. Lemma 7: A marked S3 PR (N, M0 ) is live iff ∀M ∈ (N, M0 ) and ∀S ∈ S, M (S) > 0. Similarly, by using MPC, the corresponding liveness characterization of S3 PRs presented in [41]–[44] can be restated as follows. Lemma 8: A marked S3 PR (N, M0 ) is live iff ∀M ∈ (N, M0 ) and ∀θ ∈ C, M (A [θ]) < M0 ([θ]). Combining Lemma 7 with Lemma 8, we have the following result. Theorem 3: Let (N, M0 ) be a marked S3 PR. Then, the following three statements are equivalent to each other. 1) (N, M0 ) is live. 2) ∀M ∈ (N, M0 ) and ∀S ∈ S, M (S) > 0. 3) ∀M ∈ (N, M0 ) and ∀θ ∈ C, M (A [θ]) < M0 ([θ]). Furthermore, since there is one-to-one correspondence relation between SMSs and MPCs, we have the following conclusion. Theorem 4: Let (N, M0 ) be a marked S3 PR, θ ∈ C, and S = g(θ) ∈ S. Then, ∀M ∈ (N, M0 ), S is not emptied at M iff θ is not saturated at M . Proof: Let θ ∈ C and S = g(θ) = [θ] ∪ (H([θ]) \ A [θ]) be the siphon corresponding to θ. ∀M ∈ (N, M0 ), M ([θ]) + M (H([θ])) = M0 ([θ]). Hence, M (S) > 0 iff M (A [θ]) < M0 ([θ]). That is, S is not emptied at M iff θ is not saturated at M . From Theorems 3 and 4, we can have the following conclusion: 1) the methods for characterizing deadlock conditions in S3 PRs using MPC and SMS, respectively, are equivalent; and 2) any controller for S3 PRs that makes all SMSs nonempty can also prevent all MPCs from being saturated in S3 PRs and vice versa.
Although circuit- and siphon-based deadlock control methods are equivalent, by using a circuit-based deadlock control method, one has obtained some optimal deadlock-avoidance controllers for AMSs [41]–[44]. This may be because RTCs have more explicit structural information that can help develop the necessary and sufficient conditions for the occurrence of deadlocks and restricted deadlocks [2], [8] in Petri net models. Second-level deadlocks are not operation-resource circular waits. They are control-resource circular waits. VII. C ONCLUSION In this paper, a graph-based technique has been used to find all elementary RTC structures of the subnet generated by the sets of resource places and their input and output transitions. An MPC can be expressed as the union of some elementary RTCs. Hence, an iterative method is developed to recursively construct all MPCs from those elementary ones. The one-toone correspondence between SMSs and MPCs in S3 PRs has been established. By using the mappings between them, new algorithms have been derived to identify MPCs and SMSs in S3 PRs, respectively. Their complexities have been analyzed. The results can greatly help one reveal the inherent features of MPCs and SMSs and their respective deadlock control methods. They should further help industrial practitioners design proper deadlock control methods for AMSs. Their extensions to other classes of Petri nets in manufacturing automation [49]– [70] will require future research. ACKNOWLEDGMENT The authors would like to thank the Associate Editor and all anonymous reviewers for their thoughtful comments and suggestions that greatly helped us improve the presentation and technical quality of this paper. Correspondence should be sent to Feng Tian. R EFERENCES [1] T. Araki, Y. Sugiyama, and T. Kasami, “Complexity of the deadlock avoidance problem,” in Proc. 2nd IBM Symp. Math. Found. Comput. Sci., 1977, pp. 229–257. [2] K. Barkaoui, A. Chaoui, and B. Zouari, “Supervisory control of discrete event systems based on structure theory of Petri nets,” in Proc. IEEE Int. Conf. Syst., Man, Cybern., Orlando, FL, 1997, pp. 3750–3755. [3] R. Boer and T. Murata, “Generating basis siphons and traps of Petri nets using the sign incidence matrix,” IEEE Trans. Circuits Syst. I, Fundam. Theory Appl., vol. 41, no. 4, pp. 266–271, Apr. 1994. [4] F. Chu and X. Xie, “Deadlock analysis of Petri nets using siphons and mathematical programming,” IEEE Trans. Robot. Autom., vol. 13, no. 6, pp. 793–804, Dec. 1997. [5] R. Cordone, L. Ferrarini, and L. Piroddi, “Enumeration algorithms for minimal siphons in Petri nets based on place constraints,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 35, no. 6, pp. 844–854, Nov. 2005. [6] J. Ezpeleta and J. Couvreur, “A new technique for finding a generating family of siphons, traps and ST-components. Application to colored Petri nets,” in Proc. Int. Conf. Appl. Theory Petri Nets, Aarhus, Denmark, 1991, pp. 126–147. [7] J. Ezpeleta, J. Colom, and J. Martinez, “A Petri net-based deadlock prevention policy for flexible manufacturing system,” IEEE Trans. Robot. Autom., vol. 11, no. 2, pp. 173–184, Apr. 1995. [8] M. P. Fanti, B. Maione, S. Mascolo, and B. Turchiano, “Event-based feedback control for deadlock avoidance in flexible production systems,” IEEE Trans. Robot. Autom., vol. 13, no. 3, pp. 347–363, Jun. 1997.
XING et al.: RESOURCE-TRANSITION CIRCUITS AND SIPHONS FOR DEADLOCK CONTROL
[9] M. P. Fanti, B. Maione, and B. Turchiano, “Event control for deadlock avoidance in production systems with multiple capacity resources,” Stud. Inf. Control, vol. 7, no. 4, pp. 343–364, 1998. [10] M. P. Fanti and M. C. Zhou, “Deadlock control methods in automated manufacturing systems,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 34, no. 1, pp. 5–22, Jan. 2004. [11] E. Gold, “Deadlock prediction: Easy and difficult cases,” SIAM J. Comput., vol. 7, no. 3, pp. 320–336, 1978. [12] Y. Huang, M. Jeng, X. Xie, and S. Chung, “Deadlock prevention policy based on Petri nets and siphons,” Int. J. Prod. Res., vol. 39, no. 3, pp. 283– 305, 2001. [13] B. Hruz and M. C. Zhou, Modeling and Control of Discrete Event Dynamic Systems. London, U.K.: Springer-Verlag, 2007. [14] M. Jeng and M. Peng, “Generating minimal siphons and traps for Petri nets,” in Proc. IEEE Int. Conf. Syst., Man Cybern., Beijing, China, 1996, vol. 4, pp. 2996–2999. [15] M. Jeng, M. Peng, and Y. Huang, “An algorithm for calculating minimal siphons and traps of Petri nets,” Int. J. Intell. Control Syst., vol. 3, no. 3, pp. 263–275, 1999. [16] D. B. Johnson, “Finding all the elementary circuits of a directed graph,” SIAM J. Comput., vol. 4, no. 1, pp. 77–84, 1975. [17] K. Lautenbach, “Linear algebraic calculation of deadlocks and traps,” in Concurrency and Nets-Advances in Petri Nets, K. Voss, H. J. Genrich, and G. Rozenberg, Eds. New York: Springer-Verlag, 1987, pp. 315–336. [18] M. Lawley, S. A. Reveliotis, and P. M. Ferreira, “A correct and scalable deadlock avoidance policy for flexible manufacturing systems,” IEEE Trans. Robot. Autom., vol. 14, no. 5, pp. 796–809, Oct. 1998. [19] M. Lawley, “Deadlock avoidance for production systems with flexible routing,” IEEE Trans. Robot. Autom., vol. 15, no. 3, pp. 497–509, Jun. 1999. [20] M. Lawley, “Integrating flexible routing and algebraic deadlock avoidance policies in automated manufacturing systems,” Int. J. Prod. Res., vol. 38, no. 13, pp. 2931–2950, Sep. 2000. [21] Z. W. Li and M. C. Zhou, “Elementary siphons of Petri nets and their application to deadlock prevention in FMSs,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 34, no. 1, pp. 38–51, Jan. 2004. [22] Z. W. Li, M. C. Zhou, and N. Q. Wu, “A survey and comparison of Petri net-based deadlock prevention policy for flexible manufacturing systems,” IEEE Trans. Syst., Man, Cybern. C, Appl. Rev., vol. 38, no. 2, pp. 172–188, Mar. 2008. [23] Z. W. Li and M. C. Zhou, “Control of elementary and dependent siphons in Petri nets and their application,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 38, no. 1, pp. 133–148, Jan. 2008. [24] Z. W. Li, S. Zhu, and M. C. Zhou, “Application of a divide and conquer strategy to deadlock prevention in flexible manufacturing systems based on Petri nets,” IEEE Trans. Syst., Man, Cybern. C, Appl. Rev., vol. 39, no. 2, pp. 156–169, Mar. 2009. [25] T. Murata, “Petri nets: Properties, analysis and applications,” Proc. IEEE, vol. 77, no. 4, pp. 541–580, Apr. 1989. [26] J. Park and S. Reveliotis, “Deadlock avoidance in sequential resource allocation systems with multiple resource acquisitions and flexible routings,” IEEE Trans. Autom. Control, vol. 46, no. 10, pp. 1572–1583, Oct. 2001. [27] S. Reveliotis, “On the siphon-based characterization of liveness in sequential resource allocation systems,” in Applications and Theory of Petri Nets. New York: Springer-Verlag, 2003, pp. 241–255. [28] S. Reveliotis and P. M. Ferreira, “Deadlock avoidance policies for automated manufacturing cells,” IEEE Trans. Robot. Autom., vol. 12, no. 6, pp. 845–857, Dec. 1996. [29] F. Tricas and J. Ezpeleta, “Computing minimal siphons in Petri net models of resource allocation systems: A parallel solution,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 36, no. 3, pp. 532–539, May 2006. [30] M. Uzam and M. C. Zhou, “An iterative synthesis approach to Petri netbased deadlock prevention policy for flexible manufacturing systems,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 37, no. 3, pp. 362– 371, May 2007. [31] N. Wu and M. Zhou, “Deadlock resolution in automated manufacturing systems with robots,” IEEE Trans. Autom. Sci. Eng., vol. 4, no. 3, pp. 474– 480, Jul. 2007. [32] N. Q. Wu, “Necessary and sufficient conditions for deadlock-free operation in flexible manufacturingsystems using a colored Petri net model,” IEEE Trans. Syst., Man, Cybern. C, Appl. Rev., vol. 29, no. 2, pp. 192–204, May 1999. [33] N. Q. Wu and M. C. Zhou, “Avoiding deadlock and reducing starvation and blocking in automated manufacturing systems based on a Petri net model,” IEEE Trans. Robot. Autom., vol. 17, no. 5, pp. 658–669, Oct. 2001.
83
[34] N. Q. Wu and W. Q. Zeng, “Deadlock avoidance in AGV system using colored Petri net model,” Int. J. Prod. Res., vol. 40, no. 1, pp. 223–238, 2002. [35] N. Q. Wu and M. C. Zhou, “Modeling and deadlock control of automated guided vehicle systems,” IEEE/ASME Trans. Mechatron., vol. 9, no. 1, pp. 50–57, Mar. 2004. [36] N. Q. Wu and M. C. Zhou, “Modeling and deadlock avoidance of automated manufacturing systems with multiple automated guided vehicles,” IEEE Trans. Syst., Man, Cybern. B, Cybern., vol. 35, no. 6, pp. 1193– 1202, Dec. 2005. [37] N. Q. Wu and M. C. Zhou, “Shortest routing of bi-directional automated guided vehicles avoiding deadlock and blocking,” IEEE/ASME Trans. Mechatron., vol. 12, no. 1, pp. 63–72, Feb. 2007. [38] N. Q. Wu, M. C. Zhou, and Z. W. Li, “Resource-oriented Petri net for deadlock avoidance in flexible assembly systems,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 38, no. 1, pp. 56–69, Jan. 2008. [39] N. Q. Wu and M. C. Zhou, “Deadlock modeling and control of semiconductor track systems using resource-oriented Petri nets,” Int. J. Prod. Res., vol. 45, no. 15, pp. 3439–3456, Aug. 2007. [40] K. Xing, B. Hu, and H. Chen, “Deadlock avoidance policy for Petri net modeling of flexible manufacturing systems with shared resources,” IEEE Trans. Autom. Control, vol. 41, no. 2, pp. 289–295, Feb. 1996. [41] K. Xing and B. Hu, “Optimal liveness Petri net controllers with minimal structures for automated manufacturing systems,” in Proc. IEEE Int. Conf. Syst., Man, Cybern., Waikoloa, HI, 2005, pp. 1651–1656. [42] K. Xing, H. Xu, and B. Hu, “Polynomial-complexity deadlock avoidance policies for automated manufacturing systems,” Dyn. Continuous Discrete Impulsive Syst., Series B-Appl. Algorithms, vol. 13, pt. 1, pp. 11–15, 2006, Suppl. S. [43] K. Xing, F. Tian, and X. Yang, “Optimal deadlock avoidance Petri net supervisors for automated manufacturing systems,” J. Control Theory Appl., vol. 5, no. 2, pp. 152–158, May 2007. [44] K. Xing, M. Zhou, H. Liu, and F. Tian, “Optimal Petri net based polynomial complexity deadlock avoidance policies for automated manufacturing systems,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 39, no. 1, pp. 188–189, Jan. 2009. [45] K. Xing, F. Tian, J. Li, and S. Qu, “A Petri net based deadlock avoidance controller for manufacturing systems with multiple resource service,” Dyn. Continuous Discrete Impulsive Syst., Series A—Math. Anal., vol. 13, pt. 2, pp. 812–817, 2006, Suppl. S. [46] K. Xing, M. Zhou, K. Shi, and L. Ren, “Enumeration algorithms for maximal perfect-resource-transition circuits and strict minimal Siphons in S3 PR,” in Proc. 17th World Congr. Int. Federation Autom. Control, Seoul, Korea, Jul. 6–11, 2008. [47] M. Yamauchi and T. Watanabe, “Algorithms for extracting minimal siphons containing specified places in a general Petri net,” IEICE Trans. Fundam., vol. E82-A, no. 11, pp. 2566–2575, 1999. [48] M. Zhou and K. Venkatesh, Modeling, Simulation, and Control of Flexible Manufacturing Systems: A Petri Net Approach. Singapore: World Scientific, 1998. [49] M. C. Zhou and F. DiCesare, Petri Net Synthesis for Discrete Event Control of Manufacturing Systems. London, U.K.: Kluwer, 1993. [50] M. C. Zhou and M. P. Fanti, Eds., Deadlock Resolution in ComputerIntegrated Systems. New York: Marcel Dekker, Jan. 2005. [51] Y. Chao and Z. W. Li, “Structural conditions of systems of simple sequential processes with resources nets without weakly dependent siphons,” IET Control Theory Appl., vol. 3, no. 4, pp. 391–403, 2009. [52] M. Gao, M. C. Zhou, and Y. Tang, “Intelligent decision making in disassembly process based on fuzzy reasoning petri nets,” IEEE Trans. Syst., Man, Cybern. B, vol. 34, no. 5, pp. 2029–2034, Oct. 2004. [53] H. S. Hu, M. C. Zhou, and Z. Li, “Liveness enforcing supervision of video streaming systems using non-sequential Petri nets,” IEEE Trans. Multimedia, vol. 11, no. 8, pp. 1446–1456, Dec. 2009. [54] H. S. Hu and Z. W. Li, “Local and global deadlock prevention policies for resource allocation systems using partially generated reachability graphs,” Comput. Ind. Eng., vol. 57, no. 4, pp. 1161–1181, 2009. [55] H. S. Hu and Z. W. Li, “Efficient deadlock prevention policy in automated manufacturing systems using exhausted resources,” Int. J. Adv. Manuf. Technol., vol. 40, no. 5–6, pp. 566–571, 2009. [56] H. S. Hu and Z. W. Li, “An optimal-elementary-siphon based iterative deadlock prevention policy for flexible manufacturing systems,” Int. J. Adv. Manuf. Technol., vol. 38, no. 3–4, pp. 309–320, 2008. [57] H. S. Hu, Z. W. Li, and A. R. Wang, “Mining and controlling flexible manufacturing systems using Petri nets,” Dyn. Continuous, Discrete, Impulsive Syst. B, Appl. Algorithms, vol. 13, pp. 187–191, 2006.
84
IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART A: SYSTEMS AND HUMANS, VOL. 41, NO. 1, JANUARY 2011
[58] J. S. Lee, M. C. Zhou, and P. L. Hsu, “An application of Petri nets to supervisory control for human-computer interactive systems,” IEEE Trans. Ind. Electron., vol. 52, no. 5, pp. 1220–1226, Oct. 2005. [59] Z. W. Li and H. S. Hu, “On systematic methods to remove redundant monitors from liveness-enforcing net supervisors,” Comput. Ind. Eng., vol. 56, no. 1, pp. 53–62, 2009. [60] Z. W. Li and M. Shpitalni, “Smart deadlock prevention policy for flexible manufacturing systems using Petri nets,” IET Control Theory Appl., vol. 3, no. 3, pp. 362–374, 2009. [61] Z. W. Li and M. Zhao, “On controllability of dependent siphons for deadlock prevention in generalized Petri nets,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 38, no. 2, pp. 369–384, Mar. 2008. [62] Z. W. Li, J. Zhang, and M. Zhao, “Liveness-enforcing supervisor design for a class of generalized Petri net models of flexible manufacturing systems,” in Proc. Inst. Elect. Eng.—Contol Theory Appl., 2007, vol. 1, no. 4, pp. 955–967. [63] Z. W. Li, H. S. Hu, and A. R. Wang, “Design of liveness-enforcing supervisors for flexible manufacturing systems using Petri nets,” IEEE Trans. Syst., Man, Cybern. C, Appl. Rev., vol. 37, no. 4, pp. 517–526, Jul. 2007. [64] Z. W. Li and M. C. Zhou, Deadlock Resolution in Automated Manufacturing Systems: A Novel Petri Net Approach. New York: Springer-Verlag, 2009. [65] D. Liu, Z. W. Li, and M. C. Zhou, “Liveness of an extended S3PR,” Automatica, vol. 46, no. 6, pp. 1008–1018, Jun. 2010. [66] A. R. Wang, Z. W. Li, J. Y. Jian, and M. C. Zhou, “An effective algorithm to find elementary siphons in a class of Petri nets,” IEEE Trans. Syst., Man, Cybern. A, Syst., Humans, vol. 39, no. 4, pp. 912–923, 2009. [67] N. Q. Wu and M. C. Zhou, System Modeling and Control with ResourceOriented Petri Nets. New York: CRC Press, 2010. [68] M. M. Yan, Z. W. Li, N. Wei, and M. Zhao, “A deadlock prevention policy for a class of Petri nets S3PMR,” J. Inf. Sci. Eng., vol. 25, no. 1, pp. 167– 183, Jan. 2009. [69] M. Zhao and Z. W. Li, “On deadlock control for a class of generalised Petri net models of flexible manufacturing systems,” Int. J. Prod. Res., vol. 47, no. 21, pp. 6085–6107, 2009. [70] C. F. Zhong and Z. W. Li, “On self-liveness of a class of Petri net models for flexible manufacturing systems,” IET Control Theory Appl., vol. 4, no. 3, pp. 403–410, 2010.
Keyi Xing received the B.S. degree in mathematics from Northwest University, Xi’an, China, in 1982, the M.S. degree in applied mathematics from Xidian University, Xi’an, in 1985, and the Ph.D. degree in systems engineering from Xi’an Jiaotong University, Xi’an, in 1994. He was with Xidian University in 1985. Since 2004, he has been with Xi’an Jiaotong University, where he is currently a Professor of systems engineering with the State Key Laboratory for Manufacturing Systems Engineering and with the Systems Engineering Institute. His research interests include modeling, control, and scheduling of automated manufacturing, discrete-event, and hybrid systems.
MengChu Zhou (S’88–M’90–SM’93–F’03) received the B.S. degree in electrical engineering from the Nanjing University of Science and Technology, Nanjing, China, in 1983, the M.S. degree in automatic control from the Beijing Institute of Technology, Beijing, China, in 1986, and the Ph.D. degree in computer and systems engineering from Rensselaer Polytechnic Institute, Troy, NY, in 1990. In 1990, he joined the Department of Electrical and Computer Engineering, New Jersey Institute of Technology (NJIT), Newark, where he is currently a Professor of electrical and computer engineering and the Director of the Discrete-Event Systems Laboratory. He has over 350 publications, including 10 books, over 150 journal papers, and 17 book chapters. He has led or participated in more than 30 research and education projects with total budget over 10M, funded by the National Science Foundation (NSF), Department of Defense, Engineering Foundation, New Jersey Science and Technology Commission, and industry. His research interests are in Petri nets, computer-integrated systems, wireless ad hoc and sensor networks, system security, semiconductor manufacturing, and embedded control.
Dr. Zhou is a Life Member of the Chinese Association for Science and Technology–USA and served as its President in 1999. He was the Founding Chair of the Discrete Event Systems Technical Committee of the IEEE Systems, Man, and Cybernetics (SMC) Society and the Chair of the Semiconductor Manufacturing Automation Technical Committee of the IEEE Robotics and Automation Society. He was the recipient of the NSF’s Research Initiation Award, the CIM University-LEAD Award by the Society of Manufacturing Engineers, the Perlis Research Award by NJIT, the Humboldt Research Award for U.S. Senior Scientists, the Leadership Award and the Academic Achievement Award by the Chinese Association for Science and Technology–USA, the Asian American Achievement Award by the Asian American Heritage Council of New Jersey, and the Distinguished Lecturer of the IEEE SMC Society. He served as an Associate Editor of the IEEE T RANSACTIONS ON ROBOTICS AND AUTOMATION from 1997 to 2000 and the IEEE T RANSACTIONS ON AUTOMATION S CIENCE AND E NGINEERING from 2004 to 2007 and as the Managing Editor of the IEEE T RANSACTIONS ON S YSTEMS , M AN , AND C YBERNETICS : PART C. He is currently Editor of the IEEE T RANSACTIONS ON AUTOMATION S CIENCE AND E NGINEERING , an Associate Editor of the IEEE T RANSACTIONS ON S YSTEMS , M AN , AND C YBERNETICS : PART A and the IEEE T RANSACTIONS ON I NDUSTRIAL I NFORMATICS, and the Editor-in-Chief of the International Journal of Intelligent Control and Systems. He has served as a Guest Editor for many journals, including the IEEE T RANS ACTIONS ON I NDUSTRIAL E LECTRONICS and the IEEE T RANSACTIONS ON S EMICONDUCTOR M ANUFACTURING.
Feng Wang received the B.S. degree in applied mathematics from Northwest University, Xi’an, China, and the M.S. degree in applied mathematics from Xi’an Jiaotong University, Xi’an, China. She is currently working toward the Ph.D. degree in the Systems Engineering Institute, Xi’an Jiaotong University, Xi’an. She is also currently with the State Key Laboratory for Manufacturing Systems Engineering, Xi’an Jiaotong University. Her main research interests include control and scheduling of manufacturing systems and discrete-event systems.
Huixia Liu received the B.S. degree in applied mathematics from Dalian University, Dalian, China, and the M.S. degree in mathematics from the Harbin Institute of Technology, Harbin, China. She is currently working toward the Ph.D. degree with the Systems Engineering Institute, Xi’an Jiaotong University, Xi’an, China. She is also currently with the State Key Laboratory for Manufacturing Systems Engineering, Xi’an Jiaotong University. Her main research interest includes control and scheduling of automated manufacturing and discrete-event systems, and Petri nets.
Feng Tian received the B.S. degree in industrial automation and the M.S. degree in computer science and technology from the Xi’an University of Architechture and Technology, Xi’an, China, in 1995 and 2000, respectively, and the Ph.D. degree in control theory and application from Xi’an Jiaotong University, Xi’an, in 2003. He has been with Xi’an Jiaotong University since 2003, where he is currently with the State Key Laboratory for Manufacturing Systems Engineering and also with the Systems Engineering Institute, as a Lecturer. He is a member of the Satellite-Terrestrial Network Technology R&D Key Laboratory, Shaanxi Province. His research interests include theory and application of workflow, intelligent control, Petri net, and intelligent distance learning environment.