cdlib.algorithms.agdl¶
-
agdl
(g_original, number_communities, number_neighbors, kc, a)¶ AGDL is a graph-based agglomerative algorithm, for clustering high-dimensional data. The algorithm uses the indegree and outdegree to characterize the affinity between two clusters.
Parameters: - g_original – a networkx/igraph object
- number_communities – number of communities
- number_neighbors – Number of neighbors to use for KNN
- kc – size of the neighbor set for each cluster
- a – range(-infinity;+infinty). From the authors: a=np.arange(-2,2.1,0.5)
Returns: NodeClustering object
Example: >>> from cdlib import algorithms >>> import networkx as nx >>> G = nx.karate_club_graph() >>> com = algorithms.agdl(g, number_communities=3, number_neighbors=3, kc=4, a=1)
References: Zhang, W., Wang, X., Zhao, D., & Tang, X. (2012, October). Graph degree linkage: Agglomerative clustering on a directed graph. In European Conference on Computer Vision (pp. 428-441). Springer, Berlin, Heidelberg.
Note
Reference implementation: https://github.com/myungjoon/GDL