Research Article

Community Detection with Self-Adapting Switching Based on Affinity

Algorithm 1

The pseudocodes of the SAS algorithm.
Algorithm community detection with self-adapting switching.
(1)input Adjacency matrix of the network.
(2)while .
(3) Select a node as the hub node such that its degree is maximal in the current network.
(4) Gradually search the suitable nodes by .
(5) Repeat step 4 until no nodes satisfy the condition in step 4, and then update the network and start the next detection.
(6)if fails.
(7) Select a node as the hub node such that its degree is maximal in the network.
(8) Gradually search the suitable nodes by the double affinities condition: .
(9) Repeat step 8 until no nodes satisfy , then start the next detection.
(10)Adjust the results based on the community definition.