cdlib.algorithms.dpclus¶
- cdlib.algorithms.dpclus(g_original: object, weights: str | None = None, d_threshold: float = 0.9, cp_threshold: float = 0.5, overlap: bool = True) NodeClustering ¶
DPClus projects weights onto an unweighted graph using a common neighbors approach. In DPClus, the weight of an edge (u, v) is defined as the number of common neighbors between u and v. Similarly, the weight of a vertex is its weighted degree – the sum of all edges connected to the vertex-
DPClus does not natively generate overlapping clusters but does allow for overlapping cluster nodes to be added in a post-processing step.
Supported Graph Types
Undirected
Directed
Weighted
Yes
No
Yes
- Parameters:
g_original – a networkx/igraph object
weights – label used for the edge weights. Default, None.
d_threshold – cluster density threshold, default 0.9
cp_threshold – cluster property threshold, default 0.5
overlap – wheter to output overlapping or crisp communities. Default, True.
- Returns:
NodeClustering object
- Example:
>>> from cdlib import algorithms >>> import networkx as nx >>> G = nx.karate_club_graph() >>> coms = algorithms.dpclus(G)
- References:
Altaf-Ul-Amin, M., Shinbo, Y., Mihara, K., Kurokawa, K., Kanaya, S. 2006. Development and implementation of an algorithm for detection of protein complexes in large interaction networks. BMC Bioinformatics 7, 207.
Note
Reference Implementation: https://github.com/trueprice/python-graph-clustering