gsize: The size of the graph (number of edges)

View source: R/interface.R

gsizeR Documentation

The size of the graph (number of edges)

Description

ecount() and gsize() are aliases.

Usage

gsize(graph)

ecount(graph)

Arguments

graph

The graph.

Value

Numeric scalar, the number of edges.

See Also

Other structural queries: [.igraph(), [[.igraph(), adjacent_vertices(), are_adjacent(), ends(), get_edge_ids(), gorder(), head_of(), incident(), incident_edges(), is_directed(), neighbors(), tail_of()

Examples

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 documentation built on Oct. 20, 2024, 1:06 a.m.