0% found this document useful (0 votes)
13 views6 pages

Deadlock Analysis of Petri Nets Based On The Resource Share Places Relationship

The paper presents a method for deadlock analysis in Flexible Management Systems (FMS) using Petri nets, focusing on the relationship between resource share places. It introduces a deadlock detection and avoidance algorithm based on structural properties of Petri nets and the transitive matrix. The results include definitions, conditions for deadlock detection, and an illustrative model demonstrating the proposed approach.

Uploaded by

Syed Asad Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

Deadlock Analysis of Petri Nets Based On The Resource Share Places Relationship

The paper presents a method for deadlock analysis in Flexible Management Systems (FMS) using Petri nets, focusing on the relationship between resource share places. It introduces a deadlock detection and avoidance algorithm based on structural properties of Petri nets and the transitive matrix. The results include definitions, conditions for deadlock detection, and an illustrative model demonstrating the proposed approach.

Uploaded by

Syed Asad Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

DEADLOCK ANALYSIS OF PETRI NETS BASED ON THE RESOURCE


SHARE PLACES RELATIONSHIP

Sanghwan Kim'), Sangho Lee'), Jongkun Lee2)


Computer Engineering Dept.) LIS/Computer Engineering Dept.2)
Chungbuk National University Changwon National University
Gaesin-dong 48, Cheungju Salim-dong 9, Changwon,
Chungbuk, Korea Kyungnam, Korea
{ sanghwangdhc.co.kr, shleegchungbuk.ac.kr, jkleegchangwon.ac.krI

Abstract: The Deadlock problem in FMS, occurred many processes.


by the relationship between more than two operations The method for deadlock prevention introduced in
based on the resource share machines or robots, and this paper is based on the structural property that is
buffers. Since a deadlock is a condition in which the considered to be based on Petri nets such as transition
excessive demand for the resources being used by and place invariant. Since this method may detect the
others causes activities to stop, it is very important to deadlock status and avoid schedule in the transitive
detect and prevent a deadlock. In this paper, we study matrix directly, it's easy to find the deadlock property.
the problem of deadlock detection and avoidance by In this paper, we propose a method to analyze the
using the PN model based on the relationship of the deadlock problem and to avoid problem in Petri nets
resource share places for FMS (Flexible Management using the transitive matrix. Since this method may
System). Also, we propose a deadlock detection find the deadlock status and avoid schedule in the
conditions after analyzed the Petri Net used the transitive matrix directly, it's easy to find the
transitive matrix. For presenting the results, the deadlock property.
suggested deadlock detection and avoidance This paper is organized as follows; some definitions
algorithms were also adapted to an illustrated model. of Petri Nets and transitive matrix are given in section
2. Deadlock detect conditions are presented in section
Keywords: avoidance, deadlock, Petri-nets, recovery 3. In section 4, we show a deadlock avoidance policy,
net, transitive matrix and show an illustration model with one example in
section 5.
1. INTRODUCTION 2. PETRI NETS
Deadlock problem is one of the important properties A. Petri Nets
for analyzing the Petri nets. Furthermore, this
problem becomes one of the critical points in the In this section certain terms which are often used in
scheduling problem of FMS (flexible Management the latter part of this paper are [4,7,8].
System). While sharing a limit number of resource
such as machines, robots, and buffers, each product Definition 1: Let PN =(PR, T, 1,0,M) be a Petri
has a particular operation routing that determines the nets,
order in which resources must be assigned to the PR= P u R, where,
product[13]. "Deadlock status" is a status that is P =:p1P21 ..... Ipn : a finite set of Work Places
stopped a flow of a marking because of a wait for a
resource. A confirmation and prevention of a (n > 0)
deadlock status in a system is one of important R = {rl,r2 ........ rm} :a finite set of Resources Sharing
problems. Places (m > 0)
Deadlock usually appears in contain subsystem which T {t t tk } a finite set of Transitions
is run in parallel and resources share places.
To solve these problems, various deadlock analysis (k > 0)
and avoidance methods have been proposed by Pr)R = PrinT = RrnT =
researchers [1-3, 6, 9-12]. However, while many VPe P p|= 1 and |p*= 1
researches on an application of the DES (Discrete
Event System) to need a real time process have been VreR .r-21 and |re21
studied, the proposed studies failed to ease an I: fPR}xT-*N, lisanlnputFunction
understanding and application of a system included

59
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.
IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

0: T x {PR} -* N, 0 is an Output Function through one or more transitions.


C: C = I, C is the incidence matrix
P.O and R.O and T.O Definition 7: Let MPR be the labeled place transitive
matrix. If a transition tk appears s times in the same
Mo E M = {M|M: {PR}*N} NJ , Mo is the initial
marking column of MPR, then we will replace tk in MPR by
N: Set of nonnegative integers tk IS.
Definition 2[14]: A transition tj e T in PN enabled if
M > I( ,t) and may fire yielding the marking Definition 8: Weighted Place Transitive Matrix MPR.
Let MPR be the mx m weighted place transitive
M'=M+C( ,t). We write M[s> M' to denote that the
enable sequence of transitions s may fire at M matrix. If a transition tk appears s times in the same
yielding M'. Finally, we denote so the sequence of column of MPR, then we will replace tk by tkl s in
null length. MPR.
B. Transitive matrix It is represented a control flow to a column direction
of a transitive matrix. Therefore a control flow can be
We recall now some basic definitions of transitive
matrix which are as used in [4,5,11]. known through a value of (tk), where i is a
S

Definition 3: Invariant matrix number of places.


The matrix of PN structure, MPN is MPN = <PR', T, B-,
B+>, where PR':P u R is a set of working places and Definition 9: Relation condition in column
resource sharing places, and T is a set of transitions, Let # (pri , O(tk)) be a number of output value from
respectively. B- and B+ are matrices of m rows by n p1 to transition tk, and # (pr1, E(tk )) be a number of
columns defined by input value from tk to transition pi.
A formal definition of the relation conditions in
B- =[I,j] #(PRj,I(tj)), matrix of input function, column are as follows.
B+ =[I,j] #(PRj,O(tj)), matrix of output function
1) #(pr,O(tk)) =# (pri, E(tk)) >E It is
S
Definition 4: S-Invariant maintained a control scope under a firing of the token
A column-vector xT=(x1,x2,...,x11) > 0 of the tk
homogeneous equation A xT=AM =0 is called a T-
invariant, where xT is x's transpose. An integer
solution y = (yl,y2,. ..,ym)T of the transposed 2) # (pr, 0(tk)) ># (pri, E(tk)) E >1 : It is
S
homogeneous equation Ay = 0 is called a S-invariant. expanded a control scope under a firing of the token
tk
Definition 5: Transitive matrix
Let B- and B+ be an input function matrices and 3) # (pr,O(tk)) <# (pri, E(tk)) > tki < 1 : It is
output function matrix of m rows by n columns in S
Petri nets, respectively. reduced a control scope under a firing of the token
The place and transition transitive matrix are as tk
follows:
MPR = B-(B+)T place transitive matrix It is represented a firing possibility of each transition
MT =(B+)T B- transition transitive matrix to a row in the transitive matrix. Also, a token exist
Through introducing the mxm place transitive matrix, in the resource common place of a row direction.
we can evaluate transition enabling firing, and And we can know whether a firing possible or not
calculate Quantity and Sequence of Transition through a value of E tki because the number of
enabling Firing. s
transitions is represented a row direction of a
Definition 6: Let a reachable marking MlR(K + 1) resource common place is the number of transitions
from M(k) be an m-vector of nonnegative integer. is inputted at the place. So, if a value ofy(k )i
S
The transformation defined by is greater than 1, it is possible to firing.
MR(k+ 1)' = M(k) MPR
Definition 10: Relation condition in row
The elements of MPR describe the direct transferring Let # (pri , O(tk)) be a number of output value from
relation that is from one place to another place p, to transition tk, and # (pi, E(tk)) be a number of

60
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.
IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

input value from tk to transition pi. I


A formal definition of the relation conditions in
column are as follows. P1
P2
1) # (pr, (tk) =# (pri, E(t) 1
S

P4
2) # (pri, O(tk)) ># (pri, E(tk)) 4> 1
p5
S

3) # (pr, O(tk)) <# (pri, E(tk)) => 1


ri
S

r2
Therefore, we can know that the sum of transitions of
a row direction of a transitive matrix is 1 in any case.

If a value of tk( ), is smaller than 1, we can In this MPR, through definition 9 and 10, we can
s obtaine a relationship like as follow table MPR .
know that the Petri net model mistake.
pI p2 p3 p4 P5 p6 rl r2

Definition 11: Deadlock relationship in MPR O 1/2 0 0 0 0 0 0 P1 1


Let MPR be a transitive matrix of PN = (PR,T,I,O,M), O O 1/2 0 0 0 0 0 P2 12
then PN is called a deadlock-free if a relationship in 1 0 0 0 0 0 0 1 P3 2

