cdlib.algorithms.lpam

cdlib.algorithms.lpam(g_original: object, k: int = 2, threshold: float = 0.5, distance: str = 'amp', seed: int = 0) NodeClustering

围绕中心点的链接分区

支持的图表类型

无向

有向

加权

是的

Parameters:
  • g_original – 一个 networkx/igraph 对象

  • k – 聚类数量

  • threshold – 合并阈值在 [0,1] 范围内,默认值为 0.5

  • distance – 距离类型: “amp” - 放大通勤距离, 或 “cm” - 通勤距离, 或所有边之间的距离矩阵作为 np ndarray

  • seed – k-medoid启发式算法的随机种子

Returns:

节点聚类对象

Example:

>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.lpam(G, k=2, threshold=0.4, distance = "amp")
References:

亚历山大·波诺马连科,莱昂尼达斯·皮索利斯,马拉特·沙姆谢季诺夫。 “围绕中心点的链接分区”。 https://arxiv.org/abs/1907.08731