如果您从 R 中使用 igraph,请使用此选项
estimate_betweenness {igraph} | R 文档 |
顶点和边的介数(大致)由通过顶点或边的测地线(最短路径)的数量定义。
estimate_betweenness(
graph,
vids = V(graph),
directed = TRUE,
cutoff,
weights = NULL,
nobigint = TRUE
)
betweenness(
graph,
v = V(graph),
directed = TRUE,
weights = NULL,
nobigint = TRUE,
normalized = FALSE,
cutoff = -1
)
edge_betweenness(
graph,
e = E(graph),
directed = TRUE,
weights = NULL,
cutoff = -1
)
图 |
要分析的图。 |
vids |
将计算顶点介数估计值的顶点。 |
有向 |
逻辑值,在确定最短路径时是否应考虑有向路径。 |
cutoff |
计算介数时要考虑的最大路径长度。 如果为零或负数,则没有此类限制。 |
weights |
用于计算加权介数的可选正权重向量。 如果图具有 |
nobigint |
逻辑标量,指示在计算期间是否使用大整数。 自 igraph 1.3 起已弃用,将在 igraph 1.4 中删除。 |
v |
将计算顶点介数的顶点。 |
normalized |
逻辑标量,指示是否标准化介数分数。 如果为
其中 |
e |
将计算边介数的边。 |
顶点 v
的顶点介数定义为
\sum_{i\ne j, i\ne v, j\ne v} g_{ivj}/g_{ij}
边 e
的边介数定义为
\sum_{i\ne j} g_{iej}/g_{ij}.
betweenness
计算顶点介数,edge_betweenness
计算边介数。
此处 g_{ij}
是顶点 i
和 j
之间最短路径的总数,而 g_{ivj}
是通过顶点 v
的那些最短路径的数量。
这两个函数都允许您仅考虑长度为 cutoff
或更小的路径;这可以在更大的图上运行,因为运行时间不是二次方的(如果 cutoff
很小)。 如果 cutoff
为零或负数,则该函数计算精确的介数分数。 使用零作为截止值是已弃用,并且未来的版本(从 1.4.0 开始)将按字面意义处理零截止值(即根本不考虑任何路径)。 如果您不希望截止值,请使用负数。
estimate_betweenness
和 estimate_edge_betweenness
是 betweenness
和 edge_betweenness
的别名,具有不同的参数顺序,为了与旧版本的 igraph 兼容。
对于计算介数,使用类似于 Brandes 提出的算法(参见参考)。
对于 betweenness
,这是一个数值向量,其中包含 v
中每个顶点的介数分数。
对于 edge_betweenness
,这是一个数值向量,其中包含 e
中每个边的边介数分数。
对于具有多个边的图,edge_betweenness
可能会给出错误的值。
Gabor Csardi csardi.gabor@gmail.com
Freeman, L.C. (1979). Centrality in Social Networks I: Conceptual Clarification. Social Networks, 1, 215-239.
Ulrik Brandes, A Faster Algorithm for Betweenness Centrality. Journal of Mathematical Sociology 25(2):163-177, 2001.
closeness
, degree
, harmonic_centrality
g <- sample_gnp(10, 3/10)
betweenness(g)
edge_betweenness(g)