igraph radius and diameter

怎甘沉沦 提交于 2019-12-13 04:48:21

问题


I'm having a strange problem with igraph functions

I have an undirected graph(N=423) with very high density (0.4). In order to test the values I'm getting from igraph I'm using Gephi.

I've checked with Gephi, and they both report degree and diameter the same but igraph reports radius and eccentricity completely wrong, much higher values that they should be. Also, radius is always smaller than diameter right? And here it is larger :)

> sg <- simplify(graph.edgelist(edges, directed=F))
> radius(sg)
[1] 8
> diameter(sg)
[1] 3
head(eccentricity(sg))
[1] 10 11 10 12 11 14
> str(sg)
IGRAPH U--- 423 41064 -- 
+ edges:
1 --   3   4   6   8   9  15  25  26  28  30  37  38  41  42  47  48  49  50  53  58  63  66  68  69  71  72  76  81  83  87  88  90  95
....etc...
....etc...

Gephies eccentricity values are all 2s and 3s which is expected since diameter is 3 :)

I can not understand what I'm doing wrong.


回答1:


Seems to be a bug in the eccentricity routine (radius just calls eccentricity so the two issues are likely to be related). As a workaround, you can use shortest.paths (which seems to be working correctly) and then take the row-wise maximum to get the eccentricity scores. The radius is just the minimum eccentricity.

Update: you can follow the progress of the bug report here.



来源:https://stackoverflow.com/questions/13466530/igraph-radius-and-diameter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!