Node: open the accordion below for a detailed explanation of the algorithm's implementation
Modularity Update
The change in modularity by moving one node to the community of one of its neighbors is computed as follows.
We first remove node \(i\) from its community \(D\) and then insert this node into community \(C\).
We first introduce some notation:
\(D\rightarrow C\) is the operation of moving node \(i\) from its community \(D\) to community \(C\)
\(k_i(i \rightarrow D)\) is the total weight of all links pointing from node \(i\) to community \(D\)
\(k_i(i \rightarrow C)\) is the total weight of all links pointing from node \(i\) to community \(C\)
\(\Sigma_{C,in}\) sum of weights all links internal to community \(C\) including loops
\(\Sigma_{D,in}\) sum of weights all links internal to community \(D\) including loops
\(\Sigma_{C,tot}\) sum of weights all links of nodes in community \(C\) including loops
\(\Sigma_{D,tot}\) sum of weights all links of nodes in community \(D\) including loops
\(
\Sigma_{in} = \text{sum of the weights of the links inside the community of node } i
\)
\(
\Sigma_{tot} = \text{total sum of the weights of all links of the community, including edges pointing outside the community}
\)
\(
\Sigma_{tot} + k_i = \text{total sum including the links of node } i
\)
\(
k_{i,in} = \text{sum of the weights of the links of node } i \text{ pointing inside the community}
\)
\(
k_i = \text{sum of the weights of the links incident to node } i
\)
Phase 2
Construct a new network where the nodes are the communities found in Phase 1.
Links between actual nodes of the communities are combined into a new link; the weight is the sum of the
weights of the links.
Links between nodes within a community are combined into a loop of the new node (with weight = 2).
Apply the method of Phase 1 to the new network.
Continue iteratively until \(\Delta Q \leq 0\). In each iteration, a new network is being created from the
communities found in the previous iteration.