## 4 Reliability Calculation Method for FRCPN
### Reliability Calculation Algorithm for All the Transitions in FRCPN
Algorithm 4```
11\(linkT.\)last.next = postTSet.get(\(i\))
12\(linkT.\)last = postTSet.get(\(i\))
13 end if
14 end for  //Continue to iterative generate \(linkT\)
15 forint\(i\) = 0 to \(\mid postTSet\mid\) - 1 step 1
16 generateLinkT(\(fcpn\),postTSet.get(\(i\)),\(linkT\))
17 end for
18 else //It is not first time to call generateLinkT()  // Generate \(linkT\) and return to the superior function
19 if\(t\) is \(\O\)then
20 returnlinkT
21 end if  //Get the \(POWSS\) of the current transition
22 WSSet \(wsSet\) = \(t.\)getPOWSS ()
23 forint\(i\) = 0 to \(\mid wsSet\mid\) - 1 step 1
24 Wss = wsSet.get(\(i\))  //Get the \(POTS\) of the current Web service
25 TSet \(postTSet\) = \(ws.\)getPOTS()  //Get the \(PRTS\) of the current Web service
26 TSet \(preTSet\) = \(ws.\)getPRTS()  //If \(PRTS\) of the current Web service is not in \(linkT\)
27 if\(preTSet\) not in \(linkT\)then
28 break
29 end if  //If the current Web service does not have a postpositional transition
30 if\(postTSet\) is \(\O\)then
31 break
32 end if
33 forint\(j\) = 0 to \(\mid postTSet\mid\) - 1 step 1
34 Transition \(ct\) = postTSet.get()  //Get the union of \(POWSS\) of all the transitions in \(linkT\)
35 WSSet \(linkTPreWSSet\) = \(\cup_{k=0}^{|linkT|}linkT.\)get(\(k\)).getPOWSS()  //Set the initial value of the judgment flag to false /*The judgment flag indicates whether the \(PRWSS\) of the current transition is included in \(preWSSet\)*)
36 boolean flag = false
37 WSSet \(tp\)\(preWSSet\) = \(ct.\)getPRWSS()  // If \(tp\)\(WSSet\) is a subset of \(linkTPreWSSet\), then set the flag to **true**
38 if\(tp\)\(preWSSet\) in \(linkTPreWSSet\)then
39 flag = true
40 endif
41 //If the current transition is not included in \(linkT\), and the judgment flag is true*/
42 if\(ct\)**not in \(linkT\) and \(flag\) is true then
43 linkT.last = ct
44 end if  //Continue to iterative generate \(linkT\)
45 forint\(i\) = 0 to \(\mid postTSet\mid\) - 1 step 1
46 generateLinkT(\(fcpn\),postTSet.get(\(i\)),\(linkT\))
47 end for
48 end for
49 end for
50 endif
51 returnlinkT
```  
**Algorithm 2**\(Cont\). When the algorithm is first time to be called, \(t\) and \(linkT\) are \(\emptyset\), so the algorithm creates a new \(linkT\), and begins to inspect from the starting Web service of the graph. The algorithm puts the \(POTS\) of the starting Web service into \(linkT\), and then continues the recursion. If the algorithm is not first time to be called, then the algorithm must judge some things. If the current transition \(t\) is \(\emptyset\), then it indicates that recursion is completed and the algorithm can return to the superior function. If the transition \(t\) is not empty, then the algorithm gets the \(POWSS\) of the current transition and uses a cycle \"**for**\" to inspect the elements in \(POWSS\). Next, the algorithm gets the POTS \(postTSet\) of the current Web service and the PRTS \(preTSet\) of the current Web service. If \(preTSet\) is not in \(linkT\), it shows that the reliability values of the prepositional transitions of the current Web service and the reliability values of the postpositional transitions of the current Web service have not all been generated, so the algorithm does not continue to inspect the candidate transitions, and uses \"**break**\" to exit inspection. If the current Web service does not have an immediate postpositional transition, \(postTSet\) is empty and the algorithm does not continue to follow the transition in the future, so also uses \"**break**\" to exit inspection. Next, the algorithm uses a cycle \"**for**\" to traverse the transitions in \(postTSet\). In the ideas of the algorithm, if the transitions are already in \(linkT\), then the reliability values of all the immediate postpositional web services of the transitions can be calculated. The algorithm first gets the union of \(POWSS\) of all the transitions in \(linkT\), and then executes set operations.