You are on page 1of 26

Discrete Event Dyn Syst

DOI 10.1007/s10626-012-0132-4

An algorithm to compute the minimal siphons


in S4 PR nets
Elia Esther Cano Carlos A. Rovetto
Jos-Manuel Colom

Received: 11 March 2011 / Accepted: 26 January 2012


Springer Science+Business Media, LLC 2012

Abstract Minimal siphons in the class of S4 PR nets have become a conceptual


and practical central tool for the study of the resource allocation related aspects
in discrete event dynamic systems as, for example, the existence of deadlocks.
Therefore the availability of efficient algorithms to compute the minimal siphons
is essential. In this paper we try to take advantage of the particular properties of
the siphons in S4 PR to obtain an efficient algorithm. These properties allow us to
express minimal siphons as the union of pruned minimal siphons containing only one
resource. The pruning operation is built from the binary pruning relation defined
on the set of minimal siphons containing only one resource. This pruning relation is
represented by means of a directed graph. The computation of the minimal siphons is
based on the maximal strongly connected components of this graph. The algorithm is
highly economic in memory in all intermediate steps when compared to the classical
algorithms.
Keywords Petri-nets Structural analysis Siphons Graph theory
Strongly connected component

E. E. Cano (B) C. A. Rovetto


Computer Systems Engineering Department, Technological University of Panama,
Panama City, Panama
e-mail: elia.cano@utp.ac.pa
C. A. Rovetto
e-mail: carlos.rovetto@utp.ac.pa
J.-M. Colom
Aragn Institute of Research Engineering (I3A), University of Zaragoza, Zaragoza, Spain
e-mail: jm@unizar.es

Discrete Event Dyn Syst

1 Introduction
The analysis of resource allocation related aspects is a precondition for the design
and control of many Discrete Event Dynamic Systems. Examples of this kind of
systems, where the Resource Allocation Systems (RAS) view is a phase of the
design, can be found in the context of Flexible Manufacturing Systems, Software
Engineering applications, Workflow Systems, Logistic Systems, etc.
The RAS analysis of a system requires an abstraction process in order to retain
only those aspects relevant to the representation of the resource allocation. The
formulation of this abstraction of this application-driven problem in terms of Petri
nets has been a successful approach in many fields (Reveliotis 2005; Ezpeleta
et al. 1995; Li and Zhou 2009; Lopez-Grao and Colom 2010; Wang et al. 2009b),
leading to several subclasses of Petri Net models, with a specific structure-based
characterization. The subclass of S3 PR nets is probably the most widely studied in the
literature even today. In this subclass, the liveness property has been characterized
in terms of some siphons of the net (Reveliotis 2005; Ezpeleta et al. 1995). Also
the synthesis of live S3 PR models (named liveness enforcing by some authors) is
based on techniques that, in many cases, require to know the bad siphons of the net
(Reveliotis 2003; Tricas et al. 2005). Therefore, the availability of efficient algorithms
for the computation of all minimal siphons or other sets of siphons is indispensable
in the frameworks working with this kind of Petri Net models.
Many algorithms, for the computation of minimal siphons, have been proposed in
the past years (Chao 2009; Li et al. 2008; Xing et al. 2011); all specifically designed
for the class S3 PR. This means that they profit from the particular structure of S3 PR
to obtain good performance in the computation of the set of minimal siphons.
S4 PR is a more general class that strictly contains the class S3 PR (Tricas 2003;
Colom 2003). In a similar way to the S3 PR class, in the case of S4 PR nets, the liveness
property has also been characterized in terms of some siphons of the net (Reveliotis
2005; Tricas 2003); and the synthesis of live S4 PR models is strongly related, in
many cases, to the bad siphons of the net (Reveliotis 2003; Tricas et al. 2005).
Therefore, efficient algorithms are also needed for calculating minimal siphons of
S4 PR nets. But in this case there are not specific algorithms exploiting the structural
characteristics of S4 PR nets as in the case of S3 PR nets. Moreover, the algorithms
for the S3 PR class cannot be applied to the class S4 PR because of the strict structural
constraints imposed to S3 PR nets. For example, an active process in a S3 PR net
uses only one resource in each reachable state. This constraint does not appear in
S4 PR. To point out the important differences between S3 PR and S4 PR, observe, for
example, that the number of resource-transition circuits (MPCs) for S4 PR nets (Xing
et al. 2011) can be a combinatorial number with respect to the number of resources
making non acceptable the performance of the algorithm if we try (assuming that this
is possible) to adapt the S3 PR algorithm (Xing et al. 2011) to S4 PR nets. Additionally,
as we will see, there exist S4 PR nets without resource-transition circuits (see Fig. 9).
Therefore, algorithms (as that presented in Xing et al. 2011) to compute siphons in
S4 PR based on this concept are non viable.
Therefore, for S4 PR, the algorithms that can be applied for the computation of
minimal siphons are those applied to general Petri Nets (Barkaoui and Lemaire
1989; Chu and Xie 1997; Ezpeleta et al. 1993; Lautenbach 1987; Li and Zhou 2008;
Wang et al. 2009a) All these algorithms work operating with the places and the

Discrete Event Dyn Syst

transitions of the net. Many of these algorithms are related to the problem of the
computation of the extremal directions of a positive convex cone and they are based
on variants of the FourierMotzkin elimination method for solving systems of linear
inequalities (Williams 1986). In these methods the basic idea is to eliminate variables
from the system of inequalities by adding to them all the inequalities resulting from
positive linear combinations of pairs of inequalities, and removing those used to
compute the new inequalities. The method proceeds by eliminating all the variables
and memorizing, for each final inequality, the coefficients of the positive linear
combination of rows which generated it. These coefficients determine which places
belong to a siphon. The computational difficulty of the method lies in the large
number of inequalities added in the process of eliminating variables. Many of them
are redundant and can be discarded. The different variants published (Colom and
Silva 1991) seek the common goal of breaking the growth of the new inequalities by
eliminating the redundant ones by means of sophisticated heuristics. In any case, the
resulting reported algorithms are prohibitive from the point of view of the occupation
of memory even for relatively small examples.
There are other algorithms that also apply to general Petri nets but are based
on other principles non-related to the Fourier-Motzkin elimination method. For
example in Cordone et al. (2005) an algorithm based on search problems constructed
around place constraints is presented. The complexity is exponential with respect to
the number of places of the net and the algorithm presented in this paper is also
exponential but with respect to the number of resources places.
In this paper we propose a new algorithm that works with objects of higher
level than the places and transitions allowing a greater efficiency, at least, in the
occupation of memory in the intermediary steps. These higher level objects are the
minimal siphons of the net that contain only one resource. The existence of one of
these minimal siphons for each resource of the net is guaranteed by the definition
of the class (it requires one minimal p-semiflow per resource). We will prove
additionally that for each subset of resources there exists, at most, a minimal siphon
containing these resources. Therefore, our algorithm proposes the construction of
each minimal siphon by means of a union of the minimal siphons with one resource
corresponding to the resources included in the siphon to be constructed. The result
of this union is a siphon, but non-minimal, in general. For this reason we introduce
a pruning relation on the set of minimal siphons with a resource used to construct
the new siphon, in order to remove the non-essential places of each minimal siphon
with a resource. The representation of the pruning relation by means of a graph,
allows us to obtain the minimal siphons by computing and manipulating maximal
strongly connected subgraphs of the graph of the relation (its strongly connected
components). Therefore, the required memory is very small and of the order of the
size of the pruning graph.
The paper is organized as follows. Section 2 presents the basic notions and
notations used throughout the paper. Section 3 introduces the definition and basic
results concerning the S4 PR class of nets. Section 4 presents some properties of
siphons in S4 PR nets. Section 5 is devoted to the definition of the pruning relation
and the representation in terms of graphs. Section 6 presents the main result of the
paper, the characterization of minimal siphons in terms of the pruning graph, and
an algorithm for the computation of the set of minimal siphons. Finally in Section 7,
some conclusions are given.

Discrete Event Dyn Syst

2 Petri nets: basic definitions


