centrality_betweenness

Computes weighted or unweighted betweenness centrality and stores the results as attributes on the graph.

sasviya.network.algorithms.centralities.centrality_betweenness(g, edge_weight=None, sample_percent=100, *, inplace=False, data=True)

Parameters

g : SAS graph object

Specifies the input graph to assess.

edge_weight : str or None, optional

Specifies the numeric edge attribute that corresponds to the edge weight. The default is None, which means that unweighted betweenness centrality is computed.

sample_percent : int, optional

Specifies the percentage of source nodes to sample for the approximate betweenness calculation. This parameter value should be in the range (0, 100]. The default is 100.

inplace : bool, optional

Specifies whether to add the centrality values as attributes to the input graph directly or to create a copy of the graph. The default is False.

data : bool, optional

Specifies whether or not to retain attributes. When the value is True and the inplace parameter value is False (default values), the node and edge attributes of the graph are retained. This parameter has no effect when the inplace parameter is set to True.

Returns

SAS graph object or None

Returns a graph that contains the node and edge attributes between_*. This graph has the solution_summary attribute, which contains information about the results of the algorithm.

Last updated: July 28, 2026