head_tail(g_original: object, head_tail_ratio: float = 0.4) → cdlib.classes.node_clustering.NodeClustering

Identifying homogeneous communities in complex networks by applying head/tail breaks on edge betweenness given its heavy-tailed distribution.

Note: this implementation is suited for small-medium sized graphs, and it may take couple of minutes or longer for a bigger graph.

Supported Graph Types

Undirected Directed Weighted
Yes No No
  • g_original – a networkx/igraph object
  • head_tail_ratio – head/tail division rule. Float in [0,1], dafault 0.4.

NodeClustering object

>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.head_tail(G, head_tail_ratio=0.8)

Jiang B. and Ding M. (2015), Defining least community as a homogeneous group in complex networks, Physica A, 428, 154-160.