networksns.centrality_measures.total_directed_communicability¶
- networksns.centrality_measures.total_directed_communicability(G, t=1)¶
Computes the total hub communicability and the total authority communicability of a directed graph \(G\).
Denoting with \(A\) the adjacency matrix of \(G\), with \(\mathcal{A}=\begin{pmatrix} 0 & A \\ A^T & 0 \end{pmatrix}\) the adjacency matrix of the associated undirected bipartite graph and with \(\mathbf{0}\) and \(\mathbf{1}\) the vectors of all zeros and ones respectively, total hub communicability and total authority communicability of \(G\) are defined as
\(T_{h}C(G) = \mathbf{1}^T\cosh{\left(\sqrt{A A^T}\right)}\mathbf{1} = \begin{pmatrix} \mathbf{1}^T & \mathbf{0}^T \end{pmatrix} e^{\mathcal{A}}\begin{pmatrix} \mathbf{1} \\ \mathbf{0} \end{pmatrix}\), \(T_{a}C(G) = \mathbf{1}^T\cosh{\left(\sqrt{A^T A}\right)}\mathbf{1} = \begin{pmatrix} \mathbf{0}^T & \mathbf{1}^T \end{pmatrix} e^{\mathcal{A}}\begin{pmatrix} \mathbf{0} \\ \mathbf{1} \end{pmatrix}\).
See [1] for further details.
- Parameters:
G (DiGraph object) – a directed graph.
t (scalar, optional) – when computing the total hub and authority communicabilities multiply the adjacency matrix by \(t\), default: 1.
- Returns:
thc (float) – total hub communicability.
trc (float) – total authority communicability.
Examples
>>> from networksns import centrality_measures as cm >>> import networkx as nx
Create graph \(G\).
>>> G = nx.DiGraph() >>> G.add_edge(1, 2) >>> G.add_edge(1, 3) >>> G.add_edge(2, 3) >>> G.add_edge(3, 1) OutEdgeView([(1, 2), (1, 3), (2, 3), (3, 1)])
Compute total hub communicability and total authority communicability.
>>> thc, tac = cm.total_directed_communicability(G)
References