Research Article
Clustering Services Based on Community Detection in Service Networks
| Input: | | ASAN, ASDN, and SSN | | Output: | | Q and all the communities | (1) | Initialize , , , = false, and = false | (2) | Calculate the degree of each atomic service in ASAN and store them in | (3) | for i = 1 to do | (4) | = 0; | (5) | if [i 1 then] | (6) | = ++; | (7) | = true; | (8) | end if | (9) | end for | (10) | for i = 1 to do | (11) | if [i = = 1 ! then] | (12) | = −1; | (13) | = −1; | (14) | for j = 1 to do | (15) | if then | (16) | = ; | (17) | = j; | (18) | end if | (19) | end for | (20) | if ! = −1 ! = −1 then | (21) | = ; | (22) | = true; | (23) | ++; | (24) | end if | (25) | end if | (26) | if = = then | (27) | break; | (28) | end if | (29) | i = 1; | (30) | end for | (31) | Calculate the initial Q according to equation (10) | (32) | for i = 1 to do | (33) | for j = 1 to do | (34) | if [j [i] 1 ! then | (35) | Suppose we move atomic service i to community | (36) | Update | (37) | Calculate Q according to equation (10). Denote it as | (38) | Store = – Q into an array | (39) | end if | (40) | end for | (41) | = true | (42) | Select the maximum . Denote it as | (43) | if then | (44) | Move atomic service i to community that produces the largest | (45) | for m = 1 to do | (46) | if [i [m] = = 1 then] | (47) | = false | (48) | end if | (49) | end for | (50) | i = 1 | (51) | | (52) | end if | (53) | end for | (54) | return Q and all the communities |
|