## 4 Reliability Calculation Method for FRCPN
### Reliability Calculation Algorithm for All the Web Services in FRCPN  
Algorithm 3 was used to calculate the reliability values of Web Services according to SLLFRV \(linkT\) in sequence. According to the content of the algorithm, the time complexity of the algorithm is \(O(n^{2})\). ```
//According to SLLFRV \(linkT\), generate successively the reliability values of Web services
1 forTransition \(t=linkT\).top to \(t=\) null step \(t=t\).next //If the current transition is of the first, fourth, or fifth type
2 if\(t\).getType() = 1 or \(t\).getType() = 4 or \(t\).getType() = 5 then //*Get the reliability value of the prepositional Web service of the current transition*/
3 float\(trustValue=t\).getPRWSS().get(0).getTrustValue() \(\times\)\(t\).getTrustValue() //Get the \(POWSS\) of the transition \(t\)
4 WSSet\(postWSSet=t\).getPOWSS () //Set the reliability values of the Web services in \(POWSS\) of transition \(t\)
5 forint\(i=0\) to \(|postWSSet|-1\) step \(1\)
6 WS\(ws=postWSSet.\)get(\(i\))
7\(ws.\)setTrustValue( Max[\(ws.\)getTrustValue, \(trustValue\)]
8 endfor
```  
**Algorithm 3** FRCPN fillWSVValue(FRCPN \(frcpn\), LinkT \(linkT\))  
Algorithm 4 was used to calculate the reliability values of Web Services according to SLLFRV \(linkT\) in sequence. According to the content of the algorithm, the time complexity of the algorithm is \(O(n^{2})\). Algorithm 5 was used to calculate the reliability values of Web Services according to SLLFRV \(linkT\) in sequence. According to the content of the algorithm, the time complexity of the algorithm is \(O(n^{2})\). ```
9 endif //If the current transition is of the second type
10 if \(t\).getType() = 2 then //Get the _PRWSS_ of the current transition
11 WSSet _preWSSet = t_.getPRWSS() /*The reliability value of the postpositional Web service of the transition equals the minimum value of reliability values of all the prepositional Web services of the transition*/ // _preWSSet_!=
12 floattrustValue = **Min**( _preWSSet_.get(0).getTrustValue(), _preWSSet_.get(1).getTrustValue(), _\(\ldots\)__preWSSet_.get(\(n\)).getTrustValue()) \(\ldots\)_t_.getTrustValue() // The _POWSS_ of the current transition has only one Web service
13 WS _ws_ = \(t\).getPOWSS.get(0)
14_ws_.setTrustValue( **Max** [ ws.getTrustValue, trustValue] );
15 endif // If the current transition is of the third type
16 if \(t\).getType() = 3 then // The _POWSS_ of the current transition only has one Web service
17 WS _ws_ = \(t\).getPOWSS().get(0) // Get the _PRTS_ of the current transition
18 Tset _tSet = ws.getPRTS() // Get the reliability value of _ws_, _!tSet_!= \(n\)
19 floattrustValue = **Max**( _tSet_.get(0).getTRWSS().get(0).getTrustValue()\(\times\)_tSet_.get(0).getTrustValue(), _tSet_.get(1).getPRWSS().get(0).getTrustValue()\(\times\)_tSet_.get(1).getTrustValue(), _\(\ldots\)_, _tSet_.get(n).getPRWSS().get(0).getTrustValue()\(\times\)_tSet_.get(n).getTrustValue());
20 ws.setTrustValue( **Max** [ ws.getTrustValue, _trustValue_] );
21 endif
22 endfor returnfrcpn
```  
**Algorithm 3**_Cont_. The algorithm traverses the transitions in SLLFRV _linkT_, in order to calculate the reliability values of the direct subsequent Web services of the transitions in SLLFRV _linkT_ according to the type of transition. If the current transition \(t\) is of the first, fourth, or fifth type, it only has one immediate prepositional Web service, and the reliability values of immediate postpositional Web services are \(t\).getPRWSS().get(0).getTrustValue()\(\times\)_t_.getTrustValue(). In order to prevent conflict between the reliability values of multiple transitions, the algorithm executes the operation \"**Max**\", so as to always get the highest reliability value as the final reliability value of a Web service.