Skip to main content
. 2021 Apr 21;23(5):497. doi: 10.3390/e23050497
Algorithm 2: LPA-MNI.
Input:G=(V,E)
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:

    D Arrange the nodes according the node importance.

  • 4:

    For each node iD, 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 iD, update its label according to the following function, Cx(t)=f(Cxi1(t),,Cxim(t),Cxi(m+1)(t1),,Cxik(t1)), 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 t=t+1 and go to step 7.