In the first stage, the algorithm examines how the graph modularity \(m\)  changes if a node \(i\)  would be assigned to a community of its neighbouring node \(j\in \mathcal {N}_{i}\) . The modularity gain \(\Delta m\)  in case node \(i\)  is assigned to community \(h\)  of adjacent node \(j\)  has been determined in [1]} as
\(\begin{aligned}\Delta m = \left( \frac{\sum _{\text{in}} + 2\sum _{l:C_{lj}=1}M_{il}}{2L} - \left(\frac{\sum _{\text{tot}} + d_{i}}{2L}\right)^{2} \right) - \left( \frac{\sum _{\text{in}}}{2L} - \left(\frac{\sum _{\text{tot}}}{2L}\right)^{2} - \left(\frac{d_{i}}{2L}\right)^{2} \right),\end{aligned}\) 
