cdlib.algorithms.ga¶
-
ga
(g_original, population=300, generation=30, r=1.5)¶ Genetic based approach to discover communities in social networks. GA optimizes a simple but efficacious fitness function able to identify densely connected groups of nodes with sparse connections between groups.
Parameters: - g_original – a networkx/igraph object
- population –
- generation –
- r –
Returns: NodeClustering object
Example: >>> from cdlib import algorithms >>> import networkx as nx >>> G = nx.karate_club_graph() >>> coms = algorithms.ga(G)
References: Pizzuti, C. (2008). Ga-net: A genetic algorithm for community detection in social networks. In Inter conf on parallel problem solving from nature, pages 1081–1090.Springer. Note
Reference implementation: https://github.com/hariswb/ga-community-detection