我正在尝试从我的图表中收集一些社区。然而,由此产生的社区由孤立的节点组成,这与我对社区的理解相矛盾。这是我必不可少的 R/igraph 代码:
g<-simplify(g)
print("isolates: ")
length(which(degree(g)==0)-1) # says 0
c<-fastgreedy.community(g)
cmem<-community.to.membership(g,c$merges,3081)
w<-which(cmem$membership==0)
sub<-subgraph(g,w)
print("isolates in subgraph: ")
length(which(degree(sub)==0)-1) # says > 0
我犯错了吗?谢谢您的帮助。