We assume that the reader is familiar with basic Petri net concepts (see for example
Murata 1989). In the following we present the main notation used throughout the
paper.
A place/transition net (P/T net) is a 3-tuple N = P, T, W, where W is a total
function W : (P T) (T P) N, being P, T non-empty, finite and disjoint sets.
Elements belonging to the sets P and T are called respectively places and transitions,
or generally nodes. P/T nets can be represented as a directed bipartite graph, where
places (transitions) are graphically denoted by circles (rectangles): let p P, t T,
u = W( p, t), v = W(t, p), there is a directed arc, labelled u (v), beginning in p (t) and
ending in t ( p ) iff u  = 0 (v  = 0).
The preset (postset) or set of input (output) nodes of a node x P T is denoted
by x (x ), where x = {y P T | W(y, x)  = 0} (x = {y P T | W(x, y)  = 0}).
The preset (postset) of a set of nodes X b ag(P) b ag(T) is denoted by X (X ),
where X = {y | y x, x X} (X = {y | y x , x X}
A generalized P/T net is a net with positive arc weights. If the arc weights are
unitary (i.e., W can be defined as a total function (P T) (T P) {0, 1}) the
net is called ordinary. A state machine is an ordinary net such that for every transition
t T, | t| = |t | = 1.
A self-loop place p P is a place such that p p . A pure P/T net (also selfloop free P/T net) is a net with no self-loop places. In pure P/T nets, the net can be
also defined by the 3-tuple N = P, T, C, where C is called the incidence matrix,
C[ p, t] = W( p, t) W(t, p).
A marking m of a P/T net N is a vector IN|P| , assigning a finite number of marks
m[ p] (called tokens) to every place p P. Tokens are represented by black dots
within the places. The support of a marking, m, is the set of places which are
marked in m, i.e. m = { p P | m[ p]  = 0}.
We define a marked P/T net (also P/T net system) as the tuple N , m0 , where N
is a P/T net, and m0 is a marking for N , also called initial marking. N is said to be the
structure of the system, while m0 represents the system state.
Let N , m0  be a marked P/T net. A transition t T is enabled (also firable)
iff p t , m0 [ p] W( p, t), which is denoted by m0 [t. The firing of an enabled
transition t T changes the system state to N , m1 , where p P , m1 [ p] =
m0 [ p] + C[ p, t], and is denoted by m0 [tm1 . A firing sequence from N , m0  is a
non-empty sequence of transitions = t1 t2 ... tk such that m0 [t1 m1 [t2  ... mk1 [tk .
The firing of is denoted by m0 [ mk . We call the firing count vector of to
be the Parikh mapping IN|T| (i.e. [t] is equal to the number of times t appears
in ). The support of is denoted by  .
A marking m is reachable from N , m0  iff there exists a firing sequence such
that m0 [ m. The reachability set RS(N , m0 ) is the set of reachable markings, i.e.
RS(N , m0 ) = {m | , m0 [ m}.
A transition t T is live iff for every reachable marking m RS(N , m0 ), m
RS(N , m) such that m [t. The system N , m0  is live iff every transition is live.
Otherwise, N , m0  is non-live. A transition t T is dead iff there is no reachable
marking m RS(N , m0 ) such that m[t. In the system N , m0  a reachable marking
m is a total deadlock iff every transition is dead at m, i.e. no transition is firable
from m.

Discrete Event Dyn Syst

A p-semif low (t-semif low) is a vector Y IN|P| , Y  = 0 (X IN|T| , X  = 0), which


is a left (right) annuler of the incidence matrix, i.e., Y C = 0 (C X = 0). The support of a p-semiflow (t-semiflow) is denoted Y (X), and its places (transitions)
are said to be covered by Y (X). The P/T net N is conservative (consistent) iff every
place (transition) is covered by a p-semiflow (t-semiflow). A minimal p-semif low
(minimal t-semif low) is a p-semiflow (t-semiflow) such that the g.c.d of its non-null
components is one and its support Y (X) is not a strict superset of the support
of another p-semiflow (t-semiflow).
A siphon in a Petri Net is a structural object defined as a non-empty subset of
places, D, such that D D . They are connected via transitions in such a way that
if there are not tokens inside the places then it is not possible that they gain tokens
coming from the rest of the net. A siphon D is said to be minimal iff it does not
contain another non-empty siphon as a proper subset. The removal of a place from
a minimal siphon with at least two places yields a subset of places that neither is, nor
can contain a siphon.
A path of a P/T net N is a sequence of nodes = x1 x2 ... xn such that the odd
components are places and the even components transitions, or vice-versa, and for
every pair (xi , xi+1 ), W(xi , xi+1 )  = 0. An elementary path is a path such that i, j
[1, n] , xi  = x j, except for x1 = xn (which is allowed). A general circuit is a path such
that x1 = xn . An elementary circuit (or simply circuit) is both an elementary path and
a general circuit.

3 The subclass of S4 PR nets


The following is the formal definition of the S4 PR class (Tricas 2003).
Definition 1 The class of S4 PR nets.
Let IN = {1, 2, ..., m} be a finite set of indices. An S4 PR net is a connected
generalised self-loop free Petri net N = P, T, C where:
1.

2.
3.
4.
5.

P = P0 PS P R is a partition such that:



(a) PS =  iIN PSi , PSi  = and PSi PS j = , for all i  = j.
(b) P0 = iIN { p0i }.
(c) P R = {r1 , r2 , . . . , rn }, n > 0.

T = iIN Ti , Ti  = , Ti T j = , for all i  = j
For all i IN , the subnet Ni generated by PSi { p0i } Ti is a strongly connected
state machine, such that every cycle contains p0i .
For each r P R there exists a minimal P-Semiflow, yr IN|P| , such that {r} =
||yr || P R , yr [r] = 1, P0 ||yr || = , and PS ||yr ||  = .
PS = rP R (||yr || \ {r}).

Places of PS are called process places. Each place p0i is called idle place, and
represents the state in which the corresponding processes are idle. Each strongly
connected state machine in Definition 1.3 models a sequential process competing for
shared resources represented by means of the so called resource places belonging
to the set P R . For a given resource, r, the holders of r is the set of process places

Discrete Event Dyn Syst

using a copy 
of r : Hr = ||yr || \ {r}. The holders of a set of resources A P R , is
the set H A = rA Hr . This definition must be completed with the definition of the
acceptable initial markings (Colom 2003; Tricas 2003): initial markings representing
no activity in the system and allowing the execution of a single sequential process in
isolation. Sometimes we will refer to active processes as tokens in process places, i.e.
tokens in one of the state machines outside of its corresponding idle place.
Definition 2 Let N = P0 PS P R , T, C be a S4 PR net. An initial marking m0 is
acceptable for N if and only if:
1. i IN , m0 [ p0i ] > 0.
2. p PS , m0 [ p] = 0.
3. r P R , m0 [r] max{yr [ p] | p ||yr || \ {r}}.
Given a marking m in a S4 PR net, a transition t is said to be m-process-enabled
(m-process-disabled) iff it is (not) enabled by its input process place, and m-resourceenabled (m-resource-disabled) iff all (some) input resource places (place) have (has
not) enough tokens to fire it.
The following theorem presents a liveness characterization for S4 PR nets that is
fully behavioural.
Theorem 1 (Colom 2003; Tricas 2003) Let N , m0 , N = P0 PS P R , T, C be
a marked S4 PR. The system is non-live if and only if there exists a marking m
RS(N , m0 ) such that the set of m-process-enabled transitions is non-empty and each
one of these transitions is m-resource-disabled.
Theorem 1 relates non-liveness to the existence of a marking where active
processes are blocked. Their output transitions need resources that are not available.
This suggests that there exists a set of circular waits between the blocked processes.
This concept of circular waits is captured in the model by the existence of a
siphon (a structural cause for non-liveness in Petri Net terms) whose resource
places are the places preventing the firing of the process-enabled transitions. The
following theorem characterizes non-liveness in terms of siphons, establishing the
bridge between behaviour and model structure of the Petri Net.
Theorem 2 (Colom 2003; Tricas 2003) Let N , m0 , N = P0 PS P R , T, C be a
if, and only if, there exists a marking m RS(N , m0 )
marked S4 PR. The net is non-live

and a siphon D such that pPS m[PS ] > 0 and the f iring of each m-process-enabled
transition is prevented by a set of resource places belonging to D. Moreover, the siphon
D is such that:
D R = D P R = {r P R |t r such that m[r] < Pre[r, t] and m[ t PS ] > 0}  =
;
2. DS = D PS = { p H D R |m[ p] = 0}  = .

1.

A siphon D and a marking m RS(N , m0 ) verifying the properties of Theorem 2


will be said to be a bad siphon and a D-deadlocked marking, respectively.

Discrete Event Dyn Syst

Definition 3 (Tricas 2003) Let N , m0 , N = P0 PS P R , T, C be a marked


S4 PR. Let D be a siphon of N . Then, T h D = H D R \ DS is the set of thieves of D.1
The previous definition represents the places of the net that use resources of the
siphon and do not belong to it.
The following liveness characterization establishes that when a S4 PR is not live,
there exists a D-deadlocked marking such that all the active processes are stealing
tokens from the set of resources of an associated siphon D called bad siphon.
Theorem 3 (Tricas 2003) Let N , m0 , N = P0 PS P R , T, C, be a marked
S4 PR. The net is non-live if, and only if, there exists a siphon D, and a marking
m D RS(N , m0 ) such that:
1. m D [PS ] > 0.
2. m D [PS \ T h D ] = 0.
3. p T h D R such that m D [ p] > 0, the f iring of each t p is prevented by a set of
resource places belonging to D.
From the previous results it is obvious that siphons play an important role in
the analysis of the liveness property in S4 PR nets. Moreover, the liveness enforcing
techniques developed for S4 PR (Reveliotis 2003; Tricas et al. 2005) also use the
siphons of the net. Therefore, this is the motivation for the study of the properties
of siphons for this subclass of nets and the development of more efficient algorithms
for their computation exploiting these properties.

4 Properties of the siphons of S4 PR nets


In the case of S4 PR nets, the definition of the class imposes strict constraints on the
structure, and in particular on the resource places. Therefore, the siphons in S4 PR
have a particular structure with nice properties. This first lemma states that a siphon
containing resource places must contain process places.
Lemma 1 Let N be a S4 PR net and D P a siphon of N . D P R  = = D
PS  = .
Proof We prove this result by contradiction. Let us suppose that D  = is a siphon
of N such that D PS = . Let C be a directed circuit in the state machine k of
N such that C = t0 t1 tu , t0 ( p0k ) , k IN , t j (t j1 ) for all j {1, . . . , u 1},
C
t0 = tu , and C = {t0 , t1 , . . . , tu }. Let D
be the set of input transitions of the places in
C
= D C . At least one of the
D belonging to the directed circuit C of N , that is, D
C
sets D , for some directed circuit of some state machine, is non-empty because the
siphon is non-empty. Using the ordering imposed in the transitions of the directed
C
C
circuit C , we can order the transitions of the set D
. Let t D
be the last transition
according to this ordering, and r D the resource such that t r. Because D is a
siphon containing only resource places, there exists another resource place r D

1 Sometimes

is used T h D R to show the relation among these two sets.

Discrete Event Dyn Syst

such that t (r ) . Moreover, there is no transition, t , after t in the circuit C , such


C
that t r because t is the last transition of the set D
in the circuit. Therefore, if
we construct the minimal p-semiflow corresponding to the resource place r , to annul
the columns in the incidence matrix corresponding to the transitions in the circuit C ,
from t until the transition tu , we need the output process places of these transitions,
including the idle place. But this contradicts the hypothesis that N is a S4 PR net,
where each resource belongs to a minimal p-semiflow that does not include the idle
place.


The reciprocal of this lemma is not true, because each subnet Ni (Definition 1.3)
generated by PSi { p0i } Ti is a strongly connected state machine, and therefore is
a minimal siphon that does not contain resource places.
Lemma 2 Let N be a S4 PR net and D P a non-empty minimal siphon of N
containing at least one resource place. D is the unique minimal siphon of N containing
exactly the set of resources D R = D P R .
Proof We will prove this result by contradiction. Let us suppose that there exist two
minimal siphons D and D such that D  = D and D R = D P R = D P R  = . Let
0 be the set of input transitions to the resource places belonging to D R such that they
do not have input places belonging to D R , i.e. 0 = {t T | t D R , t D R = }.
The set 0 must be non-empty, since 0 = implies that D R must be a siphon and
this is not possible according to Lemma 1. Taking into account that D and D are
minimal siphons of N , for all t 0 there exists p D PS and p D PS such
that p t and p t. But p and p are process places belonging to the same state
machine containing the transition t, therefore p = p . Let DS0 be the set of process
places belonging to both siphons that are input places to the transitions of the set 0 .
Moreover, if p DS0 , there exists a resource place r D R such that p ||yr ||, i.e. p
is a holder place of some r D R . Let 1 be the set of input transitions to the places
belonging to D1 = D R DS0 such that they do not have input places belonging to
D1 , i.e. 1 = {t T | t D1 , t D1 = }. Now, two cases must be distinguished,
1 = .
1  = .

In this case we have proven that for all t D1 = t D1 , that is, D1 is a


siphon. We have also proven that D1 D and D1 D , contradicting the
minimality of D and D . Therefore, D = D = D1 .
In this case t 1 = t DS0 , and for the same reasons stated previously
for the transitions in 0 , there exists a process place q belonging to both
siphons D and D such that q t. Moreover, if the place p t DS0
belongs to the support of the p-semiflow yr , for some r D R , then q ||yr ||.
Therefore, we will obtain the sets DS1 and D2 = D R DS0 DS1 as in the
case of the set 0 . We can iterate this procedure a finite number of times, k,
reaching a set k = . In effect, from the iteration j to the iteration j + 1 we
are making a backward propagation from each place p DS j to a place
q DS j+1 if and only if j p  = . Both places p and q belong to the
support of a p-semiflow yr of a resource r D R . Therefore, this backward
propagation from each place p DS0 always finishes in a place q (r )
in at most k iterations, where k is the maximal length of a sequence of
process places of yr , r D R , in the same state machine. In this case we

Discrete Event Dyn Syst

have proven that for all t Dk = t Dk , that is, Dk is a siphon. We


have also proven that Dk D and Dk D , contradicting the minimality
of D and D . Therefore, D = D = Dk .


From Lemma 2, given a S4 PR net, N , its set of minimal siphons, generally, can be
partitioned into |P R | + 1 classes, each one characterized by the number of resources
belonging to each siphon in the class. We will denote the partition of the set D of
|P |
the minimal siphons of N into classes as D = i=0R Di ; where Di is the subset of
minimal siphons such that each one contains exactly i resource places; and for all
i, j {0, 1, . . . , |P R |} with i  = j, Di D j = .
The partition of the minimal siphons into the set of classes Di does not mean
that we must have at least one siphon in each class. For example the net of Fig. 1
has 6 resource places but we have only four minimal siphons containing more
than 1 resource. The following is the list of minimal siphons of the net of Fig. 1:
{P, j}, {S, h, d}, {T, i, c}, {R, a, f }, {U, b , e, m}, {Q, k, l, g}, {R, U, b , f, m}, {Q, R, U,
b , g, k, m}, {P, Q, S, T, U, d, e, g, i, k, m}, {P, Q, R, S, T, U, d, g, i, k, m}. That is, in
the class D1 we have 6 minimal siphons and in the classes D2 , D3 , D5 and D6 we have
only 1 siphon per class. That is, any of the possible classes can be empty as in this case
happens with D4 . This is the major difficulty in order to construct efficient algorithms

Fig. 1 A S4 PR net without minimal siphons in the class D4 (the idle places are omitted to simplify
the drawing)

Discrete Event Dyn Syst

for the computation of the minimal siphons that proceeds in an incremental way from
a class Di to the class Di+1 using only the minimal siphons of the class D1 .
Class D0 is completely characterized by Definition 1, so that it does not need to
be computed. In effect, the only minimal siphons containing zero resources are the
sets of places of the strongly connected state machines defined in the net, i.e. D0 =
{PSi { p0i } | i IN = {1, 2, ..., m}}.
On the other hand, the class D1 of the minimal siphons containing only one
resource can be directly obtained from the set of minimal p-semiflows associated
to the resources.
Lemma 3 Let N be a S4 PR net. For each r P R there exists a minimal siphon, Dr
D1 , such that Dr ||yr ||.
Proof Let r P R be a resource place, trivially, the support of the minimal psemiflow associated to r, yr IN|P| , is a siphon of the net. This is because yr is a
p-semiflow and in order to annul each column of the incidence matrix corresponding
to a transition, t, in the set (||yr ||) (||yr ||) we need at least one input place and
one output place of t since the net is strongly connected. This means that (||yr ||) =
(||yr ||) , i.e. ||yr || is a siphon. Nevertheless, in general, ||yr || is not a minimal siphon,
but it contains a minimal siphon Dr . We prove that r Dr by contradiction. Let
us suppose that r  Dr . Since r is the only resource in ||yr || and ||yr || P0 = , the
subnet generated by Dr is a set of directed paths in the strongly connected state
machines of N , such that for each path there exists at least a transition without input
places and then Dr cannot be a siphon, contradicting the hypothesis.



In Fig. 2a the reader can observe that the support of the minimal p-semiflow of
r, ||yr || = {r, b , c}, is a siphon but it is not minimal because it contains the minimal
siphon {r, c}. This kind of siphons cannot be present in the class of S3 PR nets. Each
minimal siphon of D1 is contained in the support of the corresponding minimal
p-semiflow, and this minimal siphon is unique (Lemma 2). In other words, the
cardinality of D1 is equal to |P R | and each minimal siphon is obtained from the psemiflow, possibly removing some places to make it minimal.
i
For the rest
 of the classes, D and i > 1, the only thing we can say a priori is
|P R |
, that is, the number of minimal siphons containing i resources
that |Di |
i
is bounded by the number of subsets of i places of the set P R .
From the above discussions, the following trivial lemma states lower and upper
bounds of the number of minimal siphons of a S4 PR net. These bounds cannot be
improved because there exist nets with a number of minimal siphons equal to each
one of the bounds. For example, the nets in Fig. 2a and b have a number of minimal
siphons equal to the lower and to the upper bound, respectively, specified in the
following lemma.
Lemma 4 Let N be a S4 PR net. The number of minimal siphons of N , n D , satisf ies,
n I + n R n D n I + 2n R 1, where n I is the number of strongly connected state
machines of N , and n R = |P R |.

Discrete Event Dyn Syst

(a)

(b)

Fig. 2 a The minimal siphon {c, r} is strictly contained in the support of the minimal p-semiflow yr ;
b A S4 PR net with a number of minimal siphons equal to the upper bound of Lemma 4

The upper bound cannot be improved even in the simplest subclass of S4 PR: the
L S3 PR subclass (Ezpeleta et al. 1998). In effect, the net in Fig. 3 is a L S3 PR
net with 3 resources and the number of minimal siphons is equal to 11.
The next lemma presents a technical result stating that a minimal siphon containing a set of resources D R  = , is always contained into the union of the minimal
siphons Dr D1 , r D R .

Fig. 3 A Petri Net belonging


to the subclass L S3 PR

Discrete Event Dyn Syst

Lemma
5 Let N be a S4 PR net, D P a minimal siphon of N and D R = D P R  =
. D rD R Dr , Dr D1 .

Proof D = rD R Dr , Dr D1 , is a siphon because each Dr is also a siphon. Let
us suppose that D  D . This means that there exists, at least, a process
 place p
D Ps such that p  D . Moreover, p  Dr , r D R , because D = rD R Dr . D is
a minimal siphon, therefore the place p is essential for the siphon D, i.e. there exists
t p such that t D = { p} and t D  = . Let q be a place such that q t D.
If q is a resource place, then the place p is essential for the minimal siphon Dq ,
but this contradicts the previous result saying that p  Dr , r D R . If q is a process
place, because of the minimality of D, q is essential for D and we can reapply the
previous reasoning on p but for q. Iterating the scheme we have constructed a path
ptq... until we reach a resource place x D, and in a similar way to the case where
q is a resource place we conclude that p is essential for the siphon Dx , contradicting
the
 previous result1 saying that p  Dr , r D R . Therefore, we conclude that D


rD R Dr , Dr D .
From the two previous results, the following lemma can be trivially obtained.
Lemma
6 Let N be a S4 PR net, D P a minimal siphon of N and D R = D P R  =
. D rD R ||yr ||.
The next lemma proves that is not possible to find idle places belonging to a
minimal siphon with resources.
Lemma 7 Let N be a S4 PR net and D P a non-empty minimal siphon of N
containing at least one resource place. D P0 = .

Proof According to Lemma 6, D rDr ||yr ||, where D R = D P R . By the
4
definition
of

 S PR nets, P0 ||yr || = , for all r P R . Therefore, D P0


rDr ||yr || P0 = .
This last result allows to remove the idle places from the net before the start of
the computation of the minimal siphons, reducing the size of the input.

5 The binary pruning relation on the set of minimal siphons with only one resource
The proposed algorithm, presented in this paper, to compute minimal siphons in
S4 PR nets is mainly based on Lemma 2. That is, given a set of resources D R P R
there exists at most one minimal siphon containing this set of resources. Therefore, in
order to compute all minimal siphons we need to consider at most 2|P R | 1 candidate
subsets, each one containing a different non-empty subset of resources. An easy way
to construct each one of these 2|P R | 1 candidate siphons is by the union of the
minimal siphons of D1 corresponding to the resources included in the siphon to be
constructed.
Obviously, the result of this union operation is a siphon because each one of the
operands is a siphon, but, in general, it is not minimal. This non-minimality can arise

Discrete Event Dyn Syst

from process places, p, that become non-essential for the resulting siphon, i.e. there
are other input places to the transitions p in the resulting siphon that allow us to
remove p. The input places of the transitions p in the resulting siphon, making p
non-essential, are resource places because process places belong to state machines.
The other source of non-minimality appears when none of the places of a siphon
Dr D1 becomes non-essential. In this case, the full minimal siphon Dr is contained
in the resulting siphon from the union operation, and therefore this last one will be
non-minimal. Moreover, in this case, there is not a minimal siphon containing the
intended set of resources because, at least, one of them: r, cannot belong because
Dr is contained. In the net of Fig. 1 is possible to find examples of the previously
described scenarios. In effect, any siphon containing four resources is non-minimal
because at least a minimal siphon containing one of its resources is completely
contained. On the other hand, in the siphon resulting from the union of the minimal
siphons of R and U, the process places a and e become non-essential because of the
resources U and R, respectively.
From the previous informal discussion about non-minimality of the result of the
union of a subset of siphons in D1 , in this section we define a set of formal tools and
results. These allow to sieve the 2|P R | 1 candidate siphons, in order to retain only
those giving rise to the minimal ones.
The first tool is the so called pruning relation defined on the set D1 . We will
say that the minimal siphons Dr and Dx are related by the pruning relation, or
equivalently, that the siphon Dr D1 prunes the siphon Dx D1 , r  = x, if and only
if Trx = Dr Dx  = (the two siphons share some transition) and Ur = r Trx
( Trx Dx Ps )  = (there exist common transitions with an input process place
belonging to Dx and also the resource r inputs to these transitions).
The candidate elements to be pruned from the siphon Dx by the siphon Dr are in
each one of the pairs (t, t Ps ), where t Ur . The candidate place to be removed
from one of these pairs is t Ps . This place can be removed, because it becomes
non-essential in Dr Dx , only if ( t Ps ) Ur , i.e. all its output transitions belong
to the previously defined set Ur .
In order to represent this pruning relation we will define a graph named Pruning
Graph (PG).
Definition 4 Let N be a S4 PR net and P R the set of resource places. The Pruning
Graph (PG) of N is a graph G = (V, E) where, (1) V = P R ; and (2) E V V
and for all r, x P R , (r, x) E iff Ur = r Trx ( Trx Dx Ps )  = with Trx =
Dr Dx .
Given a Pruning Graph G = (V, E), we define the Pruning Subgraph G of
G induced on the set of vertices V V, as the graph G = (V , E (V V )).
Associated to a Pruning Graph or Subgraph we define the following three labelling
functions.
Definition 5 Let N be a S4 PR net and G = (V, E) a pruning graph or subgraph of N .
(a) Resource labelling function. S : P R D1 , where for all r P R , S(r) = Dr
D1 , and Dr P R = {r}.

Discrete Event Dyn Syst

(b) Arc labelling function. L : E 2TPs , where (r, x) E, L((r, x)) = {(t, p)|t
r Trx ( Trx S(x) Ps ) ; Trx = S(r) S(x) ; { p} = t Ps }.
(c) Pruning labelling function. KG : V 2 Ps , where for all r V, KG (r) Ps computed by Algorithm 1.

Algorithm 1 Pruning labelling function of G


Input. N = P0 Ps P R , T, C The S4 PR net.
r P R The resource of the siphon Dr D1 for which we will compute the
pruning set in the graph G.
G = (V, E) The pruning graph or subgraph of N .
Output. KG (r) Ps
1. T F = {t|(t, p) L((x, r)) and (x, r) E}
2. Ppartial = { p|(t, p) L((x, r)); (x, r) E; and p T F  = p }
3. KG (r) = { p|(t, p) L((x, r)); (x, r) E; and p T F }
4. Tnew = KG (r)\r
5. While Tnew  = do
6. T F = T F Tnew
7. Pnew = Tnew Ps S(r)
8. A = { p| p Pnew ; p T F }
9. B = { p| p Ppartial ; p T F }
10. C = { p| p Pnew ; p T F  = p }
11. KG (r) = KG (r) A B
12. Ppartial = (Ppartial \B) C
13. Tnew = (A B)\r
14. end While
The function S assigns to each vertex of the graph, i.e. each resource of the net,
the minimal siphon belonging to D1 containing this resource. The function L labels
each arc (r, x) E with the set of pairs (t, p) representing a candidate place p to
be pruned by the minimal siphon Dr in the minimal siphon Dx when we construct
Dr Dx . Both functions, S and L, are defined for the graph G = (V, E) and for each
subgraph G = (V , E ), V V and E = E (V V ) the corresponding functions
S and L are the functions for G but constrained to the set of vertices V .
The function KG is a function that must be computed for each graph or subgraph.
For each node r, KG (r) is the set of places that will be pruned from the minimal
siphon Dr by all minimal siphons Dx such that there exists an arc (x, r) in the graph
G on which we are computing KG (r). The places must be removed from Dr when we
construct the resulting siphon from the union of Dr and all Dx siphons. Observe that
the algorithm uses as seed the pairs labelling the arcs (x, r), because in these pairs we
can find the candidate process places that can be removed by a resource place. After
the detection of the first places to be pruned it is possible that a new set of places
becomes non-essential and then must be pruned. For example, if we have removed
the place p from Dr , a new candidate to be pruned is a place q ( p) Dr Ps if p
is the unique output place in Dr of the transitions p. Additionally, in the algorithm,
through the set P partial we manage the places that are candidates to be removed but
they cannot be removed because it has an output transition that is an input transition
of a non pruned place of the siphon Dr .

Discrete Event Dyn Syst

Observe that the computation of the pruning graph for nets belonging to the S3 PR
class can be simplified. In effect, if we compute the set TG (r) = {t|(t, p) L((x, r))
and (x, r) E}, then we can compute directly KG (r) = { p|(t, p) L((x, r)), (x, r)
E, and p TG (r)}. In other words, we do not need to apply Algorithm 1 because
we do not need to propagate the non-essential property throughout the siphon.
In Fig. 4 we graphically illustrate the way Algorithm 1 works and the meaning of
the function KG . In the figure we have two minimal siphons Dr , Ds D1 . These two
siphons share the transitions t1 and t2 and in order to compute KG (r) we observe that
the siphon Ds prunes the siphon Dr by the place A3 (used as seed from transition t2 )
that becomes non-essential for a siphon resulting from the union of the siphons Dr
and Ds . Observe that the removal of A3 makes the place A2 non-essential so that
it is also incorporated to the KG (r) set. The place A1 is added to the set Ppartial in
Algorithm 1 but finally it is not added to KG (r) because it is essential in the siphon
Dr Ds because of its output transition connecting it to the place r. In a similar way
KG (s) can be computed obtaining the set {B1, B2}.
From the previous discussion, the following lemma presents how to obtain a
siphon from a pruning graph or subgraph G of a net. We will denote this associated
siphon as SG .
Lemma 8 Let N be a S4 PR netand G a pruning subgraph induced on the set of
resources D R  = . The set SG = rD R S(r)\KG (r) is a siphon containing D R .

Proof It is obvious that rD R S(r) is a siphon because each S(r) D1 is also a
siphon. Moreover, each process place p KG (r) is removed from S(r) because p
becomes non-essential in SG . That is, the application of the algorithm 1 to compute
KG (r), makes p non-essential since for all t p : t S(r) = ; or t S(r) = {q} and
q KG (r); or there exists, at least, a resource x D R such that x t. Moreover,
D R SG because KG (r) Ps and r S(r) for all r D R .


In Fig. 5 the Pruning Graph G of the net of Fig. 1 is depicted. This net has four
minimal siphons containing at least 2 resources. In each class Di , 6 i 2, the net
has only one minimal siphon, except for the class D4 that is empty. Each one of these
4 minimal siphons can be computed using Lemma 8 from the graphs G, G1, G2, and
G4. Observe that a non-minimal siphon will be generated from the graph G3 because
KG3 (S) = .
In the case of the net in Fig. 2b the reader can construct easily the pruning graph
G obtaining a complete graph of three nodes.

Fig. 4 The place A1 belonging


to the minimal siphon Dr
contained in the set Ppartial
cannot be pruned

t1

Dr
r

B1

A1
A2

B2

A3

t2

Ds

Discrete Event Dyn Syst

L((Q, P)) = {(t 14 , j)}


L((P, S)) = {(t 13 , h)}

L((S, T)) = {(t 4 , c)}


L((T, S)) = {(t 11 , h)}

L((U, Q)) = {(t 17 , l)}


L((U, R)) = {(t 2 , a)}
L((R, U)) = {(t 7 , e)}
L((Q, R)) = {(t 8, f)}

L((T, U)) = {(t 3, b)}

K G (P) = {j}
KG (Q) = {l}
KG (R) = {a, f}
K G (S) = {h}
KG (T) = {c}
KG (U) = {b, e}

U
G
Q

L((P, S)) = {(t 13 , h)}


L((S, T)) = {(t 4 , c)}

L((T, S)) = {(t 11 , h)}


L((T, U)) = {(t 3 , b)}
U

T
G1

L((U, Q)) = {(t 17 , l)}

L((U, R)) = {(t 2 , a)}

L((Q, P)) = {(t 14 , j)}

L((R, U)) = {(t7 , e)}

KG1 (P) = {j}


KG1 (Q) = {l}

L((U, Q)) = {(t 17 , l)}

KG1 (S) = {h}

KG2 (Q) = {l}

K G1 (T) = {c}
K G1 (U) = {b}

G2

L((S, T)) = {(t 4, c)}

K G3 (T) = {c}

K G2 (U) = {e}

L((U, R)) = {(t 2 , a)}


L((R, U)) = {(t7 , e)}
K G4 (R) = {a}

KG3 (S) = 0
T

K G2 (R) = {a, f}

L((T, S)) = {(t 11 , h)}


G3

L((Q, R)) = {(t8 , f)}

G4

K G4 (U) = {e}

Fig. 5 The pruning graph G and the subgraphs G1, G2, G3 and G4 of the Fig. 1

A final interesting example is presented in the Petri Net of Fig. 6. The corresponding Pruning Graph is depicted in Fig. 7, where the reader can observe that
S(R) prunes itself, and this selfloop is necessary to compute the minimal siphon
D RS = {R, S, p2, p3, p4, p6} (it allows to obtain KG (R) = { p1}  = ).
The pruning relation defined previously on the set of minimal siphons containing
only one resource place can be generalized in order to consider other sets of siphons.
This generalization is done along two different lines: (1) we allow siphons that are
non-minimal; (2) we allow siphons containing more than one resource place. The
relation to be defined on these sets of siphons will be called Extended Pruning Relation. The main difference is related to the non-minimality of the siphons. Therefore,
a siphon can prune itself in order to remove non-essential places that make it nonminimal. Nevertheless, taking into account Lemma 2, in the set of siphons we use to
define this new pruning relation there are not two siphons containing the same set
of resources. The extended pruning relation will be represented by means of the so
called Extended Pruning Graph defined in the following.

Definition 6 Let N be a S4 PR net and P R the set of resource places. Let
be
a set of siphons of N such that there are not two different siphons with the same

Discrete Event Dyn Syst


Fig. 6 A S4 PR net where the
node R prunes itself (the idle
places are omitted to simplify
the drawing)

set of resources. The Extended Pruning Graph (EPG) of N is a graph G = (V, E)


where,

1. V = {D P R | D } 2 P R ;
2. E V V and
(a) For all vr , vx V, vr  = vx , (vr , vx ) E iff Ur = vr Trx ( Trx Dx
Ps )  = with Trx = Dr Dx , vr = Dr P R , vx = Dx P R , and Dx , Dr

.
(b) For all vr V, (vr , vr ) E iff Ur = vr (Dr Ps )  = or p Dr Ps
such that p  Hvr with vr = Dr P R and Dr .
Given a extended pruning graph G = (V, E), we define the pruning subgraph G
of G induced on the set of vertices V V, as the graph G = (V , E (V V )).
Associated to a pruning graph or subgraph we define the following three labelling
functions.
Definition 7 Let N be a S4 PR net and G = (V, E) an extended pruning graph or
subgraph of N .


(a) Resource labelling function. S : V , where for all vr V, S(vr ) = Dr
such that Dr P R = vr .

Fig. 7 Pruning graph, G, of


Fig. 6

L((R, S))= {(t 7, p5)}


L((S, R))={(t2, p1)}
L((R, R))= {(t 3 , p1)}

G
S(R)= {R, p1, p2, p3, p4, p6 }
S(S)= {S, p4, p5}

K G (R)= {p1}
K G (S)= {p5}

Discrete Event Dyn Syst

(b) Arc labelling function. L : E 2TPs , where


(i) For all (r, x) E, r  = x, L((r, x)) = {(t, p)|t r Trx ( Trx S(x)
Ps ) ; Trx = S(r) S(x) ; { p} = t Ps }.
(ii) For all (r, r) E, L((r, r)) = {(t, p) | t r (S(r) Ps ) ; { p} = t Ps }
{(t, p) | p (S(r) Ps )\Hr ; t p }
(c) Pruning labelling function. KG : V 2 Ps , where for all r V, KG (r) Ps computed by an algorithm as the Algorithm 1 where now the nodes of the graph are
subsets of places instead of single resources and the functions are those defined
here.
As a first example of Extended Pruning Graph we consider the siphon v = {r, b , c}
of the net in Fig. 2a. Observe that this siphon is the support of the p-semiflow of the
resource
r, and it is not a minimal siphon. The EPG, when we consider the set of
siphons
= {v}, has only one node, named vr = {r}, and only one arc from the node
to itself. This arc appears because the set Ur in Definition 6.2(b) is non-empty and
equal to the transition b . The set of places to be removed in order to make the
siphon minimal is equal to the set KG (vr ) = {b }.
As a second example, in Fig. 8 we have depicted the Extended Pruning Graph for
the set of minimal siphons of the net of Fig. 9 containing at least one resource. An
interesting characteristic of this net is that there are not resource-transition circuits
as those defined in the paper Xing et al. (2011), therefore an algorithm to compute
siphons in S4 PR based on this concept seems to be non viable. In this case there are
not resource-transition circuits because a transition can have input or output resource
places but not both.

6 A new algorithm to compute the minimal siphons of a S4 PR net


In the previous section we have defined the PG of a S4 PR net that we will use as
central tool to compute the minimal siphons of the net. The basic idea of the method
is to construct a minimal siphon D of the net, N , by the union of the minimal siphons
of D1 (minimal siphons of N containing only one resource) corresponding to the
resources contained in D, and each one is diminished in the pruned places specified
by the function KG .
As we have seen (Fig. 2b) the number of minimal siphons of a S4 PR net,
containing resources, can be equal to 2|P R | 1 (the number of non-empty subsets of
resources). Nevertheless, the number of minimal siphons, in practice, is much lower
than this number. This means that we must evaluate many non-productive unions of
minimal siphons of D1 . The following result characterizes a minimal siphon in terms
of a pruning subgraph of the net induced on the set of resources of the minimal
siphon.
Theorem 4 Let N be a S4 PR net and G the corresponding pruning graph. D P is a
minimal siphon of N containing the set of resources D R  = , if and only if,
(a) The subgraph G of G, induced on the set D R is strongly connected.
(b) For all r D R , KG (r)  = .

Discrete Event Dyn Syst

0
Fig. 8 The pruning graph and the extended pruning graph of the net of Fig. 9

(c) There is no strongly connected subgraph G of G , induced on D R  = , D R


D R such that the siphons associated to G , G verify SG SG = D

Proof
()

If D is a minimal siphon of N containing the set of resources D R  = ,


then the PG induced on D R , G , is strongly connected. We prove this claim

Discrete Event Dyn Syst


Fig. 9 A S4 PR net without the
idle places to simplify the
drawing

t1

t2

t3

()

t4

t5

t12

t11

t10

t6

t9

t8

t7

by contradiction. Let us suppose that G is not strongly connected. The


strongly connected components (scc) of G are its maximal strongly connected
subgraphs and we will have more than one. If each scc is contracted to
a single vertex, the resulting graph is a directed acyclic graph named the
condensation graph of G . Let D R the set of vertices of a scc of G such that
it has no predecessor scc in the condensation graph (there exists at least one
because the condensation graph is acyclic). The pruning subgraph induced on
D R , G , is strongly connected and KG (r) = KG (r), for all r D R , because
there are not arcs from vertices in D R \D R to vertices in D R , and therefore


Algorithm 1 gives the same
results, for all r D R , in the two graphs G and

G . By Lemma 8, SG = rD S(r)\KG (r) is a siphon, and also is SG =
R



S(r)\KG (r) = ( rD S(r)\KG (r)) ( rD R \D S(r)\KG (r)) = SG
rD R
R
R
( rD R \D S(r)\KG (r)). That is, SG SG contradicting that D is a
R
minimal siphon. Therefore, if D is a minimal siphon, G is strongly connected.
Moreover, if D is minimal KG (r)  = , for all r D R , since KG (r) = , for
some r D R implies that S(r) D contradicting the minimality of D. Finally,
if there exists a strongly connected subgraph G of G induced on the set D R
D R such that D R  = and SG SG , D cannot be minimal, contradicting that
D is minimal. Therefore, the condition c) of the statement of the theorem is a
necessary condition.

By Lemma 8, D = rD R S(r)\KG (r) is a siphon and D R D. We will prove
by contradiction that D is a minimal siphon. Let us suppose that the three conditions of the theorem are satisfied and D is not minimal. If D is not minimal,
there exists a minimal siphon D D, and according to the necessary part
of this theorem previously proven, there exists a subgraph G of G induced
on D R = D P R D R  = that satisfies the three previous conditions (i.e.
G is strongly connected and KG (r)  = , for all r D R ). G will also be a
subgraph of G . Now we prove that D = SG , and therefore SG D = SG ,
contradicting that the
third condition of the theorem was true for D. In effect,
by Lemma 5, D rD S(r). Moreover, by the proof of Lemma 8, KG (r)
R
represents all places that become
 non-essential in S(r) because of the rest of

places of D , therefore D rD S(r)\KG (r) = SG . By Lemma 8, SG is a
R
siphon containing D R resources, and taking into account that the number of
pruned places by Algorithm 1 is maximal, therefore D = SG .



The following is an algorithm to compute the minimal siphons of a S4 PR net based


on the characterization of minimal siphons in terms of pruning graphs presented in
Theorem 4.

Discrete Event Dyn Syst

Observe that the algorithm proceeds in two phases. The first one is an strategy to
compute all maximal strongly connected subgraphs of the pruning graph of the net,
where all vertices have a pruning labelling function, KG , different from the empty
set (conditions (a) and (b) in Theorem 4). The second phase removes all subgraphs
containing a subgraph satisfying the condition (c) of Theorem 4.
The following results concern the termination of Algorithm 2 and its complexity.

Algorithm 2 Computation of the Minimal Siphons of N


Input. N = P0 Ps P R , T, C The S4 PR net.
D1 The minimal siphons with only one resource.
Output. D The minimal siphons of N containing at least one resource.
1. D := D1
2. Compute the pruning graph G = (V, E) of N (Definition 4), and the functions
S, L and KG (Definition 5).
3. Compute all maximal strongly connected subgraphs (strongly connected components, scc) of G, and for each scc, G , compute the functions S, L and KG
to form the PG G . Add all PGs G with more than one vertex to the set gnew .
4. ggood :=
5. While gnew  = do
6. Extract G = (V , E ) from gnew
7. If there exists r V such that KG (r) = then
8.
Compute A := {r|r V and KG (r) = }
9.
If there is no a graph in gnew nor in ggood with a set of vertices equal
to V \ A then
10.
Compute the pruning subgraph of G induced on V \A, named G .
11.
Compute all scc of G , and for each scc, G , with more than one node
and not contained in gnew , compute the functions S, L and KG to form
the PG G and add it to the set gnew .
12.
end if
13. else
14. Add G to the set ggood
15. for each r V do
16.
If there is no a graph in gnew nor in ggood with a set of vertices equal
to V \ {r} then
17.
Compute the pruning subgraph of G induced on V \{r}, G
18.
Compute all scc of G , and for each scc, G , with more than one node
and not contained in gnew , compute the functions S, L and KG to
form the PG G and add it to the set gnew .
19.
end if
20. end for
21. end if
22. end while
23. Remove all graphs from ggood , G = (V, E), for which there exists another
G = (V , E ) in ggood satisfying: (1)V V; and (2)SG SG
24. for each graph G = (V , E )
ggood
25. Add to D the siphon D = rV S(r)\KG (r) = SG
26. end for

Discrete Event Dyn Syst

Lemma 9 Algorithm 2 applied to a S4 PR net, N , terminates and computes all minimal


siphons of N containing at least one resource place.
Proof The algorithm terminates because in each iteration of the first loop starting in
line 5, we add to the set gnew maximal strongly connected subgraphs that contain at
least one vertex less than the graph used in the iteration to compute these maximal
strongly connected subgraphs. Moreover, all the added new subgraphs have a set
of vertices (resources) that is different to those corresponding to graphs previously
added and with at least two resources. This means that the loop will be executed at
most 2|P R | |P R | 1 times, where |P R | is the number of resources places of N .
The algorithm computes all minimal siphons containing at least one resource
because D1 is added to the final set at the beginning of the algorithm. The first loop
computes all maximal strongly connected subgraphs where all vertices have a nonempty KG function. The final task in step 23 removes from this set all graphs that
contain at least one of these graphs with the same properties. Therefore, the set ggood
will contain only those pruning graphs characterizing minimal siphons as stated by
Theorem 4 with at least 2 resources. That is, the final set D will contain all minimal
siphons of N .


Finally, the following result formalize the worst-case time complexity of Algorithm 2 that is dominated by the square of the number of minimal siphons containing
at least two resources.
Lemma 10 Algorithm 2 can f ind all minimal siphons of a S4 PR net with a worstcase time complexity O(B2 ( |P R2|+1 ) + B(|P R |2 + |P R | |PS | 12 )) where B = 2|P R |
|P R | 1.
Proof The worst-case time complexity of Algorithm 2 corresponds to the case in
which we have a number of minimal siphons equal to the upper bound of Lemma 4,
i.e. |D| = 2|P R | 1 at the end of Algorithm 2. Taking into account that all minimal
siphons containing exactly one resource are directly added to the set D at the
beginning of the algorithm (because they are input data), the computation only must
find B = 2|P R | |P R | 1 minimal siphons: those containing more than one resource.
The main loop of the algorithm starting in line 5 will be executed exactly B times,
because the set gnew ggood cannot contain two graphs with the same set of resources
and all of them must contain more than one resource. To ensure this last property,
in each iteration we need to make a number of comparisons between sets of vertices
of the new graphs with the sets of vertices of the graphs stored in gnew ggood that
is bounded by O(|P R | B2 ). Additionally, for each one of the B minimal siphons
we must compute the pruning subgraph from the given pruning graph of N with a
complexity of O(|P R | |PS |); and compute the set of strongly connected components.
For each graph with V vertices, this can be accomplished in time O(V 2 ). In our case
it can be bounded by O(|P R |2 ) and therefore for the B minimal siphons we require a
number of operations of these classes in time O(B(|P R | |PS | + |P R |2 )). Finally, the
last task of the algorithm requires to detect non-minimal siphons by comparison of
pairs of siphons obtained after the main loop. These comparisons must be done on
the set ggood that contains B minimal siphons, therefore this task can be done in time

Discrete Event Dyn Syst

O( B(B1)
). Combining the three previous expressions we obtain the expression of
2
the statement.


We must say that is possible to derive many variants of this algorithm. A first
group is originated depending on the place where the comparison between graphs
to eliminate the non-minimal ones is situated. In the algorithm we have presented
this at the end of phase one, but this can also be done in step 14 when a new graph,
fulfilling conditions a) and b ) of Theorem 4, is stored in ggood . At this moment, we can
compare the new graph with the previously added and remove those that contain the
new. Other variants depend on the data structures used to implement some objects
of the algorithm. For example, we can use a tree to implement ggood , instead of a set.
This makes easier the comparison avoiding a great number of tests.
Applying Algorithm 2 to the Pruning Graph shown in Fig. 5 the four minimal siphons of the net in Fig. 1 are obtained as follows: D = {R, U, b , f, m}
from the subgraph G4, D = {Q, R, U, b , g, k, m} from the subgraph G2, D =
{P, Q, S, T, U, d, e, g, i, k, m} from the subgraph G1 and finally, D = {P, Q, R,
S, T, U, d, g, i, k, m} from the pruning graph G. Observe, that the graph G3 does not
pass the phase 1 because KG3 (S) = . In the same way, the three minimal siphons
for the net in Fig. 9 are computed by means of the pruning graph shown in Fig. 8
as follows: D = {R, S, b , c, d, e, i, j} from G1, D = {S, T, d, e, g, h, i, j} from G2 and
D = {R, S, T, d, e, i, j} from G.

7 Conclusions
The computation of minimal siphons in the context of Resource Allocation Systems
modeled with S4 PR nets currently plays a central role. We propose a new method to
compute these minimal siphons based on the use of higher level objects than those
used in previously known algorithms: the set of minimal siphons of the net with only
one resource. The computation of a minimal siphon containing the set of resources
D R requires the union of the minimal siphons corresponding to each resource of
D R . Each one of these minimal siphons, used as operands, must be diminished by a
pruning set of process places that can be computed from a binary pruning relation
defined on the set of minimal siphons with only one resource. This pruning relation
is represented by a graph that is used to compute the minimal siphons by means of
maximal strongly connected subgraphs.
The usage of these high level objects for the computation of all minimal siphons
makes our algorithm very different to the previous algorithms that work directly
on places and transitions. That is, a theoretical comparison between algorithms
is difficult because the strategies of computation are very different. For example,
specialized algorithms developed for the strict S3 PR subclass cannot be extended to
S4 PR because they use particular concepts that do not work in S4 PR. Nevertheless,
our experience with some large examples modelling wormhole routing algorithms
in multicomputer interconnection networks (Rovetto et al. 2010) is very positive.
Many of the existing tools are not able to compute the minimal siphons because the
great amount of memory needed, and in other cases the amount of required time is
enormous (of the order of days). Our algorithm finishes in some minutes and with

Discrete Event Dyn Syst

an insignificant need of memory. Nevertheless, much more work must be done in


order to find an optimal implementation with a good selection of data structures and
heuristics to reduce the number of comparisons.
Acknowledgements This work has been partially supported by Technological University of
Panama and Secretara Nacional de Ciencia, Tecnologa e Innovacin, SENACYT, Panama. Also,
this work has been partially supported by the European Communitys Seventh Framework Programme under project DISC (Grant Agreement n. INFSO-ICT-224498) and the project CICYTFEDER DPI2006-15390. The authors are indebted to three anonymous referees, whose comments
helped to improve previous versions of this paper. Also, the authors extend gratitude to Marcela
Paredes de Vsquez, Myriam Gonzalez, Luis Barahona, Martin Candanedo, Ral Barahona, Clifton
Clunie, Lydia Toppin and Delva Batista for valuable support during the research process of
this work.

References
Barkaoui K, Lemaire B (1989) An effective characterization of minimal deadlocks and traps in Petri
nets based on graph theory. In: Proceedings of the 10th international conference on theory and
application of Petri nets, Bonn, pp 122
Chao D (2009) Direct minimal empty siphon computation using MIP. Int J Adv Manuf Technol
45:397405
Chu F, Xie XL (1997) Deadlock analysis of Petri nets using siphons and mathematical programming.
IEEE Trans Robot Autom 13(6):793804
Colom JM (2003) The resource allocation problem in flexible manufacturing systems. In: van der
Aalst W, Best E (eds) Proceedings of the 24th international conference on applications and
theory of Petri nets. Lecture notes in computer science, vol 2679. Springer, Eindhoven, pp 2335
Colom JM, Silva M (1991) Convex geometry and semiflows in P/T nets. A comparative study of
algorithms for computation of minimal p-semiflows. In: Rozenberg G (ed) Advances in Petri
nets 1990. Lecture notes in computer science, vol 483. Springer, Berlin, pp 79112
Cordone R, Ferrarini L, Piroddi L (2005) Enumeration algorithms for minimal siphons in petri nets
based on place constraints. IEEE Trans Syst Man Cybern, Part A Syst Humans 35(6):844854
Ezpeleta J, Couvreur JM, Silva M (1993) A new technique for finding a generating family of siphons,
traps and ST-components. Application to colored Petri nets. In: Advances in Petri nets. Lecture
notes in computer science, vol 674. Springer, New York, pp 126147
Ezpeleta J, Colom JM, Martnez J (1995) A Petri net based deadlock prevention policy for flexible
manufacturing systems. IEEE Trans Robot Autom 11(2):173184
Ezpeleta J, Garca-Valls F, Colom J (1998) A class of well structured petri nets for flexible manufacturing systems. In: Desel J, Silva M (eds) Application and theory of Petri nets 1998. Lecture
notes in computer science, vol 1420. Springer, Berlin, pp 6483
Lautenbach K (1987) Linear algebraic calculation of deadlocks and traps. In: Voss K, Genrich HJ,
Rozenberg G (eds) Concurrency and nets. Springer, New York, pp 315336
Li ZW, Zhou MC (2008) On siphon computation for deadlock control in a class of Petri nets. IEEE
Trans Syst Man Cybern Part A Syst Humans 38(3):667679
Li Z, Zhou MC (2009) Deadlock resolution in automated manufacturing systems: a novel Petri net
approach. In: Advances in industrial control. Springer, New York
Li Z, Zhou MC, Jeng M (2008) A maximally permissive deadlock prevention policy for FMS based
on Petri net siphon control and the theory of regions. IEEE Trans Autom Sci Eng 5(1):182188
Lopez-Grao JP, Colom JM (2010) The resource allocation problem in software applications: a
Petri net perspective. In: Proceedings of the international workshop on Petri nets and software
engineering PNSE10, Braga, Portugal, pp 721
Murata T (1989) Petri nets: properties, analysis and applications. Proc IEEE 77(4):541580
Reveliotis S (2003) On the siphon-based characterization of liveness in sequential resource allocation
systems. In: van der Aalst W, Best E (eds) Applications and theory of Petri nets 2003. Lecture
notes in computer science, vol 2679. Springer, Berlin, pp 241255
Reveliotis SA (2005) Real-time management of resource allocation systems. A discrete event systems
approach. Springer, New York

Discrete Event Dyn Syst


Rovetto CA, Cano EE, Colom JM (2010) Deadlock analysis in minimal adaptive routing algorithms
using petri nets. In: IEEE international conference on systems man and cybernetics (SMC), 2010,
Istanbul, Turkey, pp 26192626
Tricas F (2003) Analysis, prevention and avoidance of deadlocks in sequential resource allocation
systems. PhD thesis, Zaragoza. Espaa, Departamento de Ingeniera Elctrica e Informtica,
Universidad de Zaragoza
Tricas F, Garca-Valls F, Colom JM, Ezpeleta J (2005) A Petri net structure-based deadlock
prevention solution for sequential resource allocation systems. In: Proceedings of the 2005 IEEE
international conference on robotics and automation, Barcelona, Spain, pp 272278
Wang AR, Li ZW, Jia JY, Zhou MC (2009a) An effective algorithm to find elementary siphons in a
class of Petri nets. IEEE Trans Syst Man Cybern Part A Syst Humans 39(4):912923
Wang Y, Liao H, Reveliotis S, Kelly T, Mahlke S, Lafortune S (2009b) Gadara nets: modeling and
analyzing lock allocation for deadlock avoidance in multithreaded software. In: Proceedings of
the 48th IEEE conference on decision and control, 2009 held jointly with the 2009 28th Chinese
control conference. CDC/CCC 2009, pp 4974976
Williams HP (1986) Fouriers method of linear programming and its dual. Am Math Mon 93(9):
681695
Xing K, Zhou MC, Wang F, Liu H, Tian F (2011) Resource-transition circuits and siphons for
deadlock control of automated manufacturing systems. IEEE Trans Syst Man Cybern Part A
Syst Humans 41(1):7484

Elia Esther Cano received the M.S. and Ph.D. degrees in computer science engineering from the
University of Zaragoza, Spain, in 2007 and 2011, respectively. In 1996, she joined the Computer
Systems Engineering Department, Technological University of Panama, Panama, where she is
currently professor. Her research is devoted to the modeling and analysis of concurrent systems
using Petri Nets.

Discrete Event Dyn Syst

Carlos A. Rovetto received the M.S. and Ph.D. degrees in computer science engineering from the
University of Zaragoza, Spain, in 2007 and 2011, respectively. He is professor in the Department
of the Computer Systems Engineering of the Technological University of Panama since 2002 and
lead research projects. His main research interests include control and scheduling of manufacturing
systems and discrete-event systems, interconnections networks for multiprocessors using Petri Nets.

Jos-Manuel Colom received the Ph.D. degree in industrial-electrical engineering from the University of Zaragoza, Zaragoza, Spain, in 1989. He is currently a professor in the Department of
Computer Science and Systems Engineering, University of Zaragoza. He has co-authored over 100
research papers in technical journals and conferences. His research interests include modelling,
qualitative, and performance analysis, and implementation of discrete event systems using Petri
nets. Dr. Colom has served on the technical committees of several international conferences in the
field of formal methods and concurrent systems. He organized, as a conference co-chair, several
international conferences in the field of Petri nets and discrete event systems.

You might also like