mod_r(g_original: object, query_node: object) → cdlib.classes.node_clustering.NodeClustering¶
Community Discovery algorithm that infers the hierarchy of communities that enclose a given vertex by exploring the graph one vertex at a time.
Supported Graph Types
Undirected Directed Weighted Yes No No Parameters:
- g_original – a networkx/igraph object
- query_node – Id of the network node whose local community is queried.
>>> from cdlib import algorithms >>> import networkx as nx >>> G = nx.karate_club_graph() >>> coms = algorithms.mod_r(G, 1)
Clauset, Aaron. “Finding local community structure in networks.” Physical review E 72.2 (2005): 026132.
Reference implementation: https://github.com/mahdi-zafarmand/LSWL