Arguments

The vertices for which the vertex betweenness estimation will be
calculated.

directed

Logical, whether directed paths should be considered while
determining the shortest paths.

cutoff

The maximum path length to consider when calculating the
betweenness. If zero or negative then there is no such limit.

weights

Optional positive weight vector for calculating weighted
betweenness. If the graph has a weight edge attribute, then this is
used by default. Weights are used to calculate weighted shortest paths,
so they are interpreted as distances.

nobigint

Logical scalar, whether to use big integers during the
calculation. This is only required for lattice-like graphs that have very
many shortest paths between a pair of vertices. If TRUE (the
default), then big integers are not used.

v

The vertices for which the vertex betweenness will be calculated.

normalized

Logical scalar, whether to normalize the betweenness
scores. If TRUE, then the results are normalized according to
$$B^n=\frac{2B}{n^2-3n+2}$$, where
\(B^n\) is the normalized, \(B\) the raw betweenness, and \(n\)
is the number of vertices in the graph.

estimate_betweenness only considers paths of length cutoff or
smaller, this can be run for larger graphs, as the running time is not
quadratic (if cutoff is small). If cutoff is zero or negative
then the function calculates the exact betweenness scores.

estimate_edge_betweenness is similar, but for edges.

For calculating the betweenness a similar algorithm to the one proposed by
Brandes (see References) is used.

Value

A numeric vector with the betweenness score for each vertex in
v for betweenness.

A numeric vector with the edge betweenness score for each edge in e
for edge_betweenness.

estimate_betweenness returns the estimated betweenness scores for
vertices in vids, estimate_edge_betweenness the estimated edge
betweenness score for all edges; both in a numeric vector.