# A Constrained Louvain Algorithm with a Novel Modularity
## 5 Conclusions  
The Louvain algorithm aims to optimize an objective function of the whole network, so it can excellently detect the community structure. Moreover, the Louvain method has a high efficiency. However, the communities obtained by the classical Louvain algorithm are not still the real communities. In this paper, we proposed a new local modularity function \(F2\) as an objective function of optimization. \(F2\) can overcome certain problems of other modularity functions such as the resolution limit problem and does not split the well-connected network into small communities. Both theoretical deductions and some examples suggest that \(F2\) identifies communities better than the objective functions of \(Q,F,M\). Thus, \(F2\) is competitive as an objective function. Then, we proposed the constrained Louvain algorithm by adding the constraints \(F2>0.25\), and the node number of each community is larger than 3 to the Louvain algorithm. This is because there exists some small communities and some communities that are not satisfying the weak community among the communities obtained by the Louvain algorithm. The constraints are meaningful. Finally, on both the real-world networks and the computer generated benchmark networks, the constrained Louvain algorithm with \(F2\) shows a high accuracy of identifying community structures in most of the considered networks.  
For hierarchical networks, we can add tunable parameters [48] in \(F2\) to detect the hierarchical structure by the constrained Louvain algorithm. Through proper revisions, the constrained Louvain algorithm with \(F2\) can be easily extended to directed or weighted networks. With the development of the computer technique, the data of the large network and dynamic network are more easily collected. Therefore, the community detection of dynamic and large networks is an interesting and challenging topic [49, 50]. At the same time, the constrained Louvain algorithm can be paralleled, which is the same as the classical Louvain paralleled algorithm [30, 31, 51, 52]. This is helpful for community detection in large or dynamic networks.  
In the interdisciplinary area, the Louvain algorithm has many applications, such as disease modules' identification [53], a hierarchical clustering approach of network embedding [54], the spatiotemporal analysis of a bike-share system [55] and the analysis of wireless sensor networks [56; 57]. Our constrained Louvain algorithms are also applied to these fields. Moreover, modularity functions can be used to assess the training results for neural networks [58]. Our study on the modularity function \(F2\) may hopefully lead to further studies that might be worth pursuing.  
Conceptualization, X.R.; methodology, J.Z., P.M. and X.R.; software, B.Y.; validation, X.R.; formal analysis, P.M., K.G. and X.R.; investigation, B.Y.; resources, J.Z.; data curation, B.Y.; writing--original draft preparation, J.Z. and K.G.; writing--review and editing, J.Z. and X.R.; supervision, X.R. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
The data presented in this study are available.  
We gratefully acknowledge the help of [PERSON].  
The authors declare no conflict of interest.