社区算法 - 调整断开连接节点的Q值

时间:2015-06-30 14:23:46

标签: igraph

当使用fastgreedy.community时,一般的观察是Q值随着节点断开而增加(即,通过移除边缘并创建断开的节点)。是否有任何标准方法可根据节点的断开连接计算调整后的Q值?我问,因为我们在添加/删除边缘时尝试使用Q值作为度量来优化基于模块性的网络。

以下是一个例子:

subgraph <- erdos.renyi.game(100, 10/100)

E(subgraph)$weight <- runif(ecount(subgraph))
comm <- fastgreedy.community(subgraph); Q.value <- modularity(subgraph,      comm$membership); print(Q.value)

ordered.edges <- sort(E(subgraph)$weight)
n.edges  <- ecount(subgraph)
q.df <- NULL
index <- 1

for(w.threhold in ordered.edges){

  subgraph.sub <- delete.edges(subgraph, which(E(subgraph)$weight <= w.threhold))

  comm <- fastgreedy.community(subgraph.sub)
  Q.value <- modularity(subgraph.sub, comm$membership)
  q.df <- rbind(q.df,data.frame(index=index, Q=Q.value, weight=w.threhold))

  index <- index + 1
}

plot(q.df$index , q.df$Q)

enter image description here

0 个答案:

没有答案
相关问题