row(column) of resource share place )2 n, t(k MPR =


O

O
O

O
0

0
0

0
1/2
0
0

1/2
0

1/2
0

0
P4

P5
12

1
where n >1 and integer, else the PN is deadlock. O O 0 1 0 0 0 1 P6 2

O O 1/2 0 1/2 0 0 0 rl

O 1/2 0 0 0 12 12 r2 32
3. DEADLOCK FINE ALGORITHM IN PETRI
NET USING THE TRANSITIVE MATRIX
l 1 2
A. Deadlock . In this table MPR, we can find two jobs like as JI:
pl-p2-p3 and J2:p4-p5-p6, and this relationship is
A deadlock problem is occurred by the conflict place explained one cycle. Also, we can find some
in the net. For example in figure 3.1, two transitions relationship between the resource share places rl and
t2 and t5 are deadlock status by the place MI and M2. r2:

Figure 3.1 Example Petri Nets Case of rl:


-relation condition in row: 1/2+1/2+rl = 2
-relation condition in column: 1/2+1/2= 1

Case of r2:
-relation condition in row: 1/2+1/2+1/2 = 3/2
-relation condition in column: ±1 =2

In r2, relation condition of row is not equal of 1, this


means that the number of token is more less than out
and it's may be occurred a deadlock status. In rl, it
have all conditions of row and column are satisfied
deadlock-free. Finally, this net is deadlock.

By the definition 6, we can consider a reachable


marking as follows:
Table 3.1 MPR of figure 3.1
Mo =[1,0,0,1,0,0,1,1], where
[p1 ,p2,p3,p4,p5,p6,rl ,r2].
Then, the reachable marking M1 is:
M1 = Mo. MPR, then,
M1 = [0, (pl(tl/2) + r2(tl/2)), rl(t2/2), 0, (p5(t4/2) +
rl(t4/2)), r2(t5/2), r2(t5/2), 0].
Since the number of token should be explained by

61
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.
IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

integer value such as equal or greater than zero, we P1

can explain the reachable marking M1 as follows:


M1 = [0, 1, 0, 0, 1, 0, 0,0].
T3

Then next reachable marking is


M2 =M1 MPR
[0,0, p2(t2/2),0,0,p5(t5/2),0,0]
=[0, 0, 0, 0, 0, 0, 0, 0].
In this result, we can find deadlock status occurred in
transitions t2 and t5 by the places rl and r2.
Figure 4.1 Recovery deadlock net
B. Deadlock Detection algorithm
Table 4.1 Transitive matrix MPR' of figure 4.1
We propose a deadlock detection algorithm based
pt p2 p3 p4 p5 p6 rl r2 I
on the previous section.
O tl/2 0 0 0 0 tl/2 0 P1 1

Algorithm: deadlock fine O O t2/2 0 0 0 0 t2/2 P2 /2

Input: N = <P,T,F,M> 3 0 0 0 0 0 0 1 P3 2

Output: N is deadlock free or not O O 0 0 t4/2 0 0 t4/2 P4 1

(1) Define IPR of a Petri net initial N. MPR- O O 0 0 0 t5/2 t5/2 0 P5 I

(2) Find all relation of resource share places in each O O 0 t6 0 0 0 t6 P6 2

O O t2/2 0 t4/2 0 0 t2/2 rl 2


column MPR.
(3) Calculate MR from the initial marking. O tl/2 0 0 0 t52 152 0 r2 2

(4) If they have one deadlock node then this net N is 1 1 1 1 1 1 2 3


deadlock net but if not this net is deadlock free.

4. DEADLOCK AVOIDANCE POLYCE In this MPR, we can obtain a reachable marking as


follows:
A.. Deadlock avoidance
Case of rl:
Since the deadlock status occurs at resource -relation condition in row: 1/2+1/2+1/2+1/2=2
share node, the resource share nodes having -relation condition in column: 1/2+1/2+1/2+1/2 = 2
deadlock status need a token each node for
recovering the deadlock status. Case of r2:
-relation condition in row:
Definition 12: deadlock avoidance policy 1/2+1+1/2+1+1/2+1/2=3
Let 3pi,pj E P be the deadlock nodes at -relation condition in column:
transition ti and tj, respectively ,where 3 ti,tj E 1/2+1/2+1/2+1/2 = 2
T, and these places pi and pj are the resource
share places, pi #pj and ti #tj, ti =pi, tj = pj. In this case, places p2, p5, rl and r2 have a token.
Then, add one input arc to pj at transition ti, We can say that this marking is fire and deadlock
and add one arc to pj at transition tj. free.
ti. = O(pi,ti) u O(pj,ti)
tj = O(pj,tj) u O(pi,tj) B. Algorithm for the Avoidance of the Deadlock
Status
Example:
As shown in figure 3.1, we consider a system with 2 The procedures for the detection and the avoidance
machines such as rl and r2, there are two types jobs of the deadlock status using the resource status table
such as JOB1 and JOB2. Since the location of JOBI in this section 3.1 can be illustrated in the following
does not overlap with that of JOB2 and the starting algorithm.
points exist in each job, JOB1 and JOB2 can be
completed at once. The recovery deadlock net is Algorithm:
summarized in figure 4.1 and a transitive matrix of Input: N = <P,T,F,M>
this example in table 4.1. Output: N is deadlock free or not
(1) Define MPR of a Petri net initial N.
(2) make a marking sequence from the initial place
and resource share place.
(3) if it's not satisfy enable then define that deadlock
status and deadlock node.

62
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.
IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

(4) add one arc to input deadlock status node for and M1,M2 and M3 have not any token for fire. We
another resource share place. can say that this marking is dead at M1.
(5) verify the marking sequence with modified MRP. Based on the avoidance algorithm, we can get an
(6) If this marking sequence accepts fire conditions avoidance PN and transitive matrix like as follows:
then this net will be avoided deadlock status and
stopped, else this is not deadlock status avoidance,
repeat (1) to (4) until satisfy (6). m1P 1Pi i} ~~~~~~~~~~~~~~~~~~~~~~~~~i)

