Skip to content

This project implements the Girvan-Newman and Louvain algorithms from scratch for community detection in graphs, using datasets like Wiki-Vote and LastFM-Social. It includes automated stopping criteria, dendrogram visualization, and performance comparisons.

Notifications You must be signed in to change notification settings

Arjun-08/Community-detection-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Community Detection Algorithms

This repository contains the implementation for the Community Detection Algorithms . The implementation explores community detection in graphs using the Girvan-Newman and Louvain algorithms.

Dataset

The assignment utilizes the following datasets:

  1. Wiki-Vote dataset: Link
  2. Feather-LastFM-Social dataset: Link

Objectives

The assignment addresses the following tasks:

  1. Implement the Girvan-Newman Algorithm from scratch and detect communities in the given datasets.
  2. Devise an automated stopping criterion for the Girvan-Newman algorithm.
  3. Visualize the resulting dendrogram to determine an appropriate stopping criterion.
  4. Apply the Louvain algorithm for community detection and display the communities obtained after the first iteration.
  5. Identify the best decomposition of nodes into communities.
  6. Compare the running times of the Girvan-Newman and Louvain algorithms.
  7. Discuss which algorithm performs better and justify the evaluation.

Key Results

  • Girvan-Newman Algorithm:

    • Used edge betweenness centrality to iteratively remove edges.
    • Visualized communities using NetworkX and Matplotlib.
    • An automated stopping criterion was implemented to balance computation time and result quality.
    • Resulting dendrograms assisted in determining the number of communities.
  • Louvain Algorithm:

    • Maximized modularity to identify communities in the graph.
    • Demonstrated faster computation compared to the Girvan-Newman algorithm.
    • Provided robust and modularity-optimized community detection.
  • Comparison:

    • The Louvain algorithm outperformed the Girvan-Newman algorithm in efficiency, especially for larger datasets.
    • Girvan-Newman offered finer-grained community detection but was computationally expensive.

Contact

If you have any questions or suggestions, please feel free to reach out to me at nvarjunmani07@gmail.com.

About

This project implements the Girvan-Newman and Louvain algorithms from scratch for community detection in graphs, using datasets like Wiki-Vote and LastFM-Social. It includes automated stopping criteria, dendrogram visualization, and performance comparisons.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published