Mixed Integer Programming-Based Liveness Test for FMS with Full Routing Flexibility

Mixed integer programming (MIP) is an important technique to verify the liveness property of sequential flexible manufacturing systems (FMS) modeled by Petri nets. When there are some fully flexible routings in FMS, the existing MIP-based methods are not suitable for testing their liveness. This paper defines a subclass of SPR nets firstly, namely, OSC-SPR nets, and concludes that an OSC-SPR net is live if there exist no non-max-controlled siphons. Accordingly, determining whether or not an OSC-SPR net is live can also be realized by using standardized mixed integer programming (MIP) tools. Furthermore, the liveness property of SPR nets can be tested in two steps: first, for a given SPR net, constructing an OSC-SPR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-SPR net by the aforementioned MIP-based algorithm. In the end, the performance of the method is demonstrated by an application of FMS.


Introduction
Flexible manufacturing systems (FMS) utilize computers and shared resources (such as robots, machines, and automated guided vehicles) to automatically produce products [1].Owing to the competition of shared resources, there may be some processes in FMS, which once started cannot be finished, that is, deadlocks [2].Hence, it should be ensured that no deadlocks will occur in FMS; in other words, all working processes should be live.Usually, liveness property of FMS might be tested by analyzing their models (such as Petri nets) before using.Since the model complexity will increase with job shop flexibility (alternative machines, alternative operation sequences, and full routing flexibility) [3], the work for detecting liveness of FMS will also increase correspondingly.
At present, there are two categories of techniques for liveness test: one category is relied on the classic state enumeration analysis of Petri nets, which grows exponentially with the size of the net [4]; the other one is based on standardized tools of mixed integer programming (MIP), which is originally proposed by Chu and Xie [5] and is more efficient than the former.The basic idea of the latter is that if there does not exist any siphon becoming empty in a Petri net, then the net is deadlock free.It has been verified that for some subclasses of ordinary Petri nets such as ES 2 PR nets [6], S 3 PR nets [7], LS 3 PR [8] nets, and ES 3 PR [9] nets the net is live if and only if it is deadlock free.So, the liveness of these subclasses of ordinary Petri nets can be tested by MIP-based algorithms [10,11].The natural thing is to extend MIP-based method of liveness test for general Petri nets.Park and Reveliotis [12] introduced an MIP-based algorithm for testing the weakly liveness of FMS with alternative machines flexibility modeled by S 3 PGR 2 nets, which is in view of the conclusion that a net is weakly live if there exist no dead marked siphons (DMS).Shih et al. [13] has obtained some similar results for S 3 PGR 2 nets, in which DMS is found on the grounds of the conception of max  -controlled siphons.Moreover, Liu and Li [14] provided a general MIP algorithm of liveness test for S 3 PGR 2 nets, which is based on the result that a net is live if there is no extended deadly marked siphons (EDMS).Owing to the shortage of liveness conditions of S * PR nets, which can model FMS with full routing flexibility [15,16], there is no MIP-based method of liveness test for S * PR net.The liveness of Gadara nets [17] (a subclass of S * PR nets) may be detected by the original MIP approach [5], because of the conclusion that a Gadara net is live if and only if there does not exist any empty siphons [17,18].
This paper defined a subclass of S * PR nets firstly, namely, OSC-S * PR nets, in which all output transitions of each choice working place are restricted to use the same type and quantity of resources.The main structure characteristic of OSC-S * PR nets is that an OSC-S * PR net is live if there exists no non-max  -controlled siphons.Accordingly, an MIPbased algorithm is proposed to determine whether or not an OSC-S * PR net is live.It is worth to say that OSC-S * PR nets are an extension of Gadara nets, which are usually used to model multithreaded programs [17].Considering the structure complexity of S * PR nets, it is difficult to develop an MIP-based algorithm for testing their liveness directly.So, an indirect method is given here, which comprises two steps as follows: first, for a given S * PR net, constructing an OSC-S * PR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-S * PR net by the aforementioned MIP-based algorithm.In order to verify the performance of our method, a typical case of FMS is taken as example.
This paper is organized as follows.Section 2 introduces the basic knowledge about Petri nets.Section 3 presents OSC-S * PR nets and their structure characteristics.Section 4 proposes an MIP-based algorithm for testing liveness of OSC-S * PR nets.Section 5 discusses an indirect method for testing liveness of S * PR nets.A typical example is presented in Section 6.

