This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.



Return communicability between all pairs of nodes in G.

Communicability between pair of node (u,v) of node in G is the sum of closed walks of different lengths starting at node u and ending at node v.

Parameters:G (graph) –
Returns:comm – Dictionary of dictionaries keyed by nodes with communicability as the value.
Return type:dictionary of dictionaries
Raises:NetworkXError – If the graph is not undirected and simple.

See also

Communicability centrality for each node of G using matrix exponential.
Communicability centrality for each node in G using spectral decomposition.
Communicability between all pairs of nodes in G using spectral decomposition.


This algorithm uses matrix exponentiation of the adjacency matrix.

Let G=(V,E) be a simple undirected graph. Using the connection between the powers of the adjacency matrix and the number of walks in the graph, the communicability between nodes u and v is [1],

\[C(u,v) = (e^A)_{uv},\]

where \(A\) is the adjacency matrix of G.


[1]Ernesto Estrada, Naomichi Hatano, “Communicability in complex networks”, Phys. Rev. E 77, 036111 (2008). http://arxiv.org/abs/0707.0756


>>> G = nx.Graph([(0,1),(1,2),(1,5),(5,4),(2,4),(2,3),(4,3),(3,6)])
>>> c = nx.communicability_exp(G)