**2. The algorithm description of the shortest possible sequence of transitions in petri nets**

To build models of discrete systems, it needs various components of the system with abstract operations: switching the transition from one state to another; the action of a program operator, machine, or conveyor; interruptions in the operating system; phase completion in the project; etc. The same system can work differently under different conditions, generating many processes that will bring nondeterministic work. In real systems, cases occur at certain periods and last a certain time. In synchronous models of discrete systems, events are correctly associated with certain pauses, moments during which all components simultaneously change the state of the system, changing the state of the system.

The modeling approach has several drawbacks when dealing with large systems. To make the model look impressive, first of all, with every change, the system must take into account all the components of its general condition.

Secondly, with the above approach, information in systems disappears between random links.

Thirdly, the so-called asynchronous systems can cause undefined events at time intervals.

Petri nets and the above types of models are called asynchronous.

Causal relationships make it possible to more clearly describe the structural features of the system.

Asynchronous models of nonformal description of the case, in particular, Petri nets, must involve relationships of time (early, late, not at the same time, etc.), when it is convenient or accepted, but they represent a causal relationship. Great interplay of asynchronous systems, typically, has a complex dynamic structure.

The relationship between the two will be described more clearly if not immediate contacts are marked, or cases and situations in which the case can be realized. In this case, the conditions of implementation of the system of global situations are formed in the named local operations.

The term has its capacity. The term is not fulfilled (capacity is equal to 0), the term is fulfilled (capacity is equal to 1), and the term is fulfilled in n times (capacity is equal to n, where n- is a positive integer).

Most systems are suitable as discrete structures that consist of two elements: type of events and terms. Cases and terms in Petri nets, sets that do not intersect with each other, respectively, are called positions and transitions. Transitions are vertical lines and places with circles in a graphical representation of Petri nets [1, 2].

#### **2.1 The relationship of petri nets, reachable states, and reachable trees**

**Definition 1:** Petri nets are *M C*ð Þ , *μ* , where *C* ¼ ð Þ *P*, *T*,*I*, *O* is the network structure and *μ* is the network condition. *P* is positions and *T* is transitions, which are finite sets. *<sup>I</sup>* : *<sup>T</sup>* ! *<sup>P</sup>*<sup>∞</sup>, *<sup>O</sup>* : *<sup>T</sup>* ! *<sup>P</sup>*<sup>∞</sup> are input and output functions, respectively, where *<sup>P</sup>*<sup>∞</sup> are all possible multisets (repetitive elements) of *<sup>P</sup>*. *<sup>μ</sup>* : *<sup>P</sup>* ! *<sup>N</sup>*<sup>0</sup> is the function of condition, where *N*<sup>0</sup> ¼ f g 0, 1, ⋯ is the set of integers and included 0.

Now, we will define a function that determines the number of elements in their entering numbers in the collection [8]. *X* element enters into collection of B, which we will appoint as #ð Þ *X*, *B* (called: *X* number in *B*). If we limit the number of elements in the collection so that 0 ≤#ð Þ *X*, *B* ≤ 1, then we will reach the idea of the set. Since # X, B ð Þ function determines the X element entering collection of B, it follows that # X, B ð Þ≥0, the grouping of all the X and B. X element of the B collection, if # X, B ð Þ> 0, i.e. *X* ∈*B*,*:* Identically, if # X, B ð Þ¼ 0, then X ∉ B*:*

