networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
communicability_betweenness_centrality(G)

Communicability betweenness measure makes use of the number of walks connecting every pair of nodes as the basis of a betweenness centrality measure.

Notes

Let :None:None:`G=(V,E)` be a simple undirected graph with n nodes and :None:None:`m` edges, and :None:None:`A` denote the adjacency matrix of G.

Let :None:None:`G(r)=(V,E(r))` be the graph resulting from removing all edges connected to node r but not the node itself.

The adjacency matrix for :None:None:`G(r)` is :None:None:`A+E(r)`, where :None:None:`E(r)` has nonzeros only in row and column r.

The subraph betweenness of a node r is

$$\omega_{r} = \frac{1}{C}\sum_{p}\sum_{q}\frac{G_{prq}}{G_{pq}}, p\neq q, q\neq r,$$

where :None:None:`G_{prq}=(e^{A}_{pq} - (e^{A+E(r)})_{pq}` is the number of walks involving node r, :None:None:`G_{pq}=(e^{A})_{pq}` is the number of closed walks starting at node p and ending at node q , and :None:None:`C=(n-1)^{2}-(n-1)` is a normalization factor equal to the number of terms in the sum.

The resulting :None:None:`\omega_{r}` takes values between zero and one. The lower bound cannot be attained for a connected graph, and the upper bound is attained in the star graph.

Parameters

G: graph :

Raises

NetworkXError

If the graph is not undirected and simple.

Returns

nodes : dictionary

Dictionary of nodes with communicability betweenness as the value.

Returns subgraph communicability for all pairs of nodes in G.

Examples

>>> G = nx.Graph([(0, 1), (1, 2), (1, 5), (5, 4), (2, 4), (2, 3), (4, 3), (3, 6)])
... cbc = nx.communicability_betweenness_centrality(G)
... print([f"{node} {cbc[node]:0.2f}" for node in sorted(cbc)]) ['0 0.03', '1 0.45', '2 0.51', '3 0.45', '4 0.40', '5 0.19', '6 0.03']
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.communicability_alg.communicability_exp networkx.algorithms.centrality.subgraph_alg.communicability_betweenness_centrality networkx.algorithms.communicability_alg.communicability

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/centrality/subgraph_alg.py#189
type: <class 'function'>
Commit: