Algorithm 2: LPA-MNI. |
Input:
|
Output: The result of community detection |
-
1:
Initialize a community to each node of the network.
-
2:
Cancluate the node importance of all nodes according to Equation (4).
-
3:
Arrange the nodes according the node importance.
-
4:
For each node , remove i from its own community and place it in the community of neighbor j, and compute the gain of modularity during the process. Place the node i in the community for which this gain is maximum. The process is executed repeatedly and sequentially for all nodes in order D until the gain is unchanged and the initial rough communities are obtained.
-
5:
Assign same label to the node in the same initial community defined by step 4.
-
6:
Set t = 1.
-
7:
For each , update its label according to the following function, , when the number of more than one label reaches maximum, the importance of neighbor nodes is calculated (Equation (4)), and the most important node’s label are assigned to the current node.
-
8:
If the labels in the network become steady, stop the algorithm. Else, set and go to step 7.
|