networksns.centrality_measures.node_total_communicability¶
- networksns.centrality_measures.node_total_communicability(G, u, t=1, tol=1e-07, maxit=50)¶
Computes the node total communicability of node \(u\).
If node \(u\) is the \(i^{th}\) node of the graph, the node total communicability of \(u\) is given by \(\sum_{j=1}^n (e^{tA})_{ij}\), where \(A\) denotes the adjacency matrix of the graph [1].
- Parameters:
G (Graph object) – a graph.
u (node_id) – node in G.
t (scalar, optional) – when exponentiating multiply the adjacency matrix by t, default: 1.
tol (float,optional) – tolerance for convergence, relative accuracy, default: 1e-7.
maxit (integer, optional) – maximum number of Lanczos iterations, default: 50.
- Returns:
tc_u (float) node total communicability of \(u\).
Examples
>>> from networksns import centrality_measures as cm >>> import networkx as nx
Create graph \(G\).
>>> G = nx.Graph() >>> G.add_edge(1, 'u') >>> G.add_edge('u', 2) EdgeView([(1, 'u'), ('u', 2)])
Compute the node total communicability
>>> tc_u = cm.node_total_communicability(G, 'u')
References