首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >计算内聚块内聚图0.5.4

计算内聚块内聚图0.5.4
EN

Stack Overflow用户
提问于 2012-10-15 19:21:08
回答 1查看 376关注 0票数 0

在图表0.5.4中,是否有或多或少直接的方法来估计每个内聚块的内聚力(即cohesive.blocks()的结果)?

在实际版本(0.6)中有一个名为cohesion()的函数,但在版本0.5.x中没有。有没有更简单的方法来计算它,或者我应该只对每个块单独计算(手工!!)?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-15 20:41:36

这实际上在文档中,甚至在示例中也是如此:

代码语言:javascript
复制
g <- graph.disjoint.union(graph.full(4), graph.empty(2,directed=FALSE))
g <- add.edges(g,c(3,4,4,5,4,2))
g <- graph.disjoint.union(g,g,g)
g <- add.edges(g,c(0,6,1,7,0,12,4,0,4,1))

## Find cohesive blocks:
gBlocks <- cohesive.blocks(g)

## Examine block membership and cohesion:
gBlocks$blocks
# [[1]]
#  [1]  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17
# [[2]]
#  [1] 12 13 14 15 16
# [[3]]
#  [1]  0  1  2  3  4  6  7  8  9 10
# [[4]]
#  [1] 12 13 14 15
# [[5]]
#  [1] 0 1 2 3 4
# [[6]]
#  [1] 6 7 8 9

gBlocks$block.cohesion
# [1] 1 2 2 3 4 3
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12894549

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档