R igraph 手册页

如果您从 R 中使用 igraph,请使用此选项

gsize {igraph}R 文档

图的大小(边的数量)

描述

ecount 是此函数的别名。

用法

gsize(graph)

参数

图。

数值标量,边的数量。

参见

其他结构查询: [.igraph(), [[.igraph(), adjacent_vertices(), are_adjacent(), ends(), get.edge.ids(), gorder(), head_of(), incident_edges(), incident(), is_directed(), neighbors(), tail_of()

示例

g <- sample_gnp(100, 2/100)
gsize(g)
ecount(g)

# Number of edges in a G(n,p) graph
replicate(100, sample_gnp(10, 1/2), simplify = FALSE) %>%
  vapply(gsize, 0) %>%
  hist()

[包 igraph 版本 1.3.5 索引]