文章目录
社区发现
louvain
Community Detection with Louvain and Infomap
模块度取值范围: [ − 1 2 , 1 ) [-\frac{1}{2},1) [−21,1)
模块度也可以理解是社区内部边的权重减去所有与社区节点相连的边的权重和,对无向图更好理解,即社区内部边的度数减去社区内节点的总度数。
获取邻居是哪个社区的:
neighbour_communities:{邻居结点ID:权重}
当前结点属于哪个社区的(old_community),获取邻居结点中【也是这个社区】的权重
old_incident_weight = neighbour_communities.get(old_community, 0)
暂时删除当前结点
遍历【node】的邻居结点,得到邻居结点的【community, incident_wt(就是权重)】:
计算delta Q:
# Sum of the weights of the links incident to nodes in C.
sigma_tot = 这个community结点对应的度(对于带权图是权重的和)
# Sum of the weights of the links incident to node i.
k_i = node 的度
# Sum of the weights of the links from i to nodes in C.
k_i_in = incident_wt
# Sum of the weights of all the links in the network.
m = 网络权重和
Δ Q = ( 2 k i , i n − σ t o t × k i ) / m \Delta Q={(2k_{i,in}-\sigma_{tot}\times k_i)}/{m} ΔQ=(2ki,in−σtot×ki)/m
infomap
科学空间 - 最小熵原理(五):“层层递进”之社区发现与聚类
Infomap 的双层编码方式把群组识别(社区发现)同信息编码联系到了一起。一个好的群组划分,可以带来更短的编码。所以,如果能量化编码长度,找到使得长度最短的群组划分,那就找到了一个好的群组划分。
熵: “编码每个状态所需的平均字节长度”,信息量的期望
1 − τ 1-\tau 1−τ的概率做随机游走, τ \tau τ的概率随机选择图上任意一个结点跳转
(13)
(11)
(15)
GNN
GCN
重新分配权重:对角线越大,减缓低筒滤波效应,不容易聚合邻居信息