Let us set empty collection of ∅, which has members (i.e., all X : # X, ð Þ¼ *B* 0). ∣B∣ is the capacity of the entire number of elements entering B collection:

$$|B| = \sum\_{X} \#(X, B).$$

Saying net state, we will understand the following:

$$(\mu(P\_1), \mu(P\_2), \dots, \mu(P\_n)), \ n = |P|, P = \{P\_1, \dots, P\_n\}$$

Suppose we have M ¼ ð Þ C, μ *:*

We will say that in μ state tj ∈T transition is allowed to implement if for ∀Pi ∈I tj � � there is

$$
\mu(P\_i) \ge \# \left( P\_i, I(t\_j) \right).
$$

Suppose in μ state tj transition is allowed to implement and it is actually acted. In this case the net will appear in its new state, μ<sup>0</sup> , which is solved in the following way:

$$\forall P\_i \in P, \mu'(P\_i) = \mu(P\_i) - \#\left(P\_i, I(t\_j)\right) + \#\left(P\_i, O\left(t\_j\right)\right).$$

Let us name R C, μ<sup>0</sup> ð Þ as the reachable state set:

1.μ<sup>0</sup> ∈ R C, μ<sup>0</sup> ð Þ,

2. If μ<sup>0</sup> ∈R C, μ<sup>0</sup> ð Þ and ∃tj ∈ T have transition in the way that δ μ<sup>0</sup> , tj � � <sup>¼</sup> <sup>μ</sup>", then *μ*0 0∈*R C*, *μ*<sup>0</sup> ð Þ.

**Figure 1.**

**Figure 2.**

**117**

*The petri net reachable infinite tree.*

*An example of petri nets. The way in the tree.*

*The Possibilities of Modeling Petri Nets and Their Extensions*

*DOI: http://dx.doi.org/10.5772/intechopen.90275*

3.Other states do not belong to R C, μ<sup>0</sup> ð Þ. The R C, μ<sup>0</sup> ð Þ can be infinite

μ" marking covers μ<sup>0</sup> marking if

$$
\mu' \underline{r} \ge \mu'.
$$

First, build a reachability tree. Then you need to look for the peak as follows. If there is no such peak, then the marking is not covered by any achievable marking, if it is located inside and gives an accessible marking that covers [14–16].

We construct the reachability tree of Petri nets in **Figure 1**. The state of this network is (1101), which shows the presence of tokens in the network at this moment. Tokens shown in **Figure 1**, which are depicted with small dots, correspond to the availability of resources. The network state changes due to the movement of tokens.

Let the states correspond to the vertices and transitions to the sides. The root corresponds to the first state of the network.

**Figure 1** corresponds to **Figure 2**, in which the reachable tree is infinite. To make the tree finite, we impose restrictions. If any peak is blocked, we will call it a terminal. If there is a state in any peak and there is another peak in the tree with the *The Possibilities of Modeling Petri Nets and Their Extensions DOI: http://dx.doi.org/10.5772/intechopen.90275*

Now, we will define a function that determines the number of elements in their entering numbers in the collection [8]. *X* element enters into collection of B, which we will appoint as #ð Þ *X*, *B* (called: *X* number in *B*). If we limit the number of elements in the collection so that 0 ≤#ð Þ *X*, *B* ≤ 1, then we will reach the idea of the set. Since # X, B ð Þ function determines the X element entering collection of B, it follows that # X, B ð Þ≥0, the grouping of all the X and B. X element of the B collection, if # X, B ð Þ> 0, i.e. *X* ∈*B*,*:* Identically, if # X, B ð Þ¼ 0, then X ∉ B*:*

Let us set empty collection of ∅, which has members (i.e., all X : # X, ð Þ¼ *B* 0).

ð Þ *μ*ð Þ *P*<sup>1</sup> , *μ*ð Þ *P*<sup>2</sup> , … , *μ*ð Þ *Pn* , *n* ¼ ∣*P*∣, *P* ¼ f g *P*1, … , *Pn*

We will say that in μ state tj ∈T transition is allowed to implement if for

*μ*ð Þ *Pi* ≥# *Pi*,*I tj*

ð Þ¼ *Pi μ*ð Þ� *Pi* # *Pi*,*I tj*

2. If μ<sup>0</sup> ∈R C, μ<sup>0</sup> ð Þ and ∃tj ∈ T have transition in the way that δ μ<sup>0</sup>

3.Other states do not belong to R C, μ<sup>0</sup> ð Þ. The R C, μ<sup>0</sup> ð Þ can be infinite

*μ*0 0≥*μ*<sup>0</sup> *:*

follows. If there is no such peak, then the marking is not covered by any achievable marking, if it is located inside and gives an accessible marking that covers [14–16]. We construct the reachability tree of Petri nets in **Figure 1**. The state of this network is (1101), which shows the presence of tokens in the network at this moment. Tokens shown in **Figure 1**, which are depicted with small dots, correspond to the availability of resources. The network state changes due to the movement of

Let the states correspond to the vertices and transitions to the sides. The root

**Figure 1** corresponds to **Figure 2**, in which the reachable tree is infinite. To make the tree finite, we impose restrictions. If any peak is blocked, we will call it a terminal. If there is a state in any peak and there is another peak in the tree with the

First, build a reachability tree. Then you need to look for the peak as

� � � � *:*

� � � � <sup>þ</sup> # *Pi*, *O tj*

, which is solved in the following way:

, tj � � <sup>¼</sup> <sup>μ</sup>", then

� � � �

Suppose in μ state tj transition is allowed to implement and it is actually acted. In

#ð Þ *X*, *B :*

∣B∣ is the capacity of the entire number of elements entering B collection:

Saying net state, we will understand the following:

Suppose we have M ¼ ð Þ C, μ *:*

*Numerical Modeling and Computer Simulation*

this case the net will appear in its new state, μ<sup>0</sup>

∀*Pi* ∈ *P*, *μ*<sup>0</sup>

μ" marking covers μ<sup>0</sup> marking if

corresponds to the first state of the network.

Let us name R C, μ<sup>0</sup> ð Þ as the reachable state set:

� � there is

1.μ<sup>0</sup> ∈ R C, μ<sup>0</sup> ð Þ,

0∈*R C*, *μ*<sup>0</sup> ð Þ.

*μ*0

tokens.

**116**

∀Pi ∈I tj

<sup>∣</sup>*B*<sup>∣</sup> <sup>¼</sup> <sup>X</sup> *X*

**Figure 1.** *An example of petri nets. The way in the tree.*

**Figure 2.** *The petri net reachable infinite tree.*

same state that has already been developed, then we will call the new peak repeated and will not develop it.

If there is a path like / \*\* / in the tree, then the path through the second peak may repeat, and the states grow. Let us introduce the idea of infinite much as ω:

ω≥ω, ω þ a ¼ ω, and ω � a ¼ ω, where a ¼ const: for example, instead of (5,⋯), we will write ð*ω*, ⋯). In this case the tree will become as finite, and we will have loss of information [2].

Let us give several definitions, which will be used in the entire work.

**Definition 2**. A peak is called a boundary if it is in a processing state.

**Definition 3**. The peak is called a terminal if it does not contain a subtree.

**Definition 4**. The peak is called internal if it has already been processed.

**Definition 5**. The boundary peak is repeated if there is an internal peak with the same state.

A description of the structure of the reachability tree algorithm can be seen in an earlier published article [8].

With the help of this algorithm, we will build (as in **Figure 1**) the Petri net reachable tree (see **Figure 3**).