5. ILLUSTRATION MODEL

An FMS example introduced in [12] is represented in


Fig. 5.1. There are 3 machines (MI, M2 and M3),
one robot and two transport devices, also four
operations Job 1, Job 2, Job 3 and Job 4.
Fig. 5.3. Avoidance model of Fig.4.2
Table 5.2. Transitive matrix of Fig.4.3
rI E 0 tl 2 0 0 0 0 0 0 0 0 0 0 0 tll 2 0

I
0 0 0 0 0 0 0 0 0 0 0 0 t2/2 0 0

lis!'i
0 0 t3 2 0 0 0 0 0 0 0 0 0 0 t3l 2 0
0 0 0 t4 0 0 0 0 0 0 0 0 0 0 t4
40 t5 0 0 0 0 0 0 0 0 0 0 0 0

T
0 0 0 0 0 t6/2 0 0 0 0 0 t6l 2 0

KAOI
M3 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
t7/ 2
0
0
t812
0
0
0 0 0 0 0 0 t9 0 0 0 0 0 0 0 t9
0 0 0 0 40 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 tl 1/ 2 0 0 M12 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 t121 2
0 0 0 0 0 0 0 0 t1312 0 0 0 0 t13 2 0
0 0 0 0 0 0 0 0 0 t14 0 0 t14 2 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0
00 0 0 t16 2 0 0 0 t161 2
Figure 5.1 System structure 0
0
0
0
0
0
0
0
00 0
0 0
0
0
0
0
0
0
0
0
0
0
0 0
0 t1812
tl7/ 2
0
0
0
0 0 0 0 0 0 0 0 0 0 0 t19 0 0 t19
0 0 0 0 0 0 0 0 0 0 0

Let's assume that the production ratio is 1/4, which 0 W2 0 0 0 t6/2 0 0 t13 2
0 0 0 0
til20
t6/2
tl7/ 2
0

means that the goal is to manufacture 25% of Jobl 1, 0 0 t2l 2 0 0 0 0 t7/ 2 0 0 0 t12/2 0 0 0 t16/2 0 0
-I
t131 2
t121 2

Job 2, Job 3 and Job 4. We define that the incorporate 0 0 0 t3 2 0 0 0 0 0 0 M12 0 0 0 0 0 0 t1812 0
t7/2
tll /: t3l 2
t161 2
0

alternative process plans as follows:


tlgl,.

Job 1: {M1,M2,M3}
Job 2: {M2,M1,M3}
Job 3: {M1,M2,M3}
Job 4: {M3,M2,M1}
The PN representation of system is as follows:

, IJA----
F

Fig. 5.4. Running process of Fig. 5.3


