简体   繁体   English

igraph r估计大型网络的网络集中度度量需要多长时间

[英]how long does it take for igraph r to estimate network centrality measures for a large network

I have a network of 300000 nodes and 800000 edges. 我有300000个节点和800000个边的网络。 How long does it take for igraph package in R to calculate network centrality measures for each node (including closeness and betweenness). R中的igraph程序包需要多长时间才能计算每个节点的网络集中度(包括紧密度和中间度)。

The runtimes for betweenness and closeness are both quadratic, so increase substantially as the number of nodes increases. 相邻性和紧密性的运行时间都是二次的,因此随着节点数量的增加而大大增加。 These authors estimate 7,000 seconds to calculate betweenness for a graph with 325,000 edges. 这些作者估计需要7,000秒才能计算出具有325,000条边的图的中间性。 A graph with 800,000 edges will take much longer. 具有80万条边的图形将花费更长的时间。

igraph does have specific functions for large graphs - estimate_betweenness and estimate_closeness , which the manual says are not quadratic in runtime. igraph确实有大图特殊功能- estimate_betweennessestimate_closeness ,该手册上说是不能在运行二次。 You define a cutoff, which is the largest path length that will be included in the calculation. 您定义一个截止值,这是将包含在计算中的最大路径长度。 Traditionally, betweenness considers paths of any length. 传统上,中间性考虑任何长度的路径。 Defining a cutoff substantially cuts down the runtime: 定义一个截断将大大减少运行时间:

> lg <- erdos.renyi.game(300000,800000,type="gnm")
> ptm <- proc.time()
> igraph::estimate_betweenness(lg, cutoff = 3)[1:10]
 [1]  29  12  14  90  29  98  69  48 200  86
> proc.time() - ptm
   user  system elapsed 
 27.605   0.327  30.113 

~ 30 sec. 〜30秒 This is on a dual-core macbook air. 这是在双核Macbook播放机上。 As you increase the cutoff the runtime increases. 随着截止值的增加,运行时间也会增加。

The tradeoff, of course, is that you have what amounts to an estimate of each node's betweenness score, rather than a direct calculation. 当然,要权衡的是,您要对每个节点的中间度得分进行估算,而不是直接计算。


Reference: 参考:

Kang, U., Papadimitriou, S., Sun, J., & Tong, H. (2011, April). Kang,U.,Papadimitriou,S.,Sun,J.,&Tong,H.(2011年4月)。 Centralities in large networks: Algorithms and observations. 大型网络中的中心:算法和观察。 In Proceedings of the 2011 SIAM International Conference on Data Mining (pp. 119-130). 在2011年SIAM数据挖掘国际会议论文集(第119-130页)中。 Society for Industrial and Applied Mathematics. 工业和应用数学协会。 Link 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM