Least-Cost Transition Firing Sequence Estimation in Labeled Petri Nets with Unobservable Transitions Lingxi Li and Christoforos N. Hadjicostis Abstract This paper proposes an approach for estimating the least-cost transition firing sequence(s) that matches (match) the observation of a sequence of labels produced by transition activity in a given labeled Petri net. Each transition in the labeled net is associated with a (possibly empty) label and also with a nonnegative cost which captures its likelihood (e.g., in terms of the amount of workload or power required to execute the transition). Given full knowledge of the structure of the labeled Petri net and the observation of a sequence of labels, we aim at finding the transition firing sequence(s) that is (are) consistent with both the observed label sequence and the Petri net, and has (have) the least total cost (i.e., the least sum of individual transition costs). The existence of unobservable transitions makes this task extremely challenging since the number of firing sequences that might be consistent with an observed sequence of labels and the given Petri net can potentially be infinite. Under the assumption that the unobservable transitions in the net form an acyclic subnet and have strictly positive costs, we develop a recursive algorithm that is able to find the least-cost firing sequence(s) by reconstructing only The work of L. Li was supported in part by an Indiana University-Purdue University Indianapolis (IUPUI) RSFG grant. The work of C. N. Hadjicostis was supported in part by the National Science Foundation (NSF) under NSF EPNES Award 0224729 and NSF ITR Award 0426831. The research leading to these results has also received funding from the European Community (EC) Seventh Framework Programme (FP7/2007-2013) under grant agreements INFSO-ICT-223844 and PIRG02GA-2007-224877. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the authors and do not necessarily reflect the views of NSF or EC. Lingxi Li is with the Department of Electrical and Computer Engineering, Indiana University-Purdue University Indianapolis. C. N. Hadjicostis is with the Department of Electrical and Computer Engineering, University of Cyprus, and also with the Coordinated Science Laboratory, and the Department of Electrical and Computer Engineering, University of Illinois at UrbanaChampaign. Corresponding author: C. N. Hadjicostis, 110 Green Park, 75 Kallipoleos Avenue, P.O. Box 20537, 1678 Nicosia, Cyprus. Email: chadjic@ucy.ac.cy. a finite number of firing sequences. In particular, if the unobservable transitions in the net are contactfree, the proposed recursive algorithm finds the least-cost transition firing sequences with complexity that is polynomial in the length of the observed sequence of labels. Note to Practitioners Petri nets are used to model and analyze dynamical systems, such as manufacturing systems, transportation systems, and communication systems. As the size and complexity of these widespread systems increase due to higher integration and market penetration, it is important to develop efficient state and event estimation approaches for the purposes of monitoring and fault diagnosis. This paper studies event estimation in systems that are modeled by labeled Petri nets. The problem is challenging because two different types of uncertainty might arise due to sensor limitations: (i) occurrences of different activity (namely, the firings of different transitions) may generate the same observation; (ii) unobservable activity (transitions) may not generate any observation. By associating to each activity (transition) a measure of its viability or execution cost, we develop an algorithm that is able to estimate the least-cost (most likely) transition firing sequence as long as unobservable transitions have strictly positive costs and form an acyclic unobservable subnet. When unobservable transitions are contact-free, the complexity of the proposed algorithm is polynomial in the length of the sequence of observations. As we illustrate in the paper, the approach is useful for a variety of event estimation problems in many practical systems including, for example, planning sequence estimation in manufacturing systems. Index Terms Labeled Petri nets, transition firing sequence, reconstruction, least-cost event estimation I. I NTRODUCTION Petri nets (PNs) are widely used to model and analyze discrete event dynamic systems [1]–[3]. Petri net models can compactly represent system behavior, and the graphical representation of a plant as a Petri net can have advantages when trying to design a monitor or a supervisor to devise control or diagnosis strategies for a given plant. As the size and complexity of practical systems increase, significant attention is paid to problems of robust diagnosis, supervisory control, and estimation of system state or activity [4]–[12]. One of the most well-studied estimation problems in Petri nets is that of estimating the state of a given Petri net based on the observation of its event sequence. For instance, in [12], [13], the authors present an algorithm for obtaining an estimate (and a corresponding error bound) for the marking (state) of a given Petri net based on full knowledge of the observed firing sequence but without knowledge of the initial marking; the marking estimate is then used to design a controller. The authors of [14] considered marking estimation in a Petri net with silent transitions (i.e., unobservable transitions) and showed that, if every observable transition in the net is associated with a distinct label, and the unobservable subnet is acyclic and backward conflict-free (i.e., if all silent transitions have no common output place), then the set of markings consistent with an observed sequence of labels can be represented by a linear system whose size is independent of the length of the observed label sequence. In this paper we address the problem of finding the least-cost transition firing sequence(s) (LCTFS) for a given labeled Petri net based on the observation of a sequence of labels. The net possesses both observable transitions (which are associated with a possibly non-unique label) and unobservable transitions (whose firings do not generate any label observations). We assume that each transition in the given labeled Petri net is associated with a nonnegative cost that captures its likelihood (e.g., in terms of the workload or the amount of power needed to execute a certain transition [15]). Given the observation of a sequence of labels, our task is to find the transition firing sequence(s) which: (i) is (are) consistent with both the observed label sequence and the Petri net structure, and (ii) has (have) the least total cost (the total cost of a transition firing sequence is taken to be the sum of the costs of the individual transitions in the sequence). Naturally, the approach also leads to a least-cost estimate of the marking (state) of the Petri net based on the observation of a sequence of labels. Note that a special case of what we consider here is labeled Petri nets in which all transitions are observable. For this setup, our previous work in [16], [17] showed that given an observed sequence of labels of length k, the corresponding LCTFS can be obtained via a recursive algorithm with complexity that is polynomial in the length k. The algorithm operates recursively on the trellis diagram [18], i.e., a diagram that concisely captures the evolution of possible markings in the Petri net and is driven by the transition sequence(s) that is (are) consistent with the observed sequence of labels. The recursion is in terms of each label observed and the algorithm finds, among all length-k firing sequences that are consistent with the observed sequence, the one(s) that has (have) the least cost. In this paper we extend the above approach to the case of labeled Petri nets in which unobservable transitions are present. Due to the existence of unobservable transitions, an observed sequence of labels of length k can be associated with transition firing sequences of length greater than or equal to k. Thus, in the absence of any additional assumptions or restrictions, the number of transition firing sequences and their lengths can potentially be infinite, 1 which significantly complicates our task. However, when unobservable transitions form an acyclic subnet and have strictly positive costs, we are able to develop a recursive algorithm that can find the LCTFS while only reconstructing a finite number of transition firing sequences. Furthermore, if all unobservable transitions in the net are contact-free (i.e., if the unobservable transitions do not share any of their input and output places and do not have self loops associated with them), this recursive algorithm has complexity that is polynomial in the length k of the observed sequence of labels. The proposed approach in this paper can be applied to a variety of applications in practical systems, including fault diagnosis in distributed systems [19], [20], scheduling and routing of automated guided vehicle systems [21], and planning sequence estimation in manufacturing systems [22]–[26]. Planning has emerged as one of the most important aspects in manufacturing systems, and researchers have studied several different aspects of planning problems using Petri nets: assembly and task planning [22], [23], disassembly planning [24], [25], process planning [26], and others. More generally, assembly and process planning can be treated as sequence planning problems where different sequences of activities can accomplish identical tasks (e.g., the assembly of a product); the goal in such settings is to determine a (feasible and optimal) sequence of activities based on particular criteria of interest [23], [26]. To better understand how the problem that we consider in this paper can be seen as the sequence planning problem in manufacturing systems in the context of labeled Petri nets, we need to consider the following associations: (i) the given sequence of labels represents a sequence of (possibly different) tasks, each of which may be accomplished via a set of different transitions (which represent different alternatives for accomplishing a specific task); (ii) the structure of a given labeled Petri net represents the ways in which different tasks can be accomplished and the interactions among them as imposed by the underlying manufacturing system; (iii) the nonnegative cost associated with each transition in the given net represents its viability or process cost (e.g., in terms of the amount of workload or power required to start a machine or assemble a part). Then, given a sequence of labels (i.e., a sequence of tasks) that need to be accomplished, the proposed recursive algorithm finds the transition firing sequence(s) (i.e., the sequence(s) of 1 This, for example, could be the case in Petri nets where cycles of unobservable transitions are present and enabled. activities) that accomplishes (accomplish) the specified sequence of tasks and has (have) the least total cost, while adhering to the constraints imposed by the given Petri net. Also note that, under some structural constraints on the unobservable transitions, the recursive algorithm proposed in this paper finds the least-cost transition firing sequence(s) with complexity that is polynomial in the length of the given sequence of labels (tasks); this means that we are able to efficiently plan a sequence of activities that agrees with the structure (and dynamics) of the underlying manufacturing system and accomplishes the desirable sequence of tasks with the least total cost (which serves as the optimality criterion in this case). The example in Section IV.F helps illustrate the connections between planning of sequences of activities in manufacturing systems and the algorithmic techniques developed in this paper. This paper is organized as follows. In Section II we introduce necessary notation for our development. In Section III we formulate the problem to be studied and briefly review the approach for obtaining LCTFS when all transitions in the net are observable. In Section IV we develop a recursive algorithm that obtains LCTFS for the more challenging case where unobservable transitions may be present in the net, and analyze its complexity. An example of two parallel working machines is provided to illustrate our approach. Conclusions and directions for future work are discussed in Section V. II. P ETRI NET NOTATION In this section, we provide basic definitions and terminology that will be used throughout the paper. More details about Petri nets can be found in [27], [28]. Definition 1 A Petri net structure is a weighted bipartite graph N = (P, T, A,W ) where P = {p1 , p2 , . . . , pn } is a finite set of n places (drawn as circles), T = {t1 ,t2 , . . . ,tm } is a finite set of m transitions (drawn as bars), A ⊆ (P × T ) ∪ (T × P) is a set of arcs (from places to transitions and from transitions to places), and W : A → {1, 2, 3, . . .} is the weight function on the arcs. A marking is a vector M : P → N n that assigns to each place of the Petri net a nonnegative integer number of tokens (drawn as black dots). We use M(p) to denote the marking of place p (i.e., the number of tokens in place p). A Petri net is denoted by < N, M0 >, where M0 denotes the initial marking of the Petri net. Let b− i j = W (pi ,t j ) denote the integer weight of the arc from place p i to transition t j , and b+ i j = W (t j , pi ) denote the integer weight of the arc from transition t j to place pi (1 ≤ i ≤ n, + 1 ≤ j ≤ m). Note that b− i j (or bi j ) is taken to be zero if there is no arc from place pi to transition t j (or vice versa). We define the input incident matrix B− = [b− i j ] (respectively the − + th output incident matrix B+ = [b+ i j ]) to be the n × m matrix with bi j (respectively bi j ) at its i row, jth column position. The incident matrix of the Petri net is defined to be B ≡ B + − B− . Note that N = (P, T, A,W ) can be equivalently described by N = (P, T, B−, B+ ). Let • p (•t) denote the set of input transitions (places) of place p (transition t) and p• (t • ) denote the set of output transitions (places) of place p (transition t). Also, let • p• = • p S p • (• t • = • t S • t ) denote the set of input and output transitions (places) of place p (transition t). Transition t is said to be enabled if each of its input places p has at least B − (p,t) tokens, where B− (p,t) is the weight of the arc from place p to transition t. We use M[ti to denote that t is enabled at marking M. An enabled transition t may fire and, when it fires, it removes B − (p,t) tokens from each input place p of t (p ∈ •t) and deposits B+ (p0 ,t) tokens to each output place p0 of t (p0 ∈ t • ), yielding a new marking M 0 = M + B(:,t), where B(:,t) denotes the column of B that corresponds to t. The firing of transition t leading to marking M 0 is denoted by M[tiM 0. Let σ = ti1ti2 . . .tik (ti j ∈ T , j ∈ {1, 2, . . ., k}) be a transition firing sequence. We say σ is enabled with respect to M if M[ti1 iM1 [ti2 iM2 . . . Mk−1 [tik i where M1 , M2 , . . . Mk−1 are intermediate markings with nonnegative integer entries; this is denoted by M[σ i. Let M[σ iMk denote that the firing of σ from M yields Mk and let σ (t) be the total number of occurrences of transition t in σ . More specifically, σ = [σ (t1 ) σ (t2) . . . σ (tm )]T is the firing vector that corresponds to σ . The firing vector of a single transition ti , 1 ≤ i ≤ m is denoted by t¯i , i.e., by an m-dimensional column vector with a single nonzero entry with value “1” at its ith place. The empty transition firing sequence is denoted by ε and its corresponding firing vector is ~0m , an m-dimensional column vector with all entries set to zero. Note that after firing a sequence of transitions σ from marking M, the final marking Mk can also be computed as Mk = M + Bσ ; in such case, we say that marking Mk is reachable from marking M via firing sequence σ . Two firing vectors σ̄ 0 and σ̄ that have the same dimension can be compared element-wise. More specifically, we use σ̄ 0 σ̄ to denote that σ̄ 0 ≤ σ̄ (elementwise) and σ̄ 0 6= σ̄ . Note that ≤ is only a partial order relation in this case and there exist σ̄ 0 and σ̄ that are not comparable. For instance, the firing vectors σ̄ 0 = [1 1 2]T and σ̄ = [2 2 0]T are not comparable because the first two elements of σ̄ 0 are smaller than those of σ̄ while the third element is larger than that of σ̄ . In other words, they do not satisfy σ̄ 0 ≤ σ̄ or σ̄ ≤ σ̄ 0 (element-wise). In this paper we assume that unobservable transitions may be present in the net. Thus, the set of transitions T is partitioned into two sets To and Tu , such that T = To ∪ Tu and To ∩ Tu = 0, / where To is the set of observable transitions and Tu is the set of unobservable transitions. Definition 2 A labeled Petri net NLε with unobservable transitions is a four-tuple NLε = (N, M0 , S Σ {ε }, Lε ) where N = (P, T, A,W ) is a Petri net structure, M0 is the initial marking of the Petri net, Σ is an alphabet of transition labels, ε is the empty label, and L ε : T → Σ ∪ {ε } is the transition labeling function that assigns to each observable transition in the net a label from Σ and assigns to each unobservable transition the label ε . Without loss of generality, the mapping Lε can be assumed to be surjective. Note that in our setup, two or more transitions may correspond to the same label in the net. For each label l ∈ Σ, we use Tl to denote the set of observable transitions associated with label l; the set of unobservable transitions is given by Tε = {t ∈ T | Lε (t) = ε } = Tu . We use mu = |Tu | to denote the number of unobservable transitions in the net (|Tu | is the cardinality of the set Tu ). Given a transition sequence σ = ti1ti2 . . .tik , the corresponding label sequence is denoted by ω and is given by ω = L(σ ) ≡ L(ti1 )L(ti2 ) . . .L(tik ). Note that when unobservable transitions exist, the length of a sequence σ (denoted by |σ |) is always equal to or greater than the length of the corresponding label sequence ω (denoted by |ω |). More specifically, if transition sequence σ contains d (d ≥ 0) unobservable transitions with label ε , then |σ | = |ω | + d. Definition 3 Given an initial marking M0 and an observed label sequence ω , the set of consistent markings with respect to ω is Z(ω ) = {M | ∃σ : M0 [σ iM and L(σ ) = ω }. Definition 4 Given an observed label sequence ω = l1 l2 . . . lk (li ∈ Σ, i ∈ {1, 2, . . ., k}), ω j = l1 l2 . . . l j is the prefix of ω of length j ≤ k, denoted by ω j ω . Similarly, given a transition firing sequence σ = ti1ti2 . . .tik , σ j = ti1ti2 . . .ti j is the prefix of σ with length j ≤ k, denoted by σ j σ . The empty sequence of observed labels is denoted by ε . Definition 5 A cost function C : To → R0+ and Tu → R + assigns to each observable transition in the net a nonnegative cost and to each unobservable transition a strictly positive cost. We denote the total cost C(σ ) of a transition sequence σ as the sum of the individual costs of all transitions in σ . Thus, given a transition sequence σ = ti1ti2 . . .tik , its total cost is given by C(σ ) = ∑kj=1 C(ti j ). Clearly, the total cost of all transition firing sequences associated with firing vector σ̄ = [σ̄ (t1 ), σ̄ (t2 ), . . ., σ̄ (tm )]T is the same and is given by C(σ̄ ) = ∑mj=1 σ̄ (t j )C(t j ). In our analysis we take the cost of a transition to be a constant but we can easily handle cases where the costs of transition change (but are known) between observations. Note that some of the results in this paper assume that the unobservable transitions in the given labeled Petri net form an unobservable subnet that is acyclic, this assumption is explained in the definitions below. S Definition 6 Given a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, Lε ) with a subset Tu ⊆ T of unobservable transitions, we define the unobservable subnet of NLε as + − + the new Petri net Nu = (P, Tu , B− u , Bu ) where Bu (Bu ) is the matrix consisting of the columns of the input (output) incidence matrix B− (B+ ) that are associated with unobservable transitions in Tu . The net Nu can be obtained from NLε by removing all transitions t ∈ To (To = T − Tu ), as well as the arcs associated with them. Definition 7 An unobservable subnet is said to be acyclic if there is no directed circuit of unobservable transitions. A special case of a Petri net with an acyclic unobservable subnet is the case of a Petri net whose unobservable transitions are contact-free, as explained in the definition below. Definition 8 Two transitions ti and t j are said to be contact-free if • ti• •t • j ∩tj T• • T t j = 0, / •ti ti• = 0, / and = 0, / i.e., the two transitions do not share any of their input and output places and they do not have self-loops associated with them. A Petri net is contact-free if its transitions have no self-loops and all pairs of transitions ti and t j satisfy • ti• T• • t j = 0. / Example 1 Consider the labeled Petri net with unobservable transitions shown on the left of Fig. 1; its unobservable subnet is shown on the right of Fig. 1 and consists of two contact-free unobservable transitions t5 and t6 . The net has places P = {p1 , p2 , p3 , p4 , p5 , p6 }; transitions T = {t1 ,t2 ,t3 ,t4 ,t5 ,t6 ,t7 }; initial marking M0 = [1 1 0 0 0 1]T ; labels Σ = {a, b}; labeling function defined as Lε (t1 ) = Lε (t4 ) = Lε (t7 ) = a, Lε (t2 ) = Lε (t3 ) = b, Lε (t5 ) = Lε (t6 ) = ε ; and transition costs (not indicated in Fig. 1) given by C(t1 ) = 1, C(t2 ) = 2, C(t3 ) = 5, C(t4 ) = 3, C(t5 ) = 1, C(t6 ) = 4 and C(t7 ) = 2. Given a label sequence ω = aa as our observation, we see that the underlying transition firing sequences consistent with the label observation are {{t4t7 }, {t1t4 }, {t4t1 }, {t1t5t4 }, {t1t4t5 }, {t4t1t5 }} with costs {5, 4, 4, 5, 5, 5} respectively. The least-cost firing sequences are {t1t4 }, {t4t1 } (with least total cost 4); both of them have the same firing vector [1 0 0 1 0 0 0]T . The set of all consistent markings with respect to the observed label sequence ω is given by Z(ω ) = {[1 0 0 0 0 2]T , [0 0 1 1 0 1]T , [0 1 0 1 0 1]T }. ( ) ( ) ( ) Fig. 1. ( ) A labeled Petri net with unobservable transitions (left) and its unobservable subnet (right). III. P ROBLEM FORMULATION S Consider a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, Lε ) and assume that observable transitions in the net are associated with nonnegative costs and unobservable transitions are associated with strictly positive costs (via a cost function C). Given an observed label sequence ω = l1 l2 . . . lk (where l j ∈ Σ, j ∈ {1, 2, . . ., k}), we aim at finding, among all transition firing sequences that are consistent with ω , the one(s) that has (have) the least cost. More specifically, given an observed label sequence ω , the (set of) least-cost transition firing sequence(s) {σmin } is the solution to the following problem: arg min∗ C(σ ) such that L(σ ) = ω & M0 [σ i, σ ∈T where T ∗ denotes the set of all finite-length transition firing sequences. (1) We assume that the sequence of labels ω is generated by an underlying (unknown) transition firing sequence so that the set of consistent markings with respect to ω satisfies Z(ω ) 6= 0/ and thus the optimization problem in (1) is well-defined2 . In this paper, we solve (1) when unobservable transitions form an acyclic subnet (a special case of which is when unobservable transitions are contact-free). In particular, we provide a recursive algorithm along with an analysis of its complexity. The proposed recursive algorithm can be easily modified to handle the case where the initial marking is not completely known but instead it is known to belong to a finite set of possible initial markings. IV. L EAST- COST FIRING SEQUENCE ESTIMATION IN NETS WITH UNOBSERVABLE TRANSITIONS S In a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, Lε ), the firing sequences consistent with the observed label sequence ω = l1 l2 . . . lk (li ∈ Σ for i = {1, 2, . . ., k}) are not necessarily sequences of length k. As discussed earlier (and as illustrated by Example 1), depending on the Petri net structure and its initial marking, transition firing sequences of length equal to or greater than k may be possible. In general, the number of transition firing sequences that correspond to the observed sequence of labels could be infinite, which means that exhaustive enumeration of all possible transition firing sequences is not a viable option. Another difficulty in dealing with unobservable transitions arises when (observable) transitions that correspond to the latest label observed are not enabled at the current marking but can be enabled after the firing of a sequence of unobservable transitions. This requires that, each time a label is observed, all enabled unobservable transition sequences be considered to determine whether their firings enable a transition associated with the observed label. When a certain label l is observed, we can find the least-cost marking(s) from a given marking M by focusing on the unobservable transition sequence(s) (if any) that enables (enable) at least one of the observable transitions (corresponding to label l) and has (have) the least total cost (including the cost of the observable transition). The challenge is that this process needs to be repeated when a new label is subsequently observed: the problem is that it is unclear whether 2 If no sequence σ ∈ T ∗ satisfies the constraints L(σ ) = ω and M0 [σ i, then the algorithm indicates that no feasible solution exists; this is important for planning sequence estimation where feasibility is not a priori guaranteed. optimality is preserved by keeping track of least-cost firing sequences in this fashion. As we will see, however, the above approach is indeed viable if one tracks least-cost markings; in this case, if unobservable transitions form an acyclic subnet, the procedure returns the optimal solution. To establish the more elaborate procedure that is able to recursively obtain the least-cost markings and sequences when unobservable transitions form an acyclic subnet, we need the notions of minimal implications3 and least-cost markings which are defined next. A. Minimal Implications S Definition 9 Consider a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, S Lε ) = ((P, T, B−, B+ ), M0 , Σ {ε }, Lε ). Given a marking M and a transition t ∈ To , we define the set of implications of t at M to be E(M,t) = {σ ∈ Tu∗ |M[σ iM 0 , M 0 ≥ B− (:,t)} and we use Y (M,t) = {y ∈ N mu |∃σ ∈ E(M,t) : σ̄ = y} to denote the corresponding set of firing vectors where mu = |Tu |. Remark 1 Note that E(M,t) is the set of unobservable transition sequences whose firing at M enables transition t, and Y (M,t) is the set of the corresponding firing vectors (m u -dimensional column vectors, where mu is the number of unobservable transitions in the net). We define the minimal implications Emin (M,t) of transition t at marking M as those unobservable transition sequences in E(M,t) whose firing vectors are minimal. The formal definitions are given below. S Definition 10 Consider a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, S Lε ) = ((P, T, B−, B+ ), M0 , Σ {ε }, Lε ). Given a marking M and a transition t ∈ To , we define the set of minimal implications of t at M to be Emin (M,t) = {σ ∈ E(M,t)|@σ 0 ∈ E(M,t) : σ̄ 0 σ̄ }. 3 Our definition resembles the notion of minimal explanation in [29], which identifies sequences of unobservable transitions that have the smallest length and are necessary to enable the firing of a given observable transition. In our setting, instead of simply focusing on the length of the sequence, we need to consider the total cost of the sequence. We denote the corresponding set of firing vectors by Ymin (M,t) = {y ∈ N mu |∃σ ∈ Emin (M,t) : σ̄ = y}. Remark 2 As mentioned in Section II before, given two firing vectors σ̄ 0 and σ̄ of the same dimension, σ̄ 0 σ̄ denotes that σ̄ 0 ≤ σ̄ (element-wise) and σ̄ 0 6= σ̄ . Note that ≤ is only a partial order relation in this case. Remark 3 One can think of Emin (M,t) as the set of unobservable transition sequences whose firing at M is necessary to enable the observable transition t. Note that if σ ∈ E min (M,t), then σ is a firing sequence of unobservable transitions that can enable t from marking M and has strictly smaller cost than any other σ 0 ∈ Emin (M,t) for which σ̄ < σ̄ 0 (because unobservable transitions have strictly positive costs). Also note that the set Emin (M,t) can have more than one element or even be empty. The authors of [29] proposed a tabular algorithm to compute all vectors in Ymin (M,t) for a Petri net whose unobservable subnet is acyclic. The goal in that setting was to find the minimal firing vector(s) y of unobservable transitions such that M + Bu y ≥ B− (:,t), and use them to find the minimal number of occurrences of unobservable transitions needed to enable transition t. Since we assume that the unobservable subnet is acyclic, the algorithm in [29] can also be employed in this paper to compute the set of firing vectors in Ymin (M,t). B. Least-Cost Markings After we compute the set of minimal implications of a transition t at a marking M, it is essential to consider the markings that can be obtained from M by firing these minimal implications, which we refer to as least-cost markings. As we will show later, in order to capture the least-cost firing sequences based on the observation of a sequence of labels, it is possible to consider only these least-cost markings, at least in the case when the unobservable subnet is acyclic. The acyclic property of the unobservable subnet essentially ensures that the least-cost markings obtained are sufficient for finding LCTFS (in other words, it is not necessary to consider all consistent markings). Given an observed sequence of labels ωk = l1 l2 . . . lk , the set of least-cost markings M (ωk ) with respect to ωk is a set that is defined recursively as follows: (i) M (ε ) = {(M0 ,~0mu )} where ~0mu is the mu -dimensional vector of all zero entries, and (ii) M (ωk ) contains all pairs (M 0 , y0 ) of a marking M 0 and a firing vector y0 such that (M 0 , y0 ) can be obtained from some pair (M, y) ∈ M (ωk−1 ) (the set of least cost markings in the previous stage) by firing at marking M a sequence of unobservable transitions σ ∈ Emin (M,t) such that σ̄ = y0 , followed by the observable transition t itself, such that t is an observable transition that is consistent with the kth label observed (i.e., t satisfies L(t) = lk ). Below we provide the formal definition. S Definition 11 Consider a labeled Petri net with unobservable transitions NLε = (N, M0 , Σ {ε }, S Lε ) = ((P, T, B−, B+ ), M0 , Σ {ε }, Lε ), with the set of unobservable transitions Tu , the set of observable transitions To (T = To ∪ Tu , To ∩ Tu = 0), / and Bu being the incident matrix of the unobservable subnet. Let M (ωk ) be the set of least-cost markings with respect to ωk = l1 l2 . . . lk and initialize M (ε ) = {(M0 ,~0mu )}. Then M (ωk ) is defined recursively by the union [ M (ω k ) = MM,y,t (ωk ) (M,y)∈M (ωk−1 ), t: L(t)=lk where MM,y,t (ωk ) is obtained as follows: (i) if M ≥ B− (:,t), MM,y,t (ωk ) = {(M 0 , y0 ) ∈ N n × N mu |M 0 = M + B(:,t), y0 = ~0mu }. (ii) if M B− (:,t) but ∃σ ∈ Tu∗ such that M[σ iMint [ti, where Mint ≥ 0 is an intermediate marking, MM,y,t (ωk ) = {(M 0 , y0 ) ∈ N n ×N mu |∃y00 ∈ Y (M,t) : M 0 = M +B y00 +B(:,t) min u and y0 = y00 }. (iii) if M B− (:,t) and @σ ∈ Tu∗ such that M[σ iMint [ti, MM,y,t (ωk ) = 0. / Example 2 Consider the Petri net in Fig. 1 (i) and let the initial marking be M0 = [1 0 2 0 0 0]T . Initially M (ε ) = {(M0 , y)} where y = [0 0]T . If label a is observed, each transition in Ta = {t1 ,t4 ,t7 } needs to be considered separately. Consider transition t1 : since t1 is enabled at marking M0 already, we have Emin (M0 ,t1 ) = {ε } and Ymin (M0 ,t1 ) = {~02 } (it is of dimension 2 because there are two unobservable transitions t5 and t6 in the net). Its corresponding least-cost marking is MM0 ,y,t1 (a) = {(M 0 , y0 )} where y0 = ~02 = [0 0]T and M 0 = M0 + B(:,t1 ) = [0 0 3 0 0 0]T . Consider transition t4 : note that transition t4 is not enabled at M0 since M0 B− (:,t4 ) but can be enabled after the firing of unobservable transitions t5 and t5t5 . Therefore, E(M0 ,t4 ) = {{t5 }, {t5t5 }} and Y (M0 ,t4 ) = {[1 0]T , [2 0]T }. Since [1 0]T < [2 0]T , we have Emin (M0 ,t4 ) = {t5 } and Ymin (M0 ,t4 ) = {[1 0]T }. Its corresponding least-cost marking is MM0 ,y,t4 (a) = {(M 0 , y0 )}, where y0 = [1 0]T and M 0 = M0 + Bu y0 + B(:,t4 ) = [1 0 1 1 0 0]T . Consider transition t7 : note that E(M0 ,t7 ) = Emin (M0 ,t7 ) = 0/ and Y (M0 ,t7 ) = Ymin (M0 ,t7 ) = 0, / i.e., transition t7 is not enabled at marking M0 , and cannot be enabled by firing any sequence of unobservable transitions. Therefore, MM0 ,y,t7 (a) = 0. / It follows that the set of least-cost markings with respect to label a is given by M (a) = {([0 0 3 0 0 0]T , [0 0]T ), ([1 0 1 1 0 0]T , [1 0]T )}. Clearly, in the presence of unobservable transitions in the net, when a sequence of labels ω is observed, the set of least-cost markings M (ωk ) captures markings that can be reached from the initial marking M0 by firing a sequence of observable transitions and their associated minimal implications (a minimal sequence of unobservable transitions that has the least-cost). What is unclear, however, is whether the set of least-cost markings M (ωk ) (obtained using the recursion above) can be used to obtain all markings consistent with the observed label sequence ω . In other words, we need to ensure that the markings that are not considered (markings other than the least-cost markings) do not lead to firing sequences with smaller costs at later stages (i.e., we need to ensure that we do not lose optimality at later stages). We will show that, under the assumption that unobservable transitions form an acyclic subnet and have strictly positive costs, this requirement holds true. C. Least-Cost Transition Firing Sequences S Consider a labeled Petri net with unobservable transitions NLε = ((P, T, B−, B+ ), M0 , Σ {ε }, Lε ) where observable transitions are associated with nonnegative costs and unobservable transitions form an acyclic unobservable subnet and are associated with strictly positive costs. Assuming that a sequence of labels ω = l1 l2 . . . lk is observed, our goal is to compute the set of least-cost markings (with respect to the sequence of labels observed so far). To achieve this, we use a trellis diagram to track the evolution of these least-cost markings. The end result is a recursive algorithm that operates on the trellis (each time a new label is observed) to update the set of least-cost markings and the LCTFS according to the procedure described in Definition 11. To show the effectiveness of this approach we first recall a result related to acyclic Petri nets. − Theorem 1 [14] Let N = ((P, Tu , B+ u , Bu ), M0 ) be an acyclic Petri net with n places, mu transi- tions, and initial marking M0 . If a vector y ∈ N mu satisfies the equation M0 + Bu y ≥ 0 where − Bu ≡ B + u − Bu is the incident matrix of the net, then there exists a firing sequence σ firable from M0 such that M0 [σ i and σ̄ = y. Next we will show that, given an observed sequence of labels ω = l 1 l2 . . . lk generated by underlying activity in a labeled Petri net whose unobservable transitions form an acyclic subnet, we can capture the set of least-cost transition firing sequences by simply keeping track of the set of least-cost markings M (ωk ) (obtained using the recursion described in Definition 11); in addition, all markings that are consistent with the observed sequence of labels can be obtained by firing a sequence of unobservable transitions from the set of least-cost markings. S Theorem 2 Consider a labeled Petri net NLε = ((P, T, B+, B− ), M0 , Σ {ε }, Lε ) where unobservable transitions form an acyclic unobservable subnet and are associated with strictly positive costs. Assume that a sequence of labels ω = l1 l2 . . . lk is observed and some marking M 0 ∈ Z(ω ) can be reached from the initial marking M0 via a sequence of transitions ε1∗ti1 ε2∗ti2 . . . εk∗tik ε ∗ such that M0 [ε1∗ti1 ε2∗ ti2 . . . εk∗ tik ε ∗ iM 0 , ε ∗j ∈ Tu∗ for j = 1, 2, . . ., k, ε ∗ ∈ Tu∗ , and L(ti j ) = l j for j = 1, 2, 3, . . ., k. Then, M 0 can also be reached from M0 via a sequence of transitions ε1∗min ti1 ε2∗min ti2 . . . εk∗min tik ε ∗∗ where M0 [ε1∗min ti1 iMi1 [ε2∗min ti2 iMi2 . . . [εk∗min tik iMik [ε ∗∗ iM 0 , ε ∗jmin are minimal implications for transition ti j at marking Mi( j−1) for j = 1, 2, . . ., k such that ε̄ ∗jmin ≤ ε¯j ∗ , and ε ∗∗ ∈ Tu∗ is a sequence of unobservable transitions so that C(ε1∗min ti1 ε2∗min ti2 . . . εk∗min tik ε ∗∗ ) = C(ε1∗ti1 ε2∗ ti2 . . . εk∗ tik ε ∗ ). Proof: See the Appendix. In summary, Theorem 2 ensures that, given a sequence of observed labels ω k = l1 l2 . . . lk , we can simply consider the set of least-cost markings M (ωk ) with respect to ωk and avoid enumerating all markings that are consistent with ωk . The reason is that, when necessary, each of these markings can be reached via a least-cost marking in M (ωk ) by firing a sequence of unobservable transitions so that the total cost of the transition firing sequence via the least-cost marking is equal to (or, if it can be reached in some less costly way other than the one constructed in the proof of Theorem 2, less than) the total cost of any other transition firing sequence leading to the marking in question. Furthermore, the set M (ωk ) characterizes the set of markings that can be reached from M0 by firing transition sequences that have the least-cost (this follows from the minimal implications associated with them and the fact that all unobservable transitions in the net are associated with strictly positive costs). Given the discussion above, we can obtain the set of LCTFS in a net with unobservable transitions by constructing the trellis diagram of the least-cost markings evolution as described in Definition 11 and illustrated in Fig. 2. In Fig. 2, ωk = l1 l2 . . . lk is the observed label sequence and time epochs (stages) {1, 2, . . ., k} correspond to the instants each label is observed. Each node in the trellis diagram (drawn as a big black dot) captures the pair of a least-cost marking and its associated firing vector of transitions. Arcs between nodes represent the sequences of observable transitions along with their minimal implications (whose firing will lead from one least-cost marking to another). Observed label sequence Least-cost markings Fig. 2. Trellis diagram of the least-cost markings evolution when unobservable transitions exist in the net. Given the sequence of observed labels ωk , dynamic programming (DP) approaches [30] can be used to compute the least-cost firing sequence(s) recursively. The basic observation is that the sequence(s) which has (have) least cost at time epoch j only depends (depend) on the least-cost sequences up to time epoch j − 1 and the label observed at time epoch j. By taking advantage of this observation, we can search for the sequence that has the least cost, one observation (i.e., one stage in the trellis diagram) at a time. In the next section we describe a recursive algorithm to find the transition firing sequences that have the least-cost. As we will argue, under the assumption that all unobservable transitions are contact-free, the computational complexity of this algorithm is polynomial in the length of the observed label sequence. D. Algorithm We now describe the recursive algorithm to find the least-cost firing sequence(s) given an observed label sequence ωk = l1 l2 . . . lk of length k. The algorithm operates by constructing at each time step the trellis diagram of the least-cost markings that are consistent with the label sequence observed so far. The set of all nodes at stage j of the trellis diagram is captured by C (ω j ) = {R j1 , R j2 , . . .}, which is a finite set of tuples of the form R = (Mcurrent , leastcost, {(y, M previous)}) and includes all information we need to store at each node in the trellis diagram. More specifically, at time epoch j, R.Mcurrent denotes the marking associated with the node (and is, of course, a least-cost marking); R.leastcost is the least cost among all valid firing sequences from M0 to R.Mcurrent ; the set R.{(y, M previous )} is a set of pairs (y, M previous ), each of which captures the fact that there exists a least-cost transition firing sequence of the form σ t in with m-dimensional firing vector y = σ̄ + t¯in (where σ is a minimal implication of an observable transition tin ∈ To with L(tin ) = l j ) such that M previous [σ iMint [tin iR.Mcurrent for a least-cost marking M previous at time epoch j − 1. The algorithm is described in detail below. Algorithm 1 S Inputs: (i) A labeled Petri net with unobservable transitions NLε = ((P, T, B−, B+ ), M0 , Σ {ε }, Lε ) where unobservable transitions form an acyclic unobservable subnet and transition costs satisfy C(ti) ≥ 0 for ti ∈ To and C(t j ) > 0 for t j ∈ Tu ; (ii) An observed sequence of labels ωk = l1 l2 . . . lk where l j ∈ Σ for j = 1, 2, . . ., k. 1. ω0 = ε , C (ω0 ) = {(M0 , 0, 0)}. / 2. Let j = 1. 3. Consider the prefix ω j . 4. Set C (ω j ) = 0. / 5. For all R ∈ C (ω j−1 ) do For all t such that L(t) = l j compute Ymin (R.Mcurrent ,t) using the algorithm in [29] For all y0 ∈ Ymin (R.Mcurrent ,t) compute M 0 = R.Mcurrent + B(:,t) + Buy0 , let4 y = ȳ0 + t¯ If M 0 is a new marking that has not appeared in C (ω j ) C (ω j ) = C (ω j ) ∪ {(M 0, R.leastcost +C(y0 ) +C(t), {(y, R.Mcurrent )}} Else M 0 has appeared in R0 ∈ C (ω j ) If R.leastcost +C(y0 ) +C(t) < R0 .leastcost R0 = (M 0 , R.leastcost +C(y0 ) +C(t), {(y, R.Mcurrent )}) Else If R.leastcost +C(y0 ) +C(t) = R0 .leastcost R0 = (M 0 , R0 .leastcost, R0.{(y, M previous )} ∪ {(y, R.Mcurrent )}) End IF End IF End For End For End For 6. j = j + 1. 7. If j = k + 1, Goto 8; else Goto 3. 8. Recover all least-cost firing sequences using least-cost markings with the information stored. Given a labeled Petri net with unobservable transitions and an observed label sequence ω k = l1 l2 . . . lk of length k, Algorithm 1 recursively computes the set of least-cost markings that are consistent with the observed sequence of labels, stores all least-cost markings and the firing vectors associated with them, and waits until the next label is observed. At any given time epoch, the algorithm can recover the transition sequences that have the least total cost corresponding to all least-cost markings (each least-cost marking has one or more least-cost firing sequences that 4 Note that here we abuse notation a bit since ȳ0 is an mu -dimensional firing vector and t¯ is an m-dimensional firing vector; in this case, we extend ȳ0 to an m-dimensional firing vector by setting the number of firings of observable transitions to be zero and having the number of firings of unobservable transitions be determined by ȳ0 . lead to it from M0 ). Note that if this set is empty, then there are no transition firing sequences that match the observed sequence of labels. Remark 4 In Algorithm 1, between stages of the trellis diagram we only capture the firing vectors (not the sequences of unobservable transitions that are associated with them). In order to completely recover the actual sequences, Step 8 of Algorithm 1 needs to do more work. As we will see, if the unobservable transitions are contact-free, Step 8 of Algorithm 1 can simply output all valid permutations of the unobservable transitions associated with the firing vectors that have been captured (between markings at consecutive stages in the trellis diagram); the reason is that all such permutations result in valid transition firing sequences. Remark 5 Note that we assume that the observed sequence of labels ω is generated by an underlying (unknown) transition firing sequence. Therefore, given an observed sequence of labels ω , the set of consistent markings satisfies Z(ω ) 6= 0/ and there exists at least one feasible transition firing sequence that is consistent with both ω and the Petri net structure. If, due to an error in the observations, we observe a sequence of labels that is infeasible (i.e., the set of consistent markings is an empty set), Algorithm 1 will not return any outputs, which might signal, for example, the detection of a sensor failure. In the context of planning sequence estimation (e.g., sequence planning in manufacturing systems as mentioned in the introduction), this would indicate that the desired sequences of actions is infeasible. Note that deadlock is avoided at intermediate stages j ( j ∈ {1, 2, . . .k − 1}) because Algorithm 1, by default, will eliminate such markings from further consideration. Deadlocks at the last stage (stage k) can be checked and prevented using existing deadlock avoidance techniques in the literature [31]–[37]. Example 3 Consider the labeled Petri net shown in Fig. 1 (i) with the transition costs defined in Example 1 and the initial marking M0 = [1 0 2 0 0 0]T . If the observed label sequence is given by ω = aa, the evolution of its least-cost markings can be constructed as the trellis diagram shown in Fig. 3. Each node in the diagram is a pair (marking, firing vector) and each time instant corresponds to the time a label is observed. Clearly, the set of least-cost firing sequences from M0 to the node {(M21 , y21 )} is given by σmin = {t1t5t4 , t5t4t1 } and has least total cost 4. In terms of our data structure, the information stored at node (M12 , y12 ), for example, would be ([1 0 1 1 0 0]T , 3, ([0 0 0 1 1 0 0]T , [1 0 2 0 0 0]T )) where [0 0 0 1 1 0 0]T is the firing vector of transition sequence t5t4 . Fig. 3. Trellis diagram depicting the evolution of least-cost markings in Example 3. E. Complexity analysis So far our analysis of least-cost markings only relied on the requirement that the unobservable subnet is acyclic. If, in addition, unobservable transitions are contact-free, then we can establish that each time a label is observed, each observable transition (consistent with this label observation) corresponds to a unique least-cost marking (if one exists). This result is shown in the following proposition and can be used to argue that the complexity of our algorithm in this case is polynomial in the length of the observed sequence of labels. Proposition 1 Consider a labeled Petri net with unobservable transitions NLε = ((P, T, B+, B− ), S M0 , Σ {ε }, Lε ) with observable transitions To , unobservable transitions Tu (such that T = To ∪ Tu , To ∩ Tu = 0), / the initial marking M0 , and a contact-free unobservable subnet. Assume that a label l ∈ Σ is observed; then, for each observable transition t ∈ To such that L(t) = l, the least-cost marking M 0 associated with t is unique (if it exists). Proof: Without loss of generality, we assume that transition t has d input places, i.e., • t = {pi1 , pi2 , . . . , pid }. In order to enable transition t with its least-cost implications, we need to find the minimal firing vector z ≥ 0 such that M0 (pi j ) + Bu (pi j , :)z ≥ B− (pi j ,t) for j ∈ {1, 2, . . ., d}, i.e., each input place pi j of transition t needs to have at least B− (pi j ,t) tokens. Notice that the firing vector z here is only associated with unobservable transitions (i.e., it is an m u -dimensional vector with nonnegative integer entries). Since the unobservable transitions are contact-free, each place pi j has at most one input unobservable transition; thus, each row of the incident matrix Bu (pi j , :) has at most one positive entry. It follows that the minimal firing vector z that satisfies the d inequalities M(pi j ) + Bu (pi j , :)z ≥ B− (pi j ,t) for all j ∈ {1, 2, . . ., d} is unique (if it exists). Since the least-cost marking M 0 associated with t is given by M 0 = M + B(:,t) + Buz, it follows that M 0 is unique. Remark 6 Note that it is possible that z does not exist; for example, if M 00 = M + Bu z has a negative entry (this could only occur at places other than pi1 , pi2 , . . . , pid ), then z cannot correspond to a feasible firing sequence of unobservable transitions. Note, however, that if M 00 ≥ 0, then Theorem 1 implies that there exists at least one feasible sequence of unobservable transitions with firing vector z. When all unobservable transitions are contact-free, there is at most one least-cost marking 5 associated with each observable transition (consistent with the label observed). Therefore, the number of least-cost markings after the observation of the kth label can be upper bounded by the number of consistent markings one gets in the case when no unobservable transitions exist in the net, i.e., it is O(k b ) where b is a constant associated with structural parameters of the labeled Petri net [38]. As a consequence, the number of least-cost markings at the last stage of the trellis diagram associated with an observed label sequence of length k will also be O(k b ). Using 5 There may be a number of sequences of unobservable transitions that lead us to this marking due to different orderings of the firing of unobservable transitions. analysis similar to the one in [16], it is not difficult to establish that the storage and computational complexity of Algorithm 1 are O(k b+1 ) and O(k2b+1 ) respectively, which is polynomial in the length k of the observed sequence of labels. Note that when the initial marking is known to be in a finite set of possible initial markings {M01 , M02 , . . . , M0D }, the space complexity becomes O(D · kb+1 ) whereas the computational complexity changes to O(D2 · k2b+1 ). Notice that in Algorithm 1 we only capture the firing vectors of the unobservable transition sequences that have the least-cost. When attempting to completely recover the actual sequences, we need to do some additional work: for each firing vector, in order to enable an observable transition t at a certain marking M, the minimal firing vector y such that M + By ≥ B(:,t) has entries that are bounded by bmax = max1≤i≤n,1≤ j≤m {b− i j } (because M ≥ 0 and the unobservable transitions are contact-free). Therefore, since we have mu unobservable transitions and each can fire at most bmax times, the number of all possible unobservable sequences associated with y is upper bounded by a constant c = (bmax ·mu )! . (bmax !)mu Thus, when attempting to list all least-cost firing sequences (if desirable), each firing vector stored may be expanded by at most c sequences of unobservable transitions (in other words, the complexity of recovering the number of firing sequences for a certain least-cost markings is O(ck )). If the unobservable subnet is acyclic but not necessarily contact-free, then the observable transitions that are consistent with each label observed will correspond to a finite number of least-cost markings. The complexity of the algorithm in this case (e.g., in terms of the length of the observed sequence of labels) is not clear (in fact the complexity of finding minimal implications is an open question) and is left to future work (one can potentially exploit the techniques in [38] to answer this question). F. An illustrative example In this section, we illustrate our algorithm via a more complicated example. We use a Petri net model shown in Fig. 4 which is a variation of the Petri net model of two parallel working machines proposed in [39]. The Petri net has 10 places P = {p1 , p2 , . . . , p10 }, 12 transitions T = {t1 ,t2 , . . .,t12 }, and initial marking M0 = [1 1 0 2 0 0 2 0 0 0]T . The labeling function is given by L(t3 ) = L(t5 ) = a, L(t4 ) = L(t6 ) = b, L(t7 ) = c, L(t10 ) = d, L(t1 ) = e, L(t2 ) = f , L(t11 ) = g, L(t12 ) = h, L(t8 ) = L(t9 ) = ε . The cost of each transition is given by the cost vector C = [5 5 10 20 20 10 30 10 10 30 5 5]T . Note that there are two unobservable transitions t8 and t9 in the net and they are contact-free. ( ) ( ) Fig. 4. Petri net model for two parallel machines with unobservable transitions. We use two different sequences of label observations to illustrate our algorithm: (i) if the observed sequence of labels is given by ω (1) = ee f f bb, Algorithm 1 finds the set of least-cost transition firing sequences to be σmin = {t1t1t2t2t6t6 } with total cost 40. (ii) if the observed sequence of labels is given by ω (2) = ee f f bbhag, Algorithm 1 finds the set of least-cost transition firing sequences to be σmin = {t1t1t2t2t4t6t8t12t5t9t11 , t1t1t2t2t6t4t8t12t5t9t11 } with total cost 100. Due to space limitations, we do not show the corresponding trellis diagram but provide the following table where Label denotes the label observed in the given sequence; Num.Markings gives the number of least-cost markings that are consistent with the observed sequence of labels up to the current time epoch; Leastcost captures the least total cost of the sequence(s) that is (are) consistent with the labels observed up to the current time epoch; and {σ min } gives the firing sequence(s) that has (have) total least cost up to the current time epoch. Label Num.Markings Leastcost {σmin } e 1 5 t1 e 1 10 t 1 t1 f 1 15 t 1 t1 t2 f 1 20 t 1 t1 t2 t2 b 2 30 t 1 t1 t2 t2 t6 b 3 40 t 1 t1 t2 t2 t6 t6 h 1 65 t1t1t2t2t4t6t8t12 t1t1t2t2t6t4t8t12 a 2 75 t1t1t2t2t4t6t8t12t3 t1t1t2t2t6t4t8t12t3 g 1 100 t1t1t2t2t4t6t8t12t5t9t11 t1t1t2t2t6t4t8t12t5t9t11 Remark 7 Note that the first sequence of label observations is a prefix of the second sequence; however, the least-cost transition sequence is different in the first six transitions, i.e., the firing sequence with least-cost may vary as we observe more labels. In particular, the least-cost sequence after the observation of k − 1 labels is not necessarily a prefix of the sequence that will give us the least-cost after the kth observed label. The one(s) with least-cost can only be found by capturing all least-cost markings along with the corresponding least-cost sequences that lead to them from the (k − 1)st stage (as we have done in our algorithm). Remark 8 Note that the above example can easily be seen as a case of planning sequence estimation in a manufacturing system: the specification is given by the label sequence ee f f bb which requires that we first insert two items in the first (top) machine, then we insert two items in the second (bottom) machine, and finally we execute two type-b activities using the first machine, or the second machine, or both machines. V. C ONCLUSIONS AND FUTURE WORK In this paper we developed a methodology for obtaining the least-cost transition firing sequence(s) that is (are) consistent with the observation of a sequence of labels in a labeled Petri net. In particular, we are given a labeled Petri net with both observable transitions and unobservable transitions. We assume that each transition is associated with a nonnegative cost that captures its likelihood (e.g., the amount of workload or power required to execute the transition). Our goal is to use the observed sequence of labels (and our knowledge of the Petri net structure, labeling function, and transition costs) to obtain the transition firing sequence that agrees with the observed label sequence and has the least total cost. When unobservable transitions in the net are associated with strictly positive costs and form an acyclic subnet, we developed a recursive algorithm that is able to find the least-cost firing sequence(s) while reconstructing only a finite number of transition firing sequence(s). In addition, when unobservable transitions are contact-free, we showed that the complexity of the algorithm is polynomial in the length of the observed label sequence. One possible direction for future work is to extend the applicability of this algorithm to more general structures for the unobservable subnet while maintaining polynomial complexity. Another interesting extension is to find classes of nets for which the complexity of the algorithm can be further reduced. Investigating more explicit constraints (e.g., timing information on transition activity) that might arise in certain applications, such as planning sequence design in manufacturing systems, is also another interesting extension of the proposed approach. A PPENDIX Proof of Theorem 2: The proof is by induction on the length of the observed sequence of labels. First consider the case k = 1. Assume that marking M 0 can be reached via the initial marking M0 through M0 [ε1∗ti1 ε ∗ iM 0 (where L(ε1∗ ti1 ε ∗ ) = l1 ). Then, we have to show that there exists a leastcost marking Mi1 ∈ M (ω1 ) that can be reached via the initial marking M0 through M0 [ε1∗min ti1 iMi1 (as described in Definition 11), and there exists a sequence of unobservable transitions ε 1∗∗ such that Mi1 [ε1∗∗ iM 0 and C(ε1∗min ti1 ε1∗∗ ) = C(ε1∗ti1 ε ∗ ). − Clearly, M0 [ε1∗ti1 ε ∗ iM 0 implies that M 0 = M0 + Bu ε¯1 ∗ + B(:,ti1) + Bu ε̄ ∗ ≥ 0 where Bu ≡ B+ u − Bu is the incident matrix of the unobservable subnet. Similarly, for the least-cost marking Mi1 such that M0 [ε1∗min ti1 iMi1 , we have Mi1 = M0 + Bu ε̄1∗min + B(:,ti1 ). Therefore, we have M 0 = Mi1 + Bu (ε¯1 ∗ − ε̄1∗min + ε̄ ∗ ) ≥ 0. Since ε̄1∗min can be chosen so that ε̄1∗min is the firing vector of ε1∗min (a minimal implication of ti1 ), it can be chosen to satisfy ε̄1∗min ≤ ε¯1 ∗ . Since ε̄ ∗ ≥ 0, this particular choice of ε̄1∗min satisfies ε¯1 ∗ − ε̄1∗min + ε̄ ∗ ≥ 0. According to Theorem 1, there exists a sequence of unobservable transitions ε1∗∗ such that Mi1 [ε1∗∗ iM 0 and ε¯1 ∗∗ = ε¯1 ∗ − ε̄1∗min + ε̄ ∗ (because we consider the incident matrix Bu here which corresponds to an acyclic Petri net) . In addition, the cost satisfies C(ε1∗min ti1 ε1∗∗ ) = C(ε1∗min ) +C(ti1 ) +C(ε1∗∗ ) = C(ε1∗ ) +C(ti1 ) +C(ε ∗ ) = C(ε1∗ti1 ε ∗ ) (sequences with the same firing vector have the same cost), and the result follows. Now assume that the result holds after the (k −1)st label is observed. More specifically, suppose ∗ t ∗ 0 marking M 0 can be reached via the initial marking M0 through M0 [ε1∗ti1 ε2∗ ti2 . . . εk−1 i(k−1) ε iM such that ε ∗j ∈ Tu∗ for j = 1, 2, . . ., k − 1, ε ∗ ∈ Tu∗ , and L(ti j ) = l j for j = 1, 2, 3, . . ., k − 1; then there exist: (i) a least-cost marking Mi(k−1) ∈ M (ωk−1 ) at the (k − 1)st stage that can be reached from ∗ the initial marking M0 via M0 [ε1∗min ti1 ε2∗min ti2 . . . ε(k−1) t iMi(k−1) where ε ∗jmin are minimal immin i(k−1) plications for transition ti j for j = 1, 2, . . ., k − 1 such that ε̄ ∗jmin ≤ ε¯j ∗ , and (ii) a sequence of unob∗∗ ∈ T ∗ so that M ∗∗ 0 ∗ ∗ ∗ ∗∗ servable transitions εk−1 i(k−1) [εk−1 iM and C(ε1min ti1 ε2min ti2 . . . ε(k−1) ti(k−1) εk−1 ) u min ∗ t ∗ = C(ε1∗ti1 ε2∗ti2 . . . εk−1 i(k−1) ε ). Next we consider the case after the kth label is observed. Assume that marking M 00 can be ∗ t ∗ 0 ∗ ∗ 00 reached from the initial marking M0 via M0 [ε1∗ti1 ε2∗ti2 . . . εk−1 i(k−1) ε iM [εk tik ε iM , then based on the discussion above, M 00 can also be reached from M0 through some least-cost marking ∗ ∗∗ iM 0 [ε ∗t ε ∗ iM 00 Mi(k−1) at the (k − 1)st stage via M0 [ε1∗min ti1 ε2∗min ti2 . . . ε(k−1) t iMi(k−1) [εk−1 k ik min i(k−1) ∗ ∗∗ ) = C(ε ∗t ε ∗t . . . ε ∗ t ∗ such that C(ε1∗min ti1 ε2∗min ti2 . . . ε(k−1) ti(k−1) εk−1 1 i1 2 i2 k−1 i(k−1) ε ). min Clearly, least-cost markings at the kth stage include markings Mik that are reached through Mi(k−1) via Mi(k−1) [εk∗min tik iMik for some minimal implication εk∗min . What we will show is that M 00 can be reached from some least-cost marking Mik through an unobservable sequence εk∗∗ so that C(ε1∗min ti1 ε2∗min ti2 . . . εk∗min tik ε ∗∗ ) = C(ε1∗ti1 ε2∗ ti2 . . . εk∗ tik ε ∗ ). ∗∗ ε ∗t ε ∗ iM 00 implies We can employ a similar argument as in the case k = 1. Clearly, Mi(k−1) [εk−1 k ik ∗∗ + B ε¯ ∗ + B(:,t ) + B ε̄ ∗ ≥ 0. Similarly, M ∗ that M 00 = Mi(k−1) + Bu ε̄k−1 u k u ik i(k−1) [εkmin tik iMik implies ∗∗ + that Mik = Mi(k−1) + Bu ε̄k∗min + B(:,tik ). Therefore, we have M 00 = Mik + Bu (ε¯k ∗ − ε̄k∗min + ε̄k−1 ε̄ ∗ ) ≥ 0. Since we can choose ε̄k∗min such that ε̄k∗min ≤ ε¯k ∗ (because ε̄k∗min can be the firing vector of ∗∗ ≥ 0, and ε̄ ∗ ≥ 0, we have ε¯ ∗ − ε̄ ∗ + ε̄ ∗∗ + ε̄ ∗ ≥ 0. Accordany minimal implication of tik ), ε̄k−1 k kmin k−1 ing to Theorem 1, there exists a sequence of unobservable transitions ε ∗∗ such that Mik [ε ∗∗ iM 00 ∗∗ + ε̄ ∗ . In addition, the cost satisfies C(ε ∗ t ε ∗∗ ) = C(ε ∗ ) +C(t ) + and ε̄ ∗∗ = ε¯k ∗ − ε̄k∗min + ε̄k−1 ik kmin ik kmin ∗∗ ) +C(ε ∗ ) +C(t ) +C(ε ∗ ) = C(ε ∗∗ ε ∗t ε ∗ ). Recall that from the analysis of the C(ε ∗∗ ) = C(εk−1 ik k k−1 k ik ∗ ∗∗ ) = C(ε ∗t ε ∗ t . . . ε ∗ t ∗ (k − 1)st stage, we have C(ε1∗min ti1 ε2∗min ti2 . . . ε(k−1) ti(k−1) εk−1 1 i1 2 i2 k−1 i(k−1) ε ); it min follows that the total costs satisfy C(ε1∗min ti1 ε2∗min ti2 . . . εk∗min tik ε ∗∗ ) = C(ε1∗ti1 ε2∗ ti2 . . . εk∗ tik ε ∗ ), which establishes the induction step and thus proves the theorem. R EFERENCES [1] A. A. Desrochers and R. Y. AI-Jaar, Applications of Petri Nets in Manufacturing Systems: Modeling, Control and Performance Analysis, the Institute of Electrical and Electronics Engineers (IEEE), Inc., New York, 1995. [2] M. Zhou and K. Venkatesh, Modeling, Simulation, and Control of Flexible Manufacturing Systems: A Petri Net Approach, Series in Intelligent Control and Intelligent Automation, vol. 6, World Scientific Publishing Co. Pte. Ltd., 1999. [3] C. Girault and R. Valk, Petri Nets for Systems Engineering: A Guide to Modeling, Verification, and Applications, Springer-Verlag, 2003. [4] Y. Wu and C. N. Hadjicostis, “Algebraic approaches for fault identification in discrete-event systems,” IEEE Trans. Automatic Control, vol. 50, no. 12, pp. 2048–2055, December 2005. [5] A. Ramirez-Trevino, E. Ruiz-Beltran, I. Rivera-Rangel, and E. Lopez-Mellado, “Online fault diagnosis of discrete event systems: a Petri net-based approach,” IEEE Trans. Automation Science and Engineering, vol. 4, no. 1, pp. 31–39, January 2007. [6] D. Lefebvre and C. Delherm, “Diagnosis of DES with Petri net models,” IEEE Trans. Automation Science and Engineering, vol. 4, no. 1, pp. 114–118, January 2007. [7] J. O. Moody and P. J. Antsaklis, “Petri net supervisors for DES with uncontrollable and unobservable transitions,” IEEE Trans. Automatic Control, vol. 45, no. 3, pp. 462–476, March 2000. [8] J. Park and S. A. Reveliotis, “Liveness-enforcing supervision for resource allocation systems with uncontrollable behavior and forbidden states,” IEEE Trans. Robotics and Automation, vol. 18 , no. 2, pp. 234–240, April 2002. [9] M. Iordache, J. Moody, and P. J. Antsaklis, “Synthesis of deadlock prevention supervisors using Petri nets,” IEEE Trans. Robotics and Automation, vol. 18, no. 1, pp. 59–68, February 2002. [10] Y.-S. Huang, M. Jeng, X. Xie, and D.-H. Chung, “Siphon-based deadlock prevention policy for flexible manufacturing systems,” IEEE Trans. Systems, Man and Cybernetics, Part A, vol. 36, no. 6, pp. 1248–1256, November 2006. [11] D. Lefebvre and A. E. Moudni, “Firing and enabling sequences estimation for timed Petri nets,” IEEE Trans. Systems, Man and Cybernetics, Part A, vol. 31, no. 3, pp. 153–162, May 2001. [12] A. Giua and C. Seatzu, “Observability of place/transition nets,” IEEE Trans. Automatic Control, vol. 47, no. 9, pp. 1424–1437, September 2002. [13] A. Giua, “Petri net state estimators based on event observation,” in Proc. 36th IEEE Int. Conf. Decision and Control, pp. 4086–4091, December 1997. [14] A. Giua, C. Seatzu, and D. Corona, “Marking estimation of Petri nets with silent transitions,” IEEE Trans. Automatic Control, vol. 52, no. 9, pp. 1695–1699, September 2007. [15] F. Dicesare, G. Harhalakis, J. M. Proth, M. Silva, and F. B. Vernadat, Practice of Petri Nets in Manufacturing, First Edition, Chapman & Hall, 1993. [16] L. Li, Y. Ru, and C. N. Hadjicostis, “Least-cost firing sequence estimation in labeled Petri nets,” in Proc. 45th IEEE Int. Conf. Decision and Control, pp. 416–421, December 2006. [17] L. Li and C. N. Hadjicostis, “Least-cost planning sequence estimation in labelled Petri nets,” Transactions of the Institute of Measurement and Control (Special issue on Planning and Scheduling in Complex Systems), to appear (online version appears first on September 7, 2009). [18] S. Lin, T. Kasami, T. Fujiwara, and M. Fossorier, Trellises and Trellis-Based Decoding Algorithms for Linear Block Codes, Kluwer Academic Publishers, 1998. [19] R. Boubour, C. Jard, A. Aghasaryan, E. Fabre, and A. Benveniste, “A Petri net approach to fault detection and diagnosis in distributed systems, part I: application to telecommunication networks, motivations, and modelling,” in Proc. 36th IEEE Int. Conf. Decision and Control, pp. 720–725, December 1997. [20] A. Aghasaryan, E. Fabre, A. Benveniste, R. Boubour, and C. Jard, “A Petri net approach to fault detection and diagnosis in distributed systems, part II: extending Viterbi algorithm and HMM techniques to Petri nets,” in Proc. 36th IEEE Int. Conf. Decision and Control, pp. 726–731, December 1997. [21] L. Qiu, W.-J. Hsu, S.-Y. Huang, and H. Wang, “Scheduling and routing algorithms for AGVs: a survey,” International Journal of Production Research, vol. 40, no. 3, pp. 745–760, February 2002. [22] J. P. Thomas, N. Nissanke, and K. D. Baker, “A hierarchical Petri net framework for the representation and analysis of assembly,” IEEE Trans. Robotics and Automation, vol. 12, no. 2, pp. 268–279, April 1996. [23] J. Rosell, “Assembly and task planning using Petri nets: a survey,” Journal of Engineering Manufacture, vol. 218, no. 8, pp. 987–994, August 2004. [24] E. Zussman and M. C. Zhou, “A methodology for modeling and adaptive planning of disassembly processes,” IEEE Trans. Robotics and Automation, vol. 15, no. 1, pp. 190–194, February 1999. [25] Y. Tang, M. C. Zhou, and R. J. Caudill, “An integrated approach to disassembly planning and demanufacturing operation,” IEEE Trans. Robotics and Automation, vol. 17, no. 6, pp. 773–784, December 2001. [26] D. Kiritsis, K.-P. Neuendorf, and P. Xirouchakis, “Petri net techniques for process planning cost estimation,” Advances in Engineering Software, vol. 30, no. 6, pp. 375–387, June 1999. [27] T. Murata, “Petri nets: properties, analysis and applications,” Proc. of the IEEE, vol. 77, no. 4, pp. 541–580, April 1989. [28] C. G. Cassandras and S. Lafortune, Introduction to Discrete Event Systems, Springer, 1999. [29] A. Giua and C. Seatzu, “Fault detection for discrete event systems using Petri nets with unobservable transitions,” in Proc. 44th IEEE Int. Conf. Decision and Control, and the European Control Conf. 2005, pp. 6323–6328, December 2005. [30] R. Bellman, Dynamic Programming, Princeton University Press, 1957. [31] N. Viswanadham, Y. Narahari, and T. L. Johnson, “Deadlock prevention and deadlock avoidance in flexible manufacturing systems using Petri net models,” IEEE Trans. Robotics and Automation, vol. 6, no. 6, pp. 713–723, December 1990. [32] Z. A. Banaszak and B. H. Krogh, “Deadlock avoidance in flexible manufacturing systems with concurrently competing process flows,” IEEE Trans. Robotics and Automation, vol. 6, no. 6, pp. 724–734, December 1990. [33] N. Q. Wu, “Necessary and sufficient conditions for deadlock-free operation in flexible manufacturing systems using a colored Petri net model,” IEEE Trans. Systems, Man, and Cybernetics, Part C, vol. 29, no. 2, pp. 192–204, May 1999. [34] N. Q. Wu and M. C. Zhou, “Avoiding deadlock and reducing starvation and blocking in automated manufacturing systems,” IEEE Trans. Robotics and Automation, vol. 17, no. 5, pp. 657–668, October 2001. [35] N. Q. Wu and M. C. Zhou, “Modeling and deadlock control of automated guided vehicle systems,” IEEE Trans. Mechatronics, vol. 9, no. 1, pp. 50–57, March 2004. [36] J. Ezpeleta, J. M. Colom, and J. Martinez, “A Petri net based deadlock prevention policy for flexible manufacturing systems,” IEEE Trans. Robotics and Automation, vol. 11, no. 2, pp. 173–184, April 1995. [37] Z. W. Li and M. C. Zhou, “Elementary siphons of Petri nets and their application to deadlock prevention in flexible manufacturing systems,” IEEE Trans. Systems, Man, and Cybernetics, Part A, vol. 34, no. 1, pp. 38–51, 2004. [38] Y. Ru and C. N. Hadjicostis, “Bounds on the number of markings consistent with label observations in Petri nets,” IEEE Trans. Automation Science and Engineering, vol. 6, no. 2, pp. 334–344, April 2009. [39] J.-M. Proth and X. Xie, Petri Nets: A Tool for Design and Management of Manufacturing Systems, John Wiley & Sons, 1996.