In this figure, we can find that modified model has
not deadlock status and this model is bounded. Also,
we use Visual Object Net ++ (Evaluation Version
It S -
{. t
1.44.2) to verify the proposed model is not deadlock..
B. Algorithms for the Avoidance of the Deadlock
Status
Fig. 5.2. Illustrative example: 3machines and 4
jobs The procedures for the detection and the avoidance
First, the initial tokens are in MI, M2, M3, pl,p6 and of the deadlock status using the resource status table
p12. In this case, places p2, p12, p17 have a token

63
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.
IMACS Multiconference on "Computational Engineering in Systems Applications"(CESA), October 4-6, 2006, Beijing, China.

in Chapters 5.1 can be illustrated in the following [7]Murata T.(1989). Petri Nets: Properties, Analysis
algorithm. an Applications, Proceedings of the IEEE, 77(4),
IEEE,USA pp. 541-580.
Algorithm: [8] Peterson JLv(1981), Petri Net Theory and the
Input: N = <P,T,F,M> Modeling of Systems, Englewood Cliffs, NJ
Output: N is deadlock free or not Prentice-Hall, Inc.,.
(1) Define MPR of a Petri net initial N. [9]Shatz SM.,Tu S.,Murata T(1996). An application
(2) make a marking sequence from the initial place of Petri net reduction for Ada Tasking Deadlock
and resource share place. Analysis, In: IEEE Trans. on Parallel and Distributed
(3) if it's not satisfy enable then define that deadlock Systems, Vol. 7, No. 12, pp. 1307-1322
status and deadlock node. [10] Xiong HH,Zhou MC.(1997), Deadlock free
(4) add one arc to input deadlock status node for scheduling of an automated manufacturing system
another resource share place. based on Petri nets",In IEEE ICRA'97,pp.945-950
(5) verify the marking sequence with modified MPR. [1 1]Lee J.(2004). Deadlock find algorithm using the
(6) If this marking sequence accepts fire conditions Transitive Matrix", In: Proceeding CIE'04
then this net will be avoided deadlock status and [12]A.Giua,et elc.,(2004), observer-Based state-
stopped, else this is not deadlock status avoidance, feedback control of timed Petri nets with deadlock
repeat (1) to (4) until satisfy (6). recovery, In: IEEE Trans. on Automatic control, Vol.
49, No. 1, pp. 17-29
[13]X.Ke-Yi, Hu BS, Chen HX(1996), Deadlock
6. CONCLUSION Avoidance Policy for Petri net Modeling of Flexible
Manufacturing Systems with Shared resources, , In:
In this paper, we focused on the avoidance policy of IEEE Trans. on Automatic control, Vol. 41, No. 2,
the deadlock problem in Petri nets using the pp.289-295
transitive matrix. The transitive matrix explained all [14] F.basil,A.Giua,C.Seatzu,(2003) Observer-based
relationship between the places and transitions in the state-feedback control of time Petri nets with
net. By these relationships, we can find deadlock deadlock recovery: theory and implementation, In
status based on the relation between the resource Proceed. Of Symp. On Discrete events in Industrial
share places. Finally, it can be said that this method and manufacturing systems, CESA2003.
is very easy to find the deadlock status and modify
the deadlock status in the net. In this work, we
showed very simple example for guaranty about to
find and to avoidance deadlock in ordinarily Petri
nets. In near future we will study to find and
avoidance the deadlock problem in General Petri nets
using the transitive matrix and to deadlock avoidance
problem on the cyclic scheduling in FMS.

REFERENCES
[I]Corbett JC(1996), "Evaluating Deadlock detection
methods for concurrent software", IEEE tr. Sof. Eng.
Vol.22(3),pp. 161-180
[2]Damasceno BC. And Xie X.(1999) Petri nets and
deadlock-free scheduling of multiple-resource
operations, In IEEE SMC'99,pp.878-883
[3] Ezpleta J.,Colom JM,Martinez J.(1995), A Petri
net based deadlock prevention policy for flexible
manufacturing systems, IEEE tr. Robotics and
Automat., Vol. I I,no.2,pp.173-184
[4]Liu J.,Itoh Y., Miyazawa I., Seikiguchi T.,(1999).
A Research on Petri nets Properties using Transitive
matrix, In: Proceeding IEEE SMC99,pp.888-893
[5]Lee J., Korbaa 0.(2006). Scheduling analysis of
FMS:An unfolding time Petri nets approach,
mathematics and Computer simulation, 70, pp. 419-
432
[6]Melzer S. and Romer S.(1997). Deadlock
checking using net Unfoldings, In Proc. of the Conf
on Computer-Aided Verfication (CA V'97)

64
Authorized licensed use limited to: ULAKBIM UASL - Bilkent University. Downloaded on August 06,2023 at 03:50:18 UTC from IEEE Xplore. Restrictions apply.

You might also like