Preliminaries
This section, we briefly introduce the basic definitions and notations of a Petri net, which will be discussed in the rest of this paper.More details can be found in [4,19].
A generalized Petri net is a four-tuple  = (, , , ), where  and  are finite, nonempty and disjoint sets. denotes the set of places and  denotes the set of transitions with  ⋃  ̸ =  and  ⋂  = . ⊆ ( × ) ⋃( × ) is called a flow relation of the net, represented by arcs with arrows from places to transitions or from transitions to places. : ( × ) ⋃( × ) → N is a mapping that assigns a weight to an arc: (, ) > 0 if and only if (, ) ∈ , and (, ) = 0 otherwise, where ,  ∈  ⋃  and N denotes the set of natural numbers.
A marking  of a Petri net  is a mapping from  to N. () denotes the number of tokens in the place .We usually describe markings and vectors using a multiset (bag) or formal sum notation for economy of space.As a result, ∑ ∈ () is used to denote vector .For instance, a marking that puts four tokens in place  2 and two tokens in place  4 only in a net with  = { 1 −  6 } is denoted by 4 2 + 2 4 instead of (0, 4, 0, 2, 0, 0).A place  is marked by marking  if and only if () > 0. A subset  ⊆  is marked by  if and only if at least one place in  is marked by .The sum of tokens of all places in  is denoted by (); that is, () = ∑ ∈ (). is said to be empty at  if and only if () = 0. (,  0 ) is called a net system or marked net and  0 is called an initial marking of .In general, (,  0 ) is directly called a net where there is no confusion.

Definitions and Properties of OSC-S * PR Nets
In order to model FMS with full routing flexibility and multiple copies of different resources, S * PR nets are proposed by Ezpeleta et al. [15], which are defined as follows.
Definition 1 (see [15]).(iv) for all  ∈   , the subnet   generated by    ⋃{ 0 } ⋃   is a strongly connected state machine; (v) for all  ∈   , there exists a unique minimal - (vii)  is pure and strongly connected.
Due to the structure complexity of S * PR nets, the liveness problem usually relies on the classic state enumeration analysis.Obviously, it is time-consuming due to the state explosion problem.Fortunately, Gadara nets, a subclass of S * PR nets, may utilize some efficient methods such as MIPbased approach for testing their liveness.In fact, Gadara nets are a simplified subclass of S * PR nets with the restriction that no resources are required in all branches and quantity of the same type of resources equals one.The definition is shown as follows.
In most cases, the modeling ability of Gadara nets is not enough.Here, a new subclass of S * PR nets, namely, OSC-S * PR nets, is introduced as follows.
Definition 4. Let (,  0 ) be a well-marked S * PR net.A place  is said to be a choice operation place if and only if  ∈   and | • | ≥ 2. The set of choice operation places in (,  0 ) is denoted by   ; that is, Definition 5. Let (,  0 ) be a well-marked S * PR net.A choice operation place  ∈   is said to be satisfied operation symmetry choice condition (OSC-Condition) if and only if (,  0 ) is said to be a well-marked OSC-S * PR net if and only if for all  ∈   ,  satisfies OSC-Condition.
The OSC-Condition confirms that each output transition of each choice operation place must use the same kind and quantity of resources.From Definition 5, it is apparent that OSC-S * PR nets are a subclass of S * PR nets.Since any branch in a Gadara net cannot be associated with any resource [17], it satisfies OSC-Condition as well; that is, Gadara nets are a special case of OSC-S * PR nets.Example 6.Consider the net shown in Figure 1.For the choice operation places  3 and  7 , all output transitions  V1 ,  V2 ,  V3 , and  V4 use none of resources.So it is an OSC-S * PR net but is not a Gadara net because initial tokens in  1 ,  2 ,  3 ,   , and   are greater than one.Similar to the technique in [20,21], the definition of max controlled siphon of S * PR nets is introduced as follows.Definition 8. Let  be a siphon of a well-marked S * PR net (,  0 ). is said to be max  -marked at marking  ∈ (,  0 ) if and only if ∃ ∈   such that () ≥ 1 or ∃ ∈   such that () ≥ max ∈ • ⋂[] • (, ). is said to be max  -controlled if and only if it is max  -marked under any reachable marking.(,  0 ) is said to be max  -controlled if and only if each siphon of it is max  -controlled.
Before proving the liveness condition of OSC-S * PR nets, some lemmas are established first.

