Algorithmic Considerations

6.4.1 Algorithmic Considerations

Since the strong and weak-bisimulation relations we described in the previous sec- tion are slight variations of the Markovian strong and weak-bisimulation relations, respectively, we can use existing algorithms for checking Markovian strong and weak- bisimulations to decide strong and weak bisimilarities on CCC processes with minor changes.

Checking strong bisimulation on a CTMC can be carried out by an algorithm with time complexity O(m log n) [DHS03], where m is the number of transitions, and n is the number of states of the CTMC . The algorithm is based on the partition-refinement approach described in [PT87]. The same partition-refinement-based algorithm can also be used to check weak bisimulation on a CTMC [DHS03], when it is coupled with transitive-closure computation. This algorithm is of time complexity

O(n 3 ), where n is the number of states of the CTMC . Each of these algorithms computes the largest

Markovian bisimulation, in the sense that it produces an optimal aggregation from the possible lumpings of the given CTMC .

New algorithms for checking strong and weak bisimulations on interactive Markov chains (IMC) [Her02] that exploit the acyclicity of the models are presented in [CHZ08]. These algorithms can also be used to check Markovian strong and weak bisimulations. Assuming that the given CTMC is acyclic, the algorithm for checking strong bisimula- tion is of time complexity O(m), where m is the number of transitions of the CTMC . The theoretical time complexity of the new algorithm for checking weak bisimulation on an acyclic CTMC remains cubic in the number of states. In practice, however, the new algorithm achieves a significant speed-up.

For the case of PH -equivalence, the following lemma provides a mechanism to de- termine whether two processes P, Q ∈ L are PH -equivalent.

Lemma 6.23 ([Wol08]). Let (~ α, A) and (~ β, B) be two phase-type representations of size k and respectively l, where k ≥ l. PH(~α, A) = PH(~β, B) if and only if their first 2k moments agree.

The lemma establishes that in order to determine whether two PH representations have the same PH distribution, we just have to check whether their first 2k moments are pair-wise equal, where k is the larger size of the two PH representations. Therefore, given two processes P, Q ∈ L, where |Reach(P )| ≥ |Reach(Q)|, their PH -equivalence can be ascertained by obtaining their absorbing CTMC semantics M P and M Q , and then comparing the first 2( |Reach(P )| − 1) moments of their associated APH represen- tations.

6.4. Equivalence Checking and Process Reduction 117

The i-th moment of a PH representation (~ α, A) (cf. Section 2.5.1) is

m −i

i =( −1) i!~ αA ~e.

Thus, to compute the i-th moment, we need a matrix inversion and followed by i −1 vector-matrix multiplications. Since matrix inversion can be unstable, it is best to avoid it. As described in [Wol08], the first i moments can be instead obtained as follows. The first moment can be obtained by solving the system of equations

~γ [1] A = −~α,

and the moment is [1] m

1 = ~γ ~e. Then, for 2 ≤ j ≤ i, we iteratively solve the system of equations

~γ [j] A =

−j~γ [j−1] ,

and the corresponding moment is [j] m

j = ~γ ~e.

Since we are dealing with acyclic PH representations, PH -generator A is an upper- triangular matrix, and to solve the above systems of equations we only need to apply backward substitution, which is of time complexity

O(k 2 ). Therefore, to determine whether two APH representations are PH

-equivalent is of time complexity 3 O(k ).