Dmfo-cd: A discrete moth-flame optimization algorithm for community detection

Mohammad H. Nadimi-Shahraki, Ebrahim Moeini, Shokooh Taghian, Seyedali Mirjalili

Research output: Contribution to journalArticlepeer-review

28 Citations (Scopus)


In this paper, a discrete moth–flame optimization algorithm for community detection (DMFO-CD) is proposed. The representation of solution vectors, initialization, and movement strategy of the continuous moth–flame optimization are purposely adapted in DMFO-CD such that it can solve the discrete community detection. In this adaptation, locus-based adjacency representation is used to represent the position of moths and flames, and the initialization process is performed by considering the community structure and the relation between nodes without the need of any knowledge about the number of communities. Solution vectors are updated by the adapted movement strategy using a single-point crossover to distance imitating, a two-point crossover to calculate the movement, and a single-point neighbor-based mutation that can enhance the exploration and balance exploration and exploitation. The fitness function is also defined based on modularity. The performance of DMFO-CD was evaluated on eleven real-world networks, and the obtained results were compared with five well-known algorithms in community detection, including GA-Net, DPSO-PDM, GACD, EGACD, and DECS in terms of modularity, NMI, and the number of detected communities. Additionally, the obtained results were statistically analyzed by the Wilcoxon signed-rank and Friedman tests. In the comparison with other comparative algorithms, the results show that the proposed DMFO-CD is competitive to detect the correct number of communities with high modularity.

Original languageEnglish
Article number314
Issue number11
Publication statusPublished - Nov 2021


  • Community detection
  • Complex network
  • Metaheuristic algorithms
  • Moth–flame optimization algorithm
  • Optimization
  • Swarm intelligence algorithms


Dive into the research topics of 'Dmfo-cd: A discrete moth-flame optimization algorithm for community detection'. Together they form a unique fingerprint.

Cite this