• 沒有找到結果。

CHAPTER 4 IMPLEMENTATION

4.4 V ERIFICATION C ORE

4.4.1 Elimination Methods

The elimination method of PNV is based on Gaussian elimination and some special methods. The methods are devised according to the characteristic of transition matrices to simplify the computational complexity of the elimination process.

A transition matrix of a Petri net has a characteristic that the most values in the matrix are zero. For each column, only the rows which represent the places connect to this transition have non-zero values. For each row, only the columns which represent the transitions connect to this place have non-zero values. In other words,

in a transition matrix, the most values are zero and the second most values are 1 or -1.

The causes of this characteristic are that for each row, the non-zero columns are the transitions connected with the place. For a place, especially state place, there are not many transitions connect with it. This characteristic means we can utilize some specific methods to eliminate a transition matrix with fewer steps than using general Gaussian elimination. During generating a transition matrix, we would put the state places together to make the characteristic more obvious. By doing so, the work of elimination may be reduced outstandingly.

One of the methods we devise is that when we find one row with zero lead value, we can ignore this row in the elimination step. In other words, we check the representative value and decide if we need to eliminate this row. When the representative value is not zero, we have to eliminate it, but if the value is zero, we can skip the row. Though checking the representative value, we can save the work of eliminating unnecessary rows. According to this method, we can avoid some unnecessary calculation. So, we can say that the method devised from the characteristic of a transition matrix can make us more easily and quickly eliminate the transition matrices.

Because of the characteristic of a transition matrix, there is another method could be used to simplify the complexity of elimination. We check the values in the pivotal row and memorize the columns of the non-zero values. When we start to eliminate other rows, we can only calculate the non-zero columns and skip the other columns which are zero. By using this method, we can reduce the calculation when we meet a row which needs to be eliminated.

According to the methods above, the first step of elimination is to find out a non-zero value in the first column to be the pivotal row. When the pivotal row is not the first row, we have to exchange the pivotal row with the first row. Then we check

43

all values in the pivotal row and record the column indexes of the non-zero values.

The next step is to eliminate the first column. We will check the values in the first column and eliminate the non-zero rows. The following is an example illustrating the steps we mentioned above.

(a) (b)

(c)

Figure 4-5 Eliminating example

Figure 4-5(a) is a transition matrix. For the first column, the (0, 0) position is zero, so row 0 can not be the pivotal row. We continue to check (1, 0) and find that it is a non-zero value, so we exchange row 0 and row 1 to become the matrix shown in Figure 4-5(b). After deciding the pivotal row, we start to check the items in the pivotal row and record the indexes of non-zero values. We find that column 0 and column 7 are not zero and we record the indexes 0 and 7. Then we start to eliminate the non-zero values in column 0 and only calculate the columns we have recorded.

In this example, we can eliminate the first column through four times of calculation with our methods instead of use full Gaussian elimination with sixty-four times of calculation.

For an m by n matrix, we assume that m and n are the same order and m = n + k.

To find out the first pivotal row and exchange it to the first row, we have to check column 0 m times in the worse case and do 3n times to exchange the two rows. To find the second pivotal row, we have to check (m - 1) times and exchange 3(n - 1) times. The above operations we have to do for a matrix are

The computational complexity of finding the pivotal row and exchanging it to the right position is O(n2 ).

To eliminate the first column, we have to check (m – 1) rows to figure out which rows need to be eliminated and we assume that there are ci rows need to be eliminated.

Before we start to eliminate, we need to check the values in the pivotal row and it cost n operations. After checking the pivotal row, we find out that there are di non-zero values. So the number of calculation we need to do is ci * di. The total operations we have to do for eliminating a matrix into reduced row echelon form are

45

[n + (m - 1) + c1 * d1] + [(n - 1) + (m - 1) + c2 * d2] +…

The order of term is about n. The computational complexity of the elimination step is O(n echelon form. When the rank of the matrix is equal to its transition number, we can get the firing times of each transition without more action. An example is shown in Figure 4-6, the matrix is in reduced row echelon form and the rank is the same as its transition number, so we can get the solutions of t0 to t5 are a to f without back substitution. Summarily, the total computational complexity of our elimination process is O(n2 ) and its order is lower than the computational complexity of original Gaussian elimination O(n3 ). The methods we use to eliminate a transition matrix can reduce the order of computational complexity from O(n3 ) to O(n2 ).

t0 t1 t2 t3 t4 t5 Δμ

Figure 4-6 Reduced row echelon form

相關文件