betweenness_centrality#
- betweenness_centrality(domain, network_name='default_network', edge_weight_name=None, seed=None, add_as_label_to_objects=True, new_label_name='betweenness centrality', label_cmap='plasma')#
Computes the betweenness centrality of each node using the networkx implementation.
The betweenness centrality of a node is the sum of the fraction of all shortest paths that pass through that node. Centrality values will be added as object labels if add_as_label_to_objects is True.
- Parameters:
- domainobject
The domain containing the network.
- network_namestr, optional
The name of the network, by default ‘default_network’.
- edge_weight_namestr or None, optional
The name of the edge weight attribute, by default None.
- seedint or None, optional
Seed for random number generator, by default None.
- add_as_label_to_objectsbool, optional
If True, adds centrality values as labels to objects, by default True.
- new_label_namestr, optional
The name for the new label, by default ‘betweenness centrality’.
- label_cmapstr, optional
The colormap to use for labels, by default ‘plasma’.
- Returns:
- dict
A dictionary of nodes with betweenness centrality as the value.
- Raises:
- ValueError
If the network name is not in the list of generated networks.
- ValueError
If the edge weight name is not in the list of edge weights for the network.