Math Meth Oper Res (2011) 73:281–300 DOI 10.1007/s00186-011-0353-6 ORIGINAL ARTICLE
Encoding the dynamics of deterministic systems Luis M. Torres · Annegret K. Wagler
Received: 4 November 2009 / Accepted: 2 November 2010 / Published online: 21 April 2011 © Springer-Verlag 2011
Abstract We present a model for the dynamics of discrete deterministic systems, based on an extension of the Petri nets framework. Our model relies on the definition of a priority relation between conflicting transitions, which is encoded by orienting the edges of a transition conflict graph. We provide a characterization in terms of a local consistency condition of those deterministic systems whose dynamic behavior can be encoded using our approach. Finally, we consider the problem of recognizing when an orientation of the transition conflict graph is valid for encoding the dynamic behavior of a system. Keywords
Petri nets · Concurrent deterministic dynamic systems
1 Introduction Petri nets constitute a well-established framework for modeling complex dynamic systems. Their broad application range includes the design of asynchronous hardware circuits (Yakovlev et al. 1996), the analysis of production and workflow systems (Adam et al. 1998), the analysis and control of batch processes (Gu and Bahri 2002), the design of distributed algorithms for networks of agents (Reisig 1998), and the modeling and simulation of biological networks (Hardy and Robillard 2004; Koch and Heiner 2008; Chaouiya et al. 2008), to cite only some prominent examples.
L. M. Torres (B) Departamento de Matemática, Escuela Politécnica Nacional, Quito, Ecuador e-mail:
[email protected] A. K. Wagler Faculty of Science and Technology (ISIMA, LIMOS), University Blaise Pascal, Clermont-Ferrand, France e-mail:
[email protected]
123
282
L. M. Torres, A. K. Wagler
The structure of these systems is described by means of a network, while the studied dynamic processes are usually represented as directed paths in a corresponding reachability digraph (termed also as marking graph in the Petri net community). Several fundamental issues concerning the dynamics of such systems, which are inherently complex in nature as they involve (conflicting or concurrent) interactions of a large number of components, can be addressed within this setting, either via theoretical analysis or, in the most cases, via computer simulation. Petri nets also turned out to be a flexible modeling framework that has been extended in various ways for dealing with different applications. For instance, colored and highlevel Petri nets have been widely used for protocol specification in communication networks (Billington et al. 1999; Jensen 1997). Stochastic Petri nets are used in cases where uncertainty is attached to input data, to describe external noise generated by the environment, as well as noise that might be intrinsic to a system (Marsan et al. 1995; Balbo 2002). Hybrid Petri nets allow to model systems were both continuous and discrete processes coexist (David and Alla 2005), and the inclusion of additional features required for modeling certain biological networks has led to the definition of Hybrid Functional Petri nets (Matsuno et al. 2003). In this paper we consider another possible extension that aims at representing systems whose dynamic behavior exhibits deterministic features, as described in the following. We will introduce Petri nets and related concepts only as far as they are necessary for formulating our model. The reader interested in more information about this topic is referred to the extensive literature available (see, e.g., Reisig 1985). To model the structure of the underlying system, one uses a network, that is a weighted directed bipartite graph G = (P ∪ T, A, w) with two kinds of nodes, places and transitions, linked by weighted directed arcs. The set P of places represents the system’s components, while the set T of transitions stands for the possible interactions. We denote by A the set of arcs in the network and by w the vector of their weights, with wit being the weight of arc (i, t) ∈ A. Depending on the application, some additional specific requirements may be imposed on the structure of G. Here, we only assume that the network is simple, i.e., between any place i ∈ P and any transition t ∈ T , there is at most one arc. Antiparallel pairs of arcs1 , which appear for example when modeling catalyzed chemical reactions, can be easily replaced by means of inserting additional places and transitions, see e.g. Chaouiya (2007), Marwan et al. (2008). A network G = (P ∪ T, A, w) can also be represented by its incidence matrix M : = (m it ) ∈ Z|P|×|T | where each row corresponds to a place i ∈ P and each column to a transition t ∈ T . We have ⎧ ⎨ −wit if i ∈ P − (t), m it := +wti if i ∈ P + (t), ⎩ 0 otherwise,
1 Commonly denoted as test arcs in the Petri net community.
123
Encoding the dynamics of deterministic systems
283
where P − (t) := {i ∈ P : (i, t) ∈ A} , denotes the set of pre-places of t ∈ T and P + (t) := {i ∈ P : (t, i) ∈ A} the set of its post-places. Some places B ⊆ P have bounded capacities associated with them, which are B . A state2 of the system is an assignment given by the positive integral vector u ∈ Z+ of tokens to places that takes into account the capacities of the places in B and some other conditions, if necessary. Hence, any state can be represented as an integral nonP and the potential state space of the system is the set of all negative vector x ∈ Z+ theoretically possible states: P : xi ≤ u i , ∀i ∈ B . X := x ∈ Z+ Observe that X is finite if B = P holds or some other conditions restrict the set of potential states. Dynamic processes are described as sequences x 1 , . . . , x k of consecutive system states3 , where state x i+1 is obtained from x i by switching a transition t ∈ T . Thereby, t consumes wit tokens from each pre-place i ∈ P − (t) and produces wti new tokens on each post-place i ∈ P + (t). A transition t ∈ T is enabled at a state x ∈ X if switching t yields a valid successor state and disabled otherwise. Thus, T (x) := t ∈ T : xi − wit ≥ 0, ∀i ∈ P − (t); xi + wti ≤ u i , ∀i ∈ P + (t) ∩ B is the set of enabled transitions at state x. Accordingly, X (t) := x ∈ X : xi ≥ wit , ∀i ∈ P − (t); xi ≤ u i − wti , ∀i ∈ P + (t) ∩ B denotes the set of states at which transition t is enabled. In this setting, switching a transition t ∈ T (x) changes the state of the system from x to x + M·t , where M·t is the column of M associated with t. The dynamic behavior of a system expresses the way how the system changes its states over time, or in response to an external stimulus. Usually, this behavior is the result of several conflicting as well as concurrent ongoing dynamic processes. A Petri net is a pair (G, x 0 ) consisting of a network G together with an initial state x 0 , and its state space is understood as the set of all further system states which can be reached from x 0 by switching sequences of transitions. Again, see Reisig (1985) for 2 Also known as a marking m : P → Z in the Petri net community. + 3 Throughout this paper, we will use superindices to reference different states and subindices to specify j places. Thus, xi is the number of tokens assigned to place i at state x j .
123
284
L. M. Torres, A. K. Wagler
basic definitions. In this framework, describing the dynamics of a system might be done by model animation, i.e., by simulating the flow of tokens inside the network as transitions are switched. Given a network G and an initial state x 0 ∈ X , some central problems that are usually studied in this context are: – – – –
Reachability: Determine whether the system may eventually reach one of a set of target states Y ⊂ X after a finite sequence of transition switches. Boundedness: Determine if there are sequences of transition switches that lead to the accumulation of an unlimited number of tokens at some place of the network. Existence of deadlocks: Determine whether the system can reach a state at which no transitions are enabled. Liveness: Determine whether the Petri net is live, i.e., whether no sequence of transition switches can put the system into a state where some transition is permanently disabled. (This is the case if for every transition t ∈ T the following holds: given any state x 1 reachable from x 0 , there is a state x 2 reachable from x 1 such that t ∈ T (x 2 )).
The problems mentioned above are in general hard from a computational complexity point of view. For instance, reachability was proven to require exponential space in Lipton (1976) and decidability of this problem could only be established some years later (Mayr 1981, 1984). For reversible Petri nets, i.e., Petri nets where a state x is reachable from a state x if and only if x is reachable from x , reachability can be shown to be equivalent to a special version of the polynomial ideal membership problem: Given multivariate polynomials f, g1 , . . . , gn over some ring, determine whether f is in the ideal generated by g1 , . . . , gn . This connection can be exploited to gain more insight on the complexity of the problem (see, for instance, Mayr 1995 for a survey). Moreover, Gröbner bases techniques for testing ideal membership can be adapted to study reachability in reversible Petri nets. Despite of rather discouraging worst-case lower bounds on their complexity, these methods have been successfully applied to some practical problems (Chandler and Heyworth 1999; Caprotti et al. 1995). Dynamic processes can be encoded as directed paths in a state digraph G : = (X , A) where nodes represent states and, for any pair of states x, x ∈ X , we have (x, x ) ∈ A if and only if x = x + M·t for some t ∈ T (x), i.e., if x can be obtained from x by switching a single transition. The encoding size of G is of order (u¯ |P| ), with u¯ : = min {u i : i ∈ B} or even infinite if B = P. In the Petri net community, it is common to use the term reachability or marking graph to refer to the subgraph of G induced by the set X (x 0 ) of nodes corresponding to those states that can be reached from the initial state x 0 of the network. A particular situation occurs when so-called dynamic conflicts are present, in which two transitions are enabled, but switching one disables the other. In this case, model animation does not allow definite conclusions about any system properties, as mentioned in Koch and Heiner (2008). The reason is that the occurrence of dynamic conflicts is understood as alternative (branching) system behavior, where a decision between these alternatives is taken non-deterministically. However, there are examples of systems that show a deterministic behavior despite the existence of dynamic conflicts. More precisely, we call a dynamic system deterministic if any state x ∈ X has a unique successor state succ(x). For instance, some
123
Encoding the dynamics of deterministic systems
285
biological systems are deterministic, as stimulating them in a certain way triggers always the same response (see e.g. the light-induced sporulation of Physarum polycephalum plasmodia or the phototaxis of halobacterial cells described in Marwan and Starostzik 2002, Marwan 2003, Marwan et al. 2005). Petri nets, as originally defined, can be used to model such systems only in some trivial cases. Here we present a possible way to overcome this difficulty. To model a deterministic system (independently from its initial state), a successor function succ : X → X needs to be defined which returns succ(x) for every potential state x ∈ X . Therefore, we will use the notation S = (G, u, succ) for referring to such a system. An explicit encoding of succ, for instance pointwise, is about of the same size as the state digraph G, and hence exponential in the size of G and u. Here we propose a more compact way of representing the dynamics of S, by encoding the global dynamic behavior of the system through a local selection criterion that chooses among all currently enabled transitions the one which switches to the successor state succ(x). An overview of the general aspects of our model is provided in the next section, where some potential applications are also discussed. Then we introduce the two main components of the model: the transition conflict graph and its properties are addressed in Sect. 3, while valid orientations of this conflict graph, to impose priorities among transitions as a selection criterion, are considered in Sect. 4. In the same section we also provide a characterization of the deterministic systems that can be encoded by our model. Our work is based on ideas proposed by Marwan et al. (2008), Wagler and Weismantel (2009) in the context of biological interaction networks.
2 Encoding the dynamics of deterministic systems Consider a system S = (G, u, succ) with network G = (P ∪ T, A, w) and let M denote the incidence matrix of G. Recall that the state digraph of S is defined by G : = (X , A) where nodes represent potential states and a node x has an outgoing arc (x, x ) ∈ A if and only if x = x + M·t for some t ∈ T (x), i.e., if x can be obtained from x by switching a single transition. We call x ∈ X a branching state if there are at least two transitions in T (x). The existence of a branching state implies either an alternative or a concurrent behavior of the system. An alternative behavior occurs when at least two transitions t j , tk ∈ T (x) are in dynamic conflict, i.e., if they cannot switch simultaneously as for some place i ∈ P, we have xi − wit j − witk < 0, or xi + wt j i + wtk i > u i , / X holds. While animating the model, either t j or tk has to thus, if x + M·t j + M·tk ∈ be selected at x. In the case of concurrency, on the contrary, no two transitions from T (x) are in a dynamic conflict. Then all transitions in T (x) could be switched simultaneously, resulting in the valid state
123
286
L. M. Torres, A. K. Wagler
x = x +
M·t ∈ X .
t∈T (x)
In this case, G contains paths for all possible interleaving sequences between x and x , corresponding to all possible permutations of the transitions in T (x). Petri nets are an adequate model for simulating the dynamic behavior of deterministic systems, only if no branching states are present. Otherwise, a mechanism has to be specified that allows to decide “which is the right path to choose” in the state digraph. This includes in particular a way of resolving dynamic conflicts. For modeling purposes, we assume in the sequel that the dynamic behavior of a deterministic system is specified in the form of a successor-oracle, which returns for every state x ∈ X , the value of succ(x), and propose a compact implementation for this oracle. Moreover, we restrict our attention to systems where the successor-oracle can be expressed via a transition selection function trans : X → T , which assigns to every state x ∈ X a unique transition trans(x) ∈ T (x) that must be switched in order to reach state succ(x). Note that not all deterministic systems can be modeled in this way, see the discussion in Sect. 5. Even in the case where the dynamic behavior can be specified over a transition selection function, an explicit (i.e., pointwise) encoding of trans is extensive in the sense that it requires an amount of space proportional to the size of the state digraph G, which, as pointed out in the last section, is at least exponential on the number of places of the network. Our contribution consists in providing a compact scheme for encoding trans. As we prove in the next two sections, if S = (G, u, succ) satisfies a quite natural consistency condition, there exists a digraph D : = (T, A) on the set of transitions with the following properties: – –
for every x ∈ X , the set T (x) induces a subgraph having a unique sink t (x) and t (x) = trans(x) is the required transition to switch from x to succ(x).
Observe that this graph has a size of O(|T |2 ), which is polynomial in the size of G. The arcs of D can be interpreted as priority relations between pairs of transitions, with trans(x) being the transition with highest priority among all transitions in T (x). We call such a digraph a valid orientation of the transition conflict graph. (These terms will be explained in more detail in the next two sections.) As illustrated in Algorithm 1, a valid orientation completely encodes the dynamic behavior of a deterministic system, since it can be used to obtain an implicit implementation of the successor-oracle. Given a state x ∈ X , all we need to do in order to find its successor is to determine the highest-priority transition trans(x) at x. This can be accomplished by searching for the unique sink in the subgraph of D induced by the set T (x) of enabled transitions. (If no transitions are enabled at x, the algorithm just returns the same current state x as successor state.) A predecessor of x is a state y ∈ X such that succ(y) = x. For that, we must have x = y + M·trans(y) . Since there are at most |T | candidates for the transition trans(y), it follows that the set pred(x) of all possible predecessors of x has cardinality no larger than |T |, and it can be constructed calling the successor oracle at most |T | times, as shown in Algorithm 2. Here, first a set cand(x) of all candidate transitions t ∈ T
123
Encoding the dynamics of deterministic systems
287
Algorithm 1 Implementing a successor-oracle by a valid orientation. Input: (G, u, D), x ∈ X Output: succ(x) 3: Construct the set T (x) of enabled transitions if T (x) = ∅ then return x 6: end if {Compute out-degree of transitions in the subgraph of D induced by T (x)} for t ∈ T (x) do
9: δ − (t) : = tt ∈ A : t ∈ T (x)
end for {Return successor state} 12: t ∗ ← t ∈ T (x) with δ − (t) = 0 return x + M·t ∗
Algorithm 2 An implementation for a predecessor-oracle. Input: (G, u, D), x ∈ X Output: pred(x) 3: {Construct set of transition candidates} cand(x) ← t ∈ T : xi + wit ≤ u i , ∀i ∈ P − (t) ∩ B; xi − wti ≥ 0, ∀i ∈ P + (t) {Call successor-oracle to construct sets of predecessors} 6: pred(x) ← ∅ for t ∈ cand(x) do y ← x − M·t 9: if trans(y) = t then pred(x) ← pred(x) ∪ {y} end if 12: end for {Return set of possible predecessors} return pred(x)
fulfilling y : = x − M·t ∈ X is computed, and later the condition t = trans(y) is tested for each candidate by calling the successor oracle. Computing successors and sets of predecessors is a key operation within simulation algorithms to study the dynamic behavior of a system and in particular to address the different questions described in the last section. To the best of our knowledge, currently no solution algorithm for these problems is known, which does not rely on storing explicit descriptions of the state digraph or some equivalent structure to compute succ(x) at every state x, which strongly limits the size of the networks that can be considered, due to the high memory requirements. Moreover, in certain application areas such as systems biology, the explicit values of succ(x) can only be determined by carrying out expensive and time-consuming wet lab experiments. In the context of biological systems, the concept of a regulatory structure was introduced in Marwan et al. (2008) as a mathematical model for an interaction network. Using our notation, a regulatory structure is a triple (G, u, A), where (G, u) describes a capacitated network and A is a partial order on the set of transitions. In the applications considered by the authors, this partial order contains enough constraints to identify trans(x) at each state x. In the next sections we extend the concept of regulatory structures in two directions: we consider which other kinds of priority
123
288
L. M. Torres, A. K. Wagler
relations among transitions can be used to encode the dynamics of a system in a compact manner, and we examine when a deterministic system admits such an encoding. Other approaches have been proposed for handling dynamic conflicts in Petri nets. For instance, in Runge (2004) colored Petri nets are used as models for metabolic networks in order to avoid dynamic conflicts that could lead to system deadlocks. In a colored Petri net, each token is painted with a color from a given set, and transitions are color-aware, i.e., for each transition t ∈ T information on the number of tokens consumed (resp. produced) from each pre-place (resp. at each post-place) when t is switched is specified for each color separately. If two transitions t1 , t2 ∈ T have a common pre-place i ∈ P, a dynamic conflict between t1 and t2 is avoided by specifying different color requirements for them. Thus, a token in i can enable only one of the transitions, depending on its color. The difference between this model and the one we present here lies in the application that is pursued: while in Runge (2004) colors are used as a means for ensuring that each token follows a certain metabolic pathway in the network with the goal of avoiding deadlocks, here we want to establish priorities among transitions as a compact way for encoding the dynamics of deterministic systems. 3 The transition conflict graph As observed in the last section, one key issue to be addressed when modeling the dynamic behavior of a deterministic system is the specification of a mechanism for the (unambiguous) resolution of dynamic conflicts between enabled transitions. This is precisely the idea upon which our model is built. In the following we introduce its first component in a more formal way and examine some of its properties. Let us start with a definition: Given a capacitated network (G, u), with G = (P ∪ T, A, w), the transition conflict graph of (G, u) is an undirected graph K(G,u) = (T, E) having as nodes the transitions from G, where two transitions t, t are joined by an edge if and only if there exists at least one state where both are enabled, i.e., tt ∈ E
⇔
X (t) ∩ X (t ) = ∅.
As long as there is no risk of confusion, we will simply write K instead of K(G,u) . It follows straightforwardly from this definition that, for every state x ∈ X , the set T (x) of enabled transitions induces a clique in K, i.e., a set of mutually adjacent nodes. Remark 1 The converse is not necessarily true, as it is shown in Fig. 1. Here, t1 , t2 and t4 form a clique in K, but there is no state x satisfying T (x) = {t1 , t2 , t4 }, as for these three transitions to be enabled we must have x2 = x5 = 1 and x3 = 0, and then t5 is also enabled. However, as the sets X (t) are boxes, it is straightforward to prove that at least the inclusionwise maximal cliques in K are associated with states of the system. The transition conflict graph K can be constructed in O(|P| |T |2 ) time using a straightforward algorithm to check for box intersections X (t)∩ X (t ). The next lemma provides a more efficient way of computation.
123
Encoding the dynamics of deterministic systems
(a)
289
(b)
Fig. 1 a A capacitated network of a dynamic system, and b the corresponding transition conflict graph. All place capacities and arc weights are assumed to be equal to one
Lemma 1 Consider a capacitated network (G, u), with G = (P ∪ T, A, w) and X (t) = ∅ ∀t ∈ T . Then t, t ∈ T are in conflict if and only if wit ≤ u i − wt i ∀i ∈ P − (t) ∩ P + (t ) ∩ B and wit ≤ u i − wti ∀i ∈ P − (t ) ∩ P + (t) ∩ B holds. Proof Remark that two transitions t, t ∈ T are in conflict if and only if X (t)∩ X (t ) = ∅. Assume wit > u i − wt i holds for some i ∈ P − (t) ∩ P + (t ) ∩ B, and observe that for any state x ∈ X (t) we must have xi ≥ wit > u i − wt i . But then, xi + wt i > u i implies t ∈ T (x), which is equivalent to saying x ∈ X (t ). Hence, X (t) ∩ X (t ) = ∅ follows. Necessity of the second condition can be proven in a similar way. On the other hand, assume both conditions hold, and consider the state x defined by: ⎧ wit , ⎪ ⎪ ⎨ wit , xi : = w∗ , ⎪ ⎪ ⎩ 0,
if i ∈ P − (t) \ P − (t ) if i ∈ P − (t ) \ P − (t) if i ∈ P − (t) ∩ P − (t ) otherwise,
where w ∗ : = max {wit , wit }. We will show that x ∈ X (t)∩ X (t ). To prove x ∈ X (t), observe that by construction any pre-place i ∈ P − (t) fulfills xi ≥ wit . Moreover, any place i ∈ P + (t) ∩ B \ P − (t ) has xi = 0 and must satisfy xi ≤ u i − wti , as otherwise X (t) = ∅. (Note that i ∈ P + (t) ⇒ i ∈ P − (t), since the network is simple). Finally, if i ∈ P + (t) ∩ P − (t ) ∩ B, then we have from the second condition xi = wit ≤ u i − wti . Analogously, x ∈ X (t ) follows from the first condition, and this completes the proof. Observe that, in the particular case where u = 1l, it follows as a corollary from the last lemma that two transitions t, t ∈ T are in conflict if and only if: P − (t) ∩ P + (t ) ∩ B = ∅ and P − (t ) ∩ P + (t) ∩ B = ∅.
(1)
The following example illustrates the previous results.
123
290
L. M. Torres, A. K. Wagler
Example 1 Consider the capacitated network (G, 1l), with G = (P ∪ T, A, 1l), from Fig. 1a. Checking the pre- and post-places for all transitions in T yields the following: ti t1 t2 t3 t4 t5
P − (ti ) {2} {2} {2} {5} {2, 5}
P + (ti ) {1} {3} {5} {1, 4} {3}
According to (1), all pairs of transitions are in conflict, except (t3 , t4 ) and (t3 , t5 ), and we obtain the transition conflict graph shown in Fig. 1b. A natural question is whether transition conflict graphs arising from capacitated networks have a special structure from a graph-theoretical point of view. Observe that, according to the characterization given in Lemma 1, adding a new place i, with u i = 1, to an existing network, together with arcs of the form (t, i) and (i, t ) connecting i to two conflicting transitions t and t , and setting wti = wit = 1, results in removing the corresponding edge tt from the conflict graph. This idea is used to prove the following result. Lemma 2 Let H be an arbitrary undirected graph. There exists a capacitated network (G, u), G = (P ∪ T, A, w), with the property that its transition conflict graph K is isomorphic to H . Proof Let H : = (V, E). Considerat first the network G : = (P ∪ T , A, 1l) with P : = {1} , T : = V , and A : = (1, t) : t ∈ T , and let u 1 = 1. As all transitions are enabled if x1 = 1, we have K(G ,u 1 ) = K V , i.e., the transition conflict graph of (G , u 1 ) is the complete graph on the set V of nodes. Now we make use of the above observation and introduce, for every pair t, t ∈ V such that tt ∈ E, a new place i in the network, together with the arcs (t, i) and (i, t ). Moreover, we set u i = wti = wit = 1. Since this results in deleting the edge tt from the conflict graph, in the end we obtain a capacitated network (G, u) for which K ∼ = H. We have noted that the set of enabled transitions T (x) for any state x ∈ X induces a clique on K and, conversely, that any inclusionwise maximal clique from K is related to a state. In fact, there are networks where every clique from K is associated to some state. Theorem 1 Let H be an arbitrary undirected graph and Q the family of all cliques from H . There exists a capacitated network (G, u), G = (P ∪ T, A, w), such that K is isomorphic to H and, for every Q ∈ Q, there is a state x ∈ X with T (x) = Q. Proof From Lemma 2 there is a capacitated network (G , u ), G : = (P ∪T, A , w ), having H as its transition conflict graph. Moreover, as shown in the proof of that lemma, we may assume all arc weights to be equal to one and all places to have capacities equal to one. We introduce a set of additional places P := {i(t) : t ∈ T } ,
123
Encoding the dynamics of deterministic systems
291
Fig. 2 For any arbitrary graph H , capacitated networks (G 1 , u 1 ) and (G 2 , u 2 ) can be constructed such that K(G 1 ,u 1 ) = K(G 2 ,u 2 ) = H . Moreover, every clique of H is associated to a state in the second network. All place capacities and arc weights are assumed to be equal to one
i.e., one new place for each transition in G . Furthermore, we define the set of arcs A : = {(i(t), t) : t ∈ T }, and let u i(t) = wi(t)t = 1, ∀t ∈ T . Denote by (G, 1l), G : = (P ∪ T, A, 1l), the new capacitated network, with P : = P ∪ P and A : = A ∪ A . It is straightforward to check that K(G ,u ) = K(G,u) = H , as all transition conflicts in G remain in G, and no new conflicts are introduced by the transformation described above. Now consider any clique Q ∈ Q in H . If Q is inclusionwise maximal, there is a state of G associated to Q, and the proof finishes. Otherwise, Q can ¯ Let x be a state of G be extended to an inclusionwise maximal clique Q : = Q ∪ Q. for which T (x) = Q . Observe that for every t ∈ Q we must have xi(t) = 1 at the corresponding pre-place i(t) ∈ P , as otherwise t is not enabled. Moreover, setting xi
:=
¯ 0, if i ∈ P and i = i(t) for some t ∈ Q, xi , otherwise,
we obtain a state where each transition from Q¯ is disabled, while the other transitions remain enabled. Hence, T (x ) = Q. Example 2 Figure 2 shows an example of the constructions described in Lemma 2 and Theorem 1. For the given graph H , two capacitated networks (G 1 , u 1 ) and (G 2 , u 2 ) are shown with K(G 1 ,u 1 ) = K(G 2 ,u 2 ) = H . Observe that the clique t2 t3 does not correspond to any state of G 1 . On the other hand, the reader can verify that every clique of H is associated with some state of G 2 . Indeed, any inclusionwise maximal clique Q is associated to a state x, and a state for a (non-maximal) clique Q ⊆ Q can be obtained from x by “switching off” individual transitions, setting to zero the token values at their corresponding pre-places 4, . . . , 7. This network is neither unique nor minimal as, for instance, deleting places 5 and 6 yields a new capacitated network with the same conflict graph and having also one state associated to every clique of H . As a generalization of the result from Theorem 1, one could ask whether, given an arbitrary graph H and an arbitrary family Q of cliques from H , (containing all inclusionwise maximal cliques) there exists a capacitated network (G, u), G = (P ∪ T, A, w), such that K is isomorphic to H and Q = {T (x) : x ∈ X }. We provide at
123
292
L. M. Torres, A. K. Wagler
next a necessary condition on Q for the case when all capacities and arc weights in (G, u) are equal to one. In order to state our result, we need to introduce some notation and a lemma. Definition 1 Let A be a family of sets and B ⊂ A. We say that A is closed under intersection with respect to B if, for each B ∈ B, the family: A B := {A ∩ B : A ∈ A, A ∩ B = ∅} is closed under intersection, i.e., for any A1 , A2 ∈ A B we have A1 ∩ A2 ∈ A B . Denote by P − (T1 ) and P + (T1 ) the sets of pre-places and post-places of a given set T1 ⊂ T of transitions, i.e., P − (T1 ) := ∪t∈T1 P − (t),
P + (T1 ) := ∪t∈T1 P + (t).
(2)
The following is straightforward to observe. Lemma 3 For any capacitated network (G, 1l), with G = (P ∪ T, A, 1l), if x ∈ X and t ∈ T , we have t ∈ T (x)
⇔
P − (t) ⊆ P − (T (x)) ∧ P + (t) ⊆ P + (T (x)).
Proof If t ∈ T (x), both set inclusions follow directly from the definitions in (2). Conversely, note that xi = 1 must hold for every i ∈ P − (T (x)), as otherwise some transition in T (x) would not be enabled. Similarly, we have xi = 0 for every i ∈ P + (T (x)). But then, t is enabled, as all its pre-transition places hold a token and all its post-transition places have enough free capacity, and it follows t ∈ T (x). Now we characterize families of cliques in the transition conflict graph related to sets of enabled transitions. Theorem 2 Let (G, 1l) be a capacitated network, with G = (P ∪T, A, 1l), K the corresponding transition conflict graph, and QM the family of all inclusionwise maximal cliques from K. Consider the family Q := {T (x) : x ∈ X } , containing all cliques from K that correspond to sets of enabled transitions of the system. Then, (i) QM ⊆ Q, (ii) Q is closed under intersection with respect to QM . Proof As observed at the beginning of the section, all inclusionwise maximal cliques are associated with states of the system. To prove (ii), let Q ∈ QM and consider two sets T1 , T2 ∈ Q Q , with T1 = T (x 1 ) ∩ Q and T2 = T (x 2 ) ∩ Q for some x 1 , x 2 ∈ X .
123
Encoding the dynamics of deterministic systems
293
From (i) we know there is a third state x 3 with T (x 3 ) = Q. Now consider the state xˆ defined by ⎧ ⎨ 0, if i ∈ P − (Q) \ P − (T1 ∩ T2 ), xˆi := 1, if i ∈ P + (Q) \ P + (T1 ∩ T2 ), ⎩ 3 xi , otherwise. Let t ∈ T1 ∩ T2 . Then xˆi = xi3 holds for every place i ∈ P − (t) ∪ P + (t) and, since t ˆ is enabled at x 3 (as t ∈ Q), it remains enabled at x. Conversely, assume t ∈ T (x) ˆ ∩ Q. Then we must have P − (t) ∩ [P − (Q) \ P − (T1 ∩ T2 )] = ∅, and P + (t) ∩ [P + (Q) \ P + (T1 ∩ T2 )] = ∅. It follows P − (t) ⊆ P − (T1 ∩ T2 ) ⊆ P − (Tk ) ⊆ P − (T (x k )), P + (t) ⊆ P + (T1 ∩ T2 ) ⊆ P + (Tk ) ⊆ P + (T (x k )), for k = 1, 2. But then, from Lemma 3 we conclude that t is enabled at both states x 1 and x 2 . Hence, t ∈ T1 ∩ T2 , as t ∈ Q. ˆ ∩ Q for some state xˆ ∈ X . It follows that We have proven that T1 ∩ T2 = T (x) Q Q is closed under intersection. 4 Valid orientations As stated in the introduction, our main purpose is to encode the dynamics of a given deterministic system S = (G, u, trans) in a compact way, by introducing enough priority relations among transitions, as to be able to determine trans(x) for every x ∈ X . We have observed that the set of enabled transitions at each state corresponds to a clique in the transition conflict graph K, and hence K is a plausible candidate for a framework where these priorities could be embedded. This idea motivates the following definition. Definition 2 Let D(G,u) = (T, A) be a directed graph obtained by orienting the edges of K(G,u) . D(G,u) is said to be valid for the system S = (G, u, trans) if, for every state x ∈ X with T (x) = ∅, the subgraph induced by the nodes from T (x) has a unique sink, and this sink coincides with trans(x). As for the unoriented transition conflict graph, we will write in the following D instead of D(G,u) whenever there is no risk of confusion. Observe that the existence of a valid orientation implicitly imposes a further requirement on the nature of a dynamic system. Namely, if two states x, x ∗ ∈ X have the same set T (x) = T (x ∗ ) of enabled transitions, then both induce the same subgraph of D and, therefore, trans(x) = trans(x ∗ ) must hold. Moreover, if a transition t is enabled at two states x, x ∈ X and t is the highest-priority transition at x, then either t is also the highest-priority
123
294
L. M. Torres, A. K. Wagler
transition at x or trans(x ) ∈ T (x). The next result shows that this condition is also sufficient for the existence of a valid orientation. Theorem 3 A system S = (G, u, trans) admits a valid orientation if and only if the following consistency condition holds: For any pair of states x and x , if trans(x) ∈ T (x) ∩ T (x ) then either trans(x ) = trans(x) or trans(x ) ∈ T (x ) \ T (x). Proof Let Q be the family of cliques in K that are related to states of the network, i.e., Q := {Q ⊆ T : Q = T (x) for some x ∈ X } . Since this family is finite, we may assume Q = {Q 1 , . . . , Q k }. Now consider the following orientation algorithm: For each 1 ≤ i ≤ k, choose (arbitrarily) a state x i ∈ X with T (x i ) = Q i , and orient the edges {t, trans(x i )}, t ∈ T (x i ) \ {trans(x i )}, in K as arcs (t, trans(x i )). If this process is consistent in the sense that no edge is oriented in opposite directions during two different iterations, then obviously it produces a valid orientation upon termination (any edges remaining unoriented when the algorithm finishes can be oriented arbitrarily). Otherwise, there is some edge tt oriented as (t , t) in some iteration i, and oriented as (t, t ) in another iteration j. But then t, t ∈ T (x i ) ∩ T (x j ), t = trans(x i ) and t = trans(x j ), which violates the consistency condition. The construction given in the last proof shows that an edge tt of K can be oriented arbitrarily if neither t nor t is the highest-priority transition at any state of the system. This observation motivates the definition of a dominance concept for transition conflicts, which was already mentioned in Wagler and Weismantel (2009). Definition 3 A conflict between two transitions t, t is dominated according to a cer tain valid orientation D, if for any state x ∈ X (t) ∩ X (t ), there exists a third transition ˆt ∈ T (x) \ t, t , with tˆ = trans(x). Obviously, dominated conflicts do not play a role in explaining the dynamic behavior of a system. The next example illustrates this. Example 3 Consider again the system given by the network G in Fig. 1a. Table 1 lists all states of the system having at least two enabled transitions. Figure 3 depicts two valid orientations D and D for the transition conflict graph K, which differ in the direction chosen for the edge t1 t2 . One can check that at any state x ∈ X the node set corresponding to T (x) induces a subgraph of D (resp. D ) with a unique sink. Moreover, both orientations encode the same dynamic behavior, as the sinks at each state coincide. The reason for this is that no relation between t1 and t2 is required, since at any state x where both transitions are enabled, either t3 or t5 is enabled too: such a state has to satisfy x1 = 0, x2 = 1, and x3 = 0, but then x5 = 0 (resp. x5 = 1) implies t3 ∈ T (x) (resp. t5 ∈ T (x)). Since both t3 and t5 have higher priorities than t1 and t2 , no conflicts can occur.
123
Encoding the dynamics of deterministic systems Table 1 All states of the network G from Fig. 1a having at least two enabled transitions
295
x1
x2
x3
x4
x5
T (x)
0
1
0
0
0
{t1 , t2 , t3 }
0
1
0
0
1
{t1 , t2 , t4 , t5 }
0
1
0
1
0
{t1 , t2 , t3 }
0
1
0
1
1
{t1 , t2 , t5 }
0
1
1
0
0
{t1 , t3 }
0
1
1
0
1
{t1 , t4 }
0
1
1
1
0
{t1 , t3 }
1
1
0
0
0
{t2 , t3 }
1
1
0
0
1
{t2 , t5 }
1
1
0
1
0
{t2 , t3 }
1
1
0
1
1
{t2 , t5 }
Fig. 3 Two valid orientations for the conflict graph K from Fig. 1b. Both encode the same dynamical behavior
Observe that edges corresponding to dominated conflicts could in principle be deleted from the transition conflict graph without any loss of information about the dynamics of the system. However, doing so would destroy the structural property that any state of X induces a clique on K. Another issue of interest concerns the recognition of valid orientations: Given a capacitated network (G, u), and an orientation D of the edges in the transition conflict graph, determine whether D induces a valid dynamic behavior on G, in the sense that for every state x ∈ X , the corresponding clique in D has a unique sink. Observe that a clique cannot have more than one sink, and that every clique without a sink contains a directed cycle. Hence, if D is acyclic then every clique of the graph has a unique sink, and we obtain the following result: Observation 1 Every acyclic orientation of K is valid. On the other hand, the next example shows that there are certain deterministic systems for which the valid orientation encoding the dynamic behavior contains directed cycles. Example 4 Figure 4 depicts a capacitated network (G, 1l) together with a valid orientation D of the transition conflict graph that contains a directed cycle C = (t1 , t2 , t3 ).
123
296
L. M. Torres, A. K. Wagler
Fig. 4 A capacitated network and a valid orientation for its transition conflict graph which contains a directed cycle C = (t1 , t2 , t3 ). All arc weights and capacities of the places are assumed to be equal to one Table 2 All branching states of the system from Fig. 4
x1
x2
x3
x4
T (x)
1
1
0
0
{t1 , t2 }
0
1
1
0
{t2 , t3 }
1
0
1
0
{t1 , t3 }
1
1
1
0
{t1 , t2 , t3 , t4 }
Again, the weight on each arc and the capacity of each place of the network is assumed to be equal to 1. Table 2 lists all branching states of the system and the corresponding sets of enabled transitions. It is straightforward to check that each of these sets induces a clique in D with a unique sink. Observe that the direction of every arc in C is essential for encoding the dynamic behavior of the system, as for any t, t ∈ {t1 , t2 , t3 }, there is at least one state x ∈ X with T (x) = t, t . Moreover, once either t or t has been switched, the other transition is no longer enabled, due to the capacity constraint at place 4. The fact that one has to check, for each clique Q in K, if there is a corresponding state x ∈ X with T (x) = Q makes the recognition of valid orientations hard in general, as there might be up to 2|T | cliques. In the following we describe a special class of orientations for which this recognition problem can be solved efficiently. Recall from Example 2 that two different dynamic systems might share the same transition conflict graph and, let us define the following equivalence relation between capacitated networks: (G, u) ∼K (G , u )
⇔
K(G,u) ∼ = K(G ,u ) ,
where ∼ = stands for graph isomorphism. An orientation is said to be strongly valid if it is valid for all networks of some equivalence class of ∼K . Acyclic orientations are one specific example of strongly valid orientations. In general, any orientation where every clique has a unique sink is (trivially) strongly valid. Moreover, the converse is also true, as it follows from Theorem 1 that each equivalence class contains a capacitated network (G, u) with the property that every clique in K is associated to a state. This fact makes strongly valid orientations easy to recognize.
123
Encoding the dynamics of deterministic systems
297
Theorem 4 An orientation D of the transition conflict graph of a capacitated network (G, u) is strongly valid if and only if it does not contain any directed cycle of length 3. Proof Trivially, if D contains a directed cycle of length 3, then this cycle induces a clique without sink, and D is not strongly valid. Conversely, assume D = (T, A) contains some clique Q without a sink. Since the out-degree of every node in Q is at least one, there is a directed cycle C0 : = (t1 , t2 , t3 , . . . , tk ), with ti ∈ Q for all 1 ≤ i ≤ k. Assume k > 3, since otherwise there is nothing to prove. Now consider the direction of edge t1 t3 . If (t3 , t1 ) ∈ A, then {t1 , t2 , t3 } induces a directed cycle of length three, and we are done. Otherwise, if (t1 , t3 ) ∈ A, we can define a directed cycle C1 : = (t1 , t3 , t4 , . . . , tk ) containing exactly one node less than C0 . Repeating this procedure at most k − 3 times, a directed cycle of length 3 is exposed. 5 Conclusions We have examined a new approach for encoding the dynamic behavior of certain deterministic discrete systems that relies on extending the familiar framework of Petri nets. Our encoding consists in a realization of the successor-oracle as a valid orientation of the edges of the transition conflict graph K, together with Algorithm 1. This encoding is compact in the sense that the amount of space required for its storage is polynomial in the size of the network. Therefore, it is well-suited for being integrated into simulation algorithms to study the dynamics of large complex deterministic systems, and to address issues such as reachability, boundedness, existence of deadlocks, and liveness, among others. A possible interesting extension of our model concerns the study of dynamic systems where the concurrent switch of various transitions can occur. Throughout this paper we have assumed that a change from a state x ∈ X to its successor state succ(x) can always be explained by the switch of a single transition trans(x). However, there are deterministic systems where this does not hold, as shown in the following example. Example 5 Consider a deterministic system (G, 1l, succ) with network G as depicted in Fig. 5 and all arc weights equal to 1. It is straightforward to check that the system has the four branching states x 0 , . . . , x 3 shown in the figure. The following table lists the sets of enabled transitions at each of these states, as well as the corresponding successor states specified by succ: j 0 1 2 3
branching state x j (1, 1, 0, 0)T (0, 1, 1, 0)T (1, 0, 0, 1)T (1, 1, 1, 0)T
T (x j ) {t1 , t2 } {t2 , t3 } {t1 , t4 } {t2 , t3 }
succ(x j ) (0, 0, 1, 1)T (0, 1, 0, 1)T (0, 1, 0, 0)T (1, 1, 0, 1)T
Observe that t1 and t2 have to be switched concurrently at state x 0 to reach succ(x 0 ), whereas at each of the other branching states a single transition is switched to reach the corresponding successor state, namely, t3 at x 1 or x 4 , and t4 at x 2 . The enabled transitions are highlighted in gray in Fig. 5, while the transitions actually switched are marked in bold.
123
298
L. M. Torres, A. K. Wagler
Fig. 5 A deterministic system whose dynamic behavior cannot be modeled via a transition selection function. The enabled transitions at each state are highlighted in gray, the next transitions to be switched are shown in bold. All place capacities and arc weights are assumed to be equal to one
The above successor function cannot be realized with the help of a transition selection function trans due to the following reason. Considering x 0 as initial state, trans has to select one of the transitions t1 , t2 ∈ T (x 0 ). However, any choice leads to an intermediate state (x 1 for trans(x 0 ) = t1 , x 2 for trans(x 0 ) = t2 ) where the remaining transition from T (x 0 ) is still enabled but must not be selected, as both trans(x 1 ) = t3 and trans(x 2 ) = t4 are implied by the the specification of succ. (See the reachability graph in Figure 5.) Thus, none of the potential interleaving sequences between x 0 and succ(x 0 ) can be expressed by means of a sequence of single transition switches such that every switch is determined by the value of trans at the corresponding state. One way of dealing with these systems could be through the inclusion of pseudonodes in the transition conflict graph, to account for the simultaneous switching of various transitions. The disadvantage of such a modification is the dramatic increase in the size of the transition conflict graph, as (in the worst-case) the number of required pseudo-nodes may grow exponentially with respect to |T |. To keep the size of K polynomial, a new model parameter could be defined which limits the number of transitions that can be switched at the same time. An alternative approach consists in working on a slightly different transition conflict graph, where an edge between two transitions means that they are in dynamic conflict. In this case, T (x) does no longer induce a clique on K. Yet we can now define an orientation to be valid if for any state x ∈ X the set T (x) of enabled transitions induces a subgraph containing at least one sink. These sinks reveal an anti-chain of transitions with maximal priorities, which have to be switched concurrently. Theorem 3 can be generalized to this new setting in a straightforward manner, characterizing which deterministic systems admit valid orientations. The advantage of this scheme is that it is still compact with regard to the size of the network G. However, as the sets T (x) do not induce cliques in the conflict graph, many of the combinatorial properties pointed out in Sect. 3 do not hold anymore. Moreover, since all transitions that may switch concurrently are required to do so, it is again possible to construct examples of deterministic systems whose behavior cannot be modeled in this way.
123
Encoding the dynamics of deterministic systems
299
Finally, in some applications, for instance in systems biology, the set of rules governing the dynamic behavior of the system (i.e., the valid orientation in our model) is not known a priori, but has to be reconstructed from information provided by experimental observation. This raises other interesting questions, for instance, the search for minimal sets of edges in K such that knowledge about their orientation allows to infer the orientation of the remaining edges, see Torres and Wagler (2010) for first concepts and results. Such kind of issues are specially relevant in practice, as they can be used to assist the design of experiments, such that unnecessary experiments are avoided, as these are expensive and time-consuming.
References Adam NR, Atluri V, Huang WK (1998) Modeling and analysis of workflows using Petri nets. J Intell Inf Syst 10(2):131–158. doi:10.1023/A:1008656726700 Balbo G (2002) Introducation to stochastic Petri nets. In: Lectures on formal methods and performance analysis: first EEF/Euro summer school on trends in computer science, Springer, New York, pp 84–155 Billington J, Diaz M, Rozenberg G (1999) Application of Petri nets to communication networks, advances in Petri nets. Springer, London Caprotti O, Ferscha A, Hong H (1995) Reachability test in Petri nets by Gröbner bases. RISC-Linz Report Series 95–03, Research Institute for Symbolic Computation, Linz Chandler A, Heyworth A (1999) Gröbner basis procedures for testing Petri nets. UWB Math preprint 99.11, University of Wales, Wales. arXiv:math/0002119v1 Chaouiya C (2007) Petri net modelling of biological networks. Briefings in Bioinformatics pp bbm029+. doi:10.1093/bib/bbm029 Chaouiya C, Remy E, Thieffry D (2008) Petri net modelling of biological regulatory networks. J Discret Algorithms 6(2):165–177. doi:10.1016/j.jda.2007.06.003 David R, Alla H (2005) Discrete, continuous, and hybrid Petri nets. Springer, Berlin Gu T, Bahri PA (2002) A survey of Petri net applications in batch processes. Comput Ind 47(1):99–111. doi:10.1016/S0166-3615(01)00142-7 Hardy S, Robillard PN (2004) Modeling and simulation of molecular biology systems using Petri nets: modeling goals of various approaches. J Bioinformatics Comput Biol 2(4):619–637 Jensen K (1997) Coloured Petri nets: basic concepts, analysis methods and practical use, vol 3. Springer, New York Koch I, Heiner M, (2008) Petri nets In: Junker BH, Schreiber F (eds) Analysis of biological networks, Wiley book series in bioinformatics, pp 139–180 Lipton R (1976) The reachability problem requires exponential space. Research Report 62, Computer Science Department, Yale University, USA Marsan M, Balbo G, Donatelli S, Franceschinis G, Conte G (1995) Modelling with generalized stochastic Petri nets, Wiley series in parallel computing Marwan W (2003) Theory of time-resolved somatic complementation and its use for the analysis of the sporulation control network of physarum polycephalum. Genetics 164:105–115 Marwan W, Starostzik C (2002) The sequence of regulatory events in the sporulation control network of physarum polycephalum analysed by time-resolved somatic complementation of mutants. Protist 153:391–400 Marwan W, Sujatha A, Starostzik C (2005) Reconstructing the regulatory network controlling commitment and sporulation in physarum polycephalum based on hierarchical Petri net modeling and simulation. J Theor Biol 236:349–365 Marwan W, Wagler A, Weismantel R (2008) A mathematical approach to solve the network reconstruction problem. Math Methods Oper Res 67:117–132 Matsuno H, Aoshima H, Doi A, Tanaka Y, Matsui M (2003) Biopathways representation and simulation on hybrid functional Petri net. In Silico Biol. 3(3):389–404 Mayr EW (1981) An algorithm for the general Petri net reachability problem. In: Proceedings of the 13th Ann. ACM Symposium on theory of computing, ACM Press, New York, pp 238–246
123
300
L. M. Torres, A. K. Wagler
Mayr EW (1984) An algorithm for the general Petri net reachability problem. SIAM J Comput 13(3): 441–460 Mayr EW (1995) On polynomial ideals, their complexity and applications In: Reichel H (ed) Fundamentals of computation theory, no. 965 in Lecture Notes in Computer Science. Springer, Berlin, pp 89–105 Reisig W (1985) Petri nets: an introduction. Springer, New York Reisig W (1998) Elements of distributed algorithms: modeling and analysis with Petri nets. Springer, New York Runge T (2004) Application of coloured Petri nets in systems biology. In: Proceedings of the 5th workshop on CPN. University of Aarhus, Aarhus, pp 77–95 Torres LM, Wagler A (2010) Model reconstruction for discrete deterministic systems. Electron notes Discret Math 36:175–182 Wagler A, Weismantel R (2009) The combinatorics of modeling and analyzing biological systems. Nat Comput (to appear). doi:10.1007/S11047-009-9165-5 Yakovlev A, Koelmans A, Semenov A, Kinniment D (1996) Modelling, analysis and synthesis of asynchronous control circuits using Petri nets. Integr VLSI J 21(3): 143–170. doi:10.1016/ S0167-9260(96)00010-7
123