可视化R中的强连接组件

时间:2015-05-07 15:17:19

标签: r graph

我有一个带有三个强连通分量(SCC)的加权有向图。 SCC从igraph::clusters函数

获得
library(igraph)
SCC<- clusters(graph, mode="strong")  
SCC$membership
 [1] 9 2 7 7 8 2 6 2 2 5 2 2 2 2 2 1 2 4 2 2 2 3 2 2 2 2 2 2 2 2
SCC$csize
[1]  1 21  1  1  1  1  2  1  1
 SCC$no
[1] 9

我想用圆圈和彩色背景可视化SCC,如下图所示,有没有办法在R中做到这一点?谢谢!

enter image description here

1 个答案:

答案 0 :(得分:9)

查看mark.groups的{​​{1}}参数。像下面这样的东西可以解决这个问题:

plot.igraph

Imgur