Lemma 9.
Let  be a choice operation place in a well-marked OSC-S * PR net (,  0 ).For all  ∈ (,  0 ), the following conclusions hold.
Then, prove ∃  ∈ (, ) such that for all  ∈ , Ω = { • |  ∈   ,   () > 0} is a set of dead transitions.From the marking   mentioned before and move all processes one by one corresponding to indexes in  as follows approach.By Lemma 10, for all   ∈   there must exist a simple path SP(  ,  0  ) from   to  0  .Then, for all   ∈ { ∈   ,   () > 0}, moving the process along SP(  ,  0  ), the process will be either dead (since by Lemma 9, all the transitions in the postset of a choice place are disabled as long as one of them is disabled) or back to initial state, in which the tokens in   will flow back to  0  .Repeat this for each process corresponding to indexes in .The net reaches a marking   ∈ (,   ) verifying condition (ii) in the hypothesis, because, on the contrary, all process corresponding to indexes in  will get back to the initial state; that is,  0 ∈ (,   ) which is in contradiction with Lemma 12. Let   :=   ; Lemma 13 holds.
From these lemmas, the main theorems can be obtained as follows.
Proof.Consider the making   given in Lemma 13.Let ( is the set of resource places which have at least one disabled output transition and this transition is disabled only because of the lack of this resource.   is the set of nonmarked places in ().It is apparent that  ̸ =  (otherwise    = , then for all  ∈   ⋂{ |   () > 0}, it is true that for all   ∈  • ,   [  ⟩, which contradicts the condition that Ω is a set of dead transitions).Now we prove that  =    ⋃    is a non-max  -marked siphon under   .
First, we prove that  is a siphon; that is, for all   ∈ • ,   ∈  In summary, ∃  ∈ (, ) and ∃ is a siphon such that  is nonempty and non-max  -marked.Theorem 15.Let (,  0 ) be a well-marked OSC-S * PR net.(,  0 ) is live if all siphons of (,  0 ) are max  -controlled.
It should be noticed that Theorem 15 is a sufficient liveness condition for OSC-S * PR nets.Thus, there may be some live OSC-S * PR nets which are not max  -controlled.

Liveness Test Algorithm for OSC-S * PR Nets
In this section, an MIP-based liveness test algorithm is proposed, which is based on Theorem 15 in Section 3. The operators set of an operation place is introduced here, which is similar to [14].Definition 16.Let  be an S * PR net.For  ∈   ,   = { |  ∈   ,  ∈   } the resource places that are required by  are called the set of operators of .
According to Theorems 14 and 15, the following theorem can be obtained, which is also a liveness test algorithm for testing liveness of OSC-S * PR nets.
Then, the minimal non-max  -marked siphon is the set of places with   = 1.
Proof.Let  be a non-max  -marked siphon.By Definition 8, the following conclusions hold: (i) for all  ∈   , () = 0; Then, let us explain the meaning of the constraints one by one.
Objective (3) ensures that the siphon is a minimal siphon.Constraint (4) ensures that   is the characteristic vector of the siphon [22].
Constraint (5) ensures that  ∈ (,  0 ).This is trivial.Constrains ( 6)-( 8) ensure that the siphon contains no idle place and has one operation place and one resource place at least.
In constrains ( 9)-( 11),  ∈   ,  ∈  • .  means whether transition  is disabled by the operation place  which is in the preset of it.If  is disabled by the operation place ,   = 0. Otherwise,   = 1.This comes from the following facts.If () ≥ 1, then transition  is enabled by the operation place .From constraint (9) and definition of structural bound () in Section 2, it can be obtained that   ≥ ()/() > 0.
Then, constraint (11) ensures that in the siphon  condition (i) holds.This comes from the following fact: for all  ∈   , by the meaning of   , we have   = 1.By constraint (11), it can be obtained that   ≤ 1 −   = 0. Since   ,   ∈ {0, 1}, we have   = 0.By the conclusions above, it can be obtained that transition  is disabled by the operation place  and () = 0.This follows condition (i).
Constraint (12) ensures that in siphon  condition (ii) will hold.Since   ∈ {0, 1}, the following two cases should be considered.
Therefore, constraint (12) ensures that in the siphon  condition (ii) holds.
In conclusion, constraints (11) and (12) ensure that the obtained siphon satisfies conditions (i) and (ii), that is, is a non-max-marked siphon.
In summary, if the MIP formulation has a feasible solution, the obtained siphon is the minimal non-max  -marked siphon.
Thus, Theorem 17 can find a non-max  -controlled siphon at a bad marking.It utilizes some MIP tools to find non-max controlled siphons rather than traverse the state space of the net.Following Theorem 17, Corollary 18 can be obtained.Proof.For a well-marked OSC-S * PR net, Algorithm 1 having no feasible solution means that all siphons of this net are max  -controlled.By Theorem 15, it is live.
Example 19.Applying Algorithm 1 to the OSC-S * PR net in Figure 1 and solving by Lingo [23] no feasible solution can be found.By Corollary 18, it is live, which follows the fact that it is a live net.

Liveness Test for S * PR Nets
In order to test liveness of the S * PR nets, an indirect method is given in this section, which comprises two steps as follows: first, for a given S * PR net, constructing an OSC-S * PR net to ensure that if the latter is live then the former must be live; second, testing liveness of the constructed OSC-S * PR net by the aforementioned MIP-based algorithm.
Remark 20.In the following sections, we assume that for all  0 ∈  0 , | • 0 | = 1.Remark 20 restricts that each process in the net can only have one start action.
In the following, the constructing algorithm is proposed.
Insertion 1.Let (,  0 ) be a well-marked S * PR net.For all  ∈ ,  ∈  • , a pair of virtual place and virtual transition { V ,  V } is inserted into (, ) as follows: Then, for a given S * PR net, an OSC-S * PR net can be constructed by the following algorithm.
Since   and  • are finite sets, it can be obtained that Algorithm 2 will end in finite steps.What is more, ( N, M0 ) = ( ⋃  V ,  ⋃  V , F, Ŵ, M0 ) is called the constructed net of (,  0 ), and (,  0 ) is called original S * PR net of ( N, M0 ).
Proof.First, we prove that ( N, M0 ) is a well-marked S * PR net.By Insertion 1, the virtual places are considered as operation places.Thus, it is apparent that ( N, M0 ) satisfies conditions (i), (ii), (iii), (iv), and (v) in Definition 1.Then, we prove that it satisfies conditions (vi) and (vii).Without loss of generality, assume that  1 ∈   and  1 ∈  •  1 in (,  0 ).Then by Insertion 1,  V and  V will be inserted to ( 1 ,  1 ).
, it can be obtained that no self-loop is inserted to ( N, M0 ) by Insertion 1.This is valid for each insertion in Algorithm 2. Therefore, it can be concluded that no self-loop will be inserted to ( N, M0 ); that is, ( N, M0 ) will still be a pure net.What is more,  1 and  1 are still connected by the path  1 ,  V ,  V ,  1 .This is also valid for all the insertions in Algorithms.Hence, ( N, M0 ) will still be strongly connected; that is, ( N, M0 ) satisfy condition (vii) in Definition 1.Since  V do not attach to any resources,  V will use the resources that  ∈   ⋂ •  V has used.Therefore, ( N, M0 ) satisfies condition (vi) of Definition 1. Henceforth, ( N, M0 ) is an S * PR net.What is more, by Remark 21, the initial marking of virtual place is zero and the initial marking of other places stays the same.Thus, regarding virtual places as members of operation places, ( N, M0 ) satisfies Definition 2 as well; that is, ( N, M0 ) is a well-marked S * PR net.
Second, we prove that ( N, M0 ) is an OSC-S  1, and it is an OSC-S * PR net.
Then, we will prove that the original S * PR net must be live if its constructed net is live.
Proof.The liveness of Petri nets is determined by the firing sequence of transitions and the number of tokens consumed and produced by transitions.If the each firing sequence of (,  0 ) has a corresponding firing sequences of ( N, M0 ) and the number of tokens consumed and produced by those firing sequences is the same, then it can be obtained that if ( N, M0 ) is live, (,  0 ) is live.In other words, (,  0 ) must retain the number or direction of flow of tokens in ( N, M0 ).What is more, by Remark 21, the initial making of (,  0 ) and ( N, M0 ) satisfies M0 () = ∑ ∈  0 () + ∑  V ∈ V 0 *  V = ∑ ∈  0 ().Thus, this theorem could be proved by checking whether each firing sequence of (,  0 ) has a corresponding firing sequence in ( N, M0 ) which consumes and produces the same number of tokens in the same places.
The only difference between an S * PR net and its constructed net is the virtual transitions and virtual places that are inserted by Algorithm 2. Without loss of generality, we could assume that in (,  0 ),  ∈   ,  ∈  • and in ( N, M0 ), In the firing sequence of transitions, the insertion means a replacement of the firing of  by a subfiring sequence  V .From the viewpoint of token number, the subfiring sequence produces tokens to each   ∈  • by the weight of (, ) and it demands tokens from  ∈ •  ⋂   and  by the weight of (, ) and (,  V ) (the token in  V remains zero).Since in ( N, M0 ), (,  V ) = 1 which is equal to (, ) = 1 in (,  0 ), the number of tokens demand and produced by the subfiring sequence is equal to that number of transition .Therefore, the number of tokens in each place changed by firing  V  is the same as that of firing .This is valid for each  ∈  •  .Therefore, for any firing sequence  of (,  0 ), each transition   (which satisfies   ∈ (  ) • ) in  is replaced by the subfiring sequence  V   , a new firing sequence σ will be obtained for ( N, M0 ), and the token in each place changed by firing σ must be the same to that of firing  (the token in  V remains zero).Thus, it can be obtained that if ( N, M0 ) is live, then (,  0 ) is live.So, the liveness of an S * PR net (,  0 ) can be tested the algorithm shown as follows.
Output. a non-max  -marked siphon .
Proof.By Algorithm 3, (,  0 ) will be transformed to its constructed ( N, M0 ).By Lemma 22, ( N, M0 ) is an OSC-S * PR net.By Step 2 and Step 3, Algorithm 3 has no feasible solution which means that applying Algorithm 1 to ( N, M0 ) there is no feasible solution obtained.Then, by Corollary 18, ( N, M0 ) is live.Therefore, by Theorem 24, it can be obtained that (,  0 ) is live.
Example 26.The Petri net model in Figure 2 is an S * PR net, but not an OSC-S * PR net.The choice places  3 and  7 dissatisfy the OSC-Condition.By Algorithm 2, { V1 ,  V1 } Figure 3: Layout of a manufacturing cell.
Figure 4: An S * PR net modeling the system in Figure 3.
and { V2 ,  V2 } are inserted at the rear of  3 , and { V3 ,  V3 } and { V4 ,  V4 } are inserted at the rear of  7 .The constructed net is obtained as Figure 1.Then, by Algorithm, it can be obtained that the constructed net is live.By Theorem 24, the original in Figure 2 is live.

Examples
In this section, a typical example (shown as Figure 3) is quoted to illustrate Algorithm 2, which is a classic FMS cell with 2 buffers, 4 machines, and 3 robots [15].And it can be modeled as Figure 4.
After applying the MIP formulation in Theorem 17 to Figure 5 and solving it with LINGO [23] we obtain a minimal non-max  -marked siphon  =  1  3 +  2  4 +  4 +  3 , which follows the fact that the net is nonlive.
Generally, some structural controllers can be added to enforce the liveness of the net (referring to [9,10,15,21]).Here, four controllers  1 ,  2 ,  3 , and  4 are added into the net in Figure 5, and the resulted S * PR net is shown as Figure 6.Then, the constructed net in Figure 7 can be obtained by Algorithm 2. It can be verified that the net in Figure 7 is live.By Algorithm 3, the net in Figure 6 must be live.

Conclusions
It is well-known that S 3 PR nets and S 4 PR nets can model sequential FMS, while full routine flexibilities can be modeled by S * PR nets.As a subclass of S * PR nets, OSC-S * PR nets have some modeling abilities about routine flexibilities with the restriction of each choice operation using the same type        and quantity of resources.Obviously, Gadara nets [17] are a special case of OSC-S * PR nets satisfying no resources needed in all choice operations.Henceforth, their modeling capabilities can be illustrated as Figure 8 approximately.It is worth to say that Theorem 15 is just a sufficient condition, and some live OSC-S * PR nets may contain non-max controlled siphons.In other words, sometimes Theorem 15 is a little strict though, so there maybe exist ways to loosen the sufficient condition.Moreover, the liveness property of S * PR nets still cannot be tested directly by using standardized mixed integer programming (MIP) tools in this paper.And we should make great efforts to develop more efficient algorithms for testing liveness of S * PR nets.
is called the set of operation places, where  , ̸ =  and  , ⋂  , =  for all  ̸ = ; (b)

Corollary 18 .
Let (,  0 ) be a well-marked OSC-S * PR net.It is live if Algorithm 1 has no feasible solution.

Figure 5 :
Figure 5: the constructed net of Figure 4.

Figure 6 :
Figure 6: A controlled S * PR Net of Figure 5.
Therefore, all of them are enabled for making  if one of them is enabled and all of them are disabled for making  if one of them is disabled.Lemma 10.Let (,  0 ) be a well-marked S * PR net.For all   ∈    , there must exist a simple path SP(  ,  0  ) from   to  0  .Proof.This is trivial, since by condition (iv) in Definition 1,   generated by    ⋃{ 0  } ⋃   is strongly connected.Lemma 11.Let (,  0 ) be a well-marked S * PR net.Then,  is quasi-live under  0 .Proof.From  0 , by Definition 2, for all  0 ∈  0 • ,  0 is enabled.For the transition  , ∈   \  0 • , since (,  0 ) is well-marked, we can construct a trivial firing sequence  =  0, ,  1, , . . .,  (−1), from  0 by only allowing the execution of only one sequential process  and only one token flowing into process , reaching a marking  such that [ , ⟩.This is valid for each  ∈ .Lemma 12. Let (,  0 ) be a well-marked S * PR net, and let  ∈ (,  0 ) be a reachable marking so that  ∈  is a dead transition under .Then,  0 ∉ (, ).Proof.Assume that  0 ∈ (, ).By Lemma 11, ∃  ∈ (, ) such that   [⟩.This contradicts the hypothesis that  ∈  is a dead transition under .Thus, Lemma 12 holds.