networksns.centrality_measures.receive_centrality

networksns.centrality_measures.receive_centrality(G, alpha=None, conj_grad_maxiter=100, conj_grad_tol=1e-07)

Computes the receive centrality of the dynamic graph \(G\).

Denoting with \(A_t\) the adjacency matrix at time \(t\) and with \(\mathbf{1}\) the vector of all ones receive centrality is \(rc = (I-\alpha A_k)^{-1}(I-\alpha A_{k-1})^{-1}...(I-\alpha A_1)^{-1} \mathbf{1}\) [1].

Recall that to ensure that each resolvent \((I-\alpha A_t)\) can be expressed as a power series in the matrix, the parameter \(\alpha\) must satisfy \(0<\alpha< \frac{1}{\rho^*}\), where \(\rho^* = \max_t \rho(A_t)\).

Parameters:
  • G (DynGraph object) – a dynamic graph.

  • alpha (float, optional) – parameter, if None computed to ensure that each resolvent can be expressed as a power series in the matrix. Default: None.

  • conj_grad_maxiter (integer) – Maximum number of iterations for solving \(Ax=b\) with conjugate gradient method. Iterations will stop after maxiter steps even if the specified tolerance has not been achieved, default: 100.

  • conj_grad_tol (float, optional) –

    Tolerance for solving \(Ax=b\) with conjugate gradient method.

    norm(residual) <= conj_grad_tol*norm(b) , default: 1e-7.

Returns:

  • rc (dict) – receive centrality.

  • alpha (float) – alpha parameter.

Examples

>>>  from networksns import centrality_measures as cm
>>>  import dynetx as dn

Create dynamic graph \(G\).

>>>    G = dn.DynGraph()
>>>    G.add_interaction(1, 2, 2, 5)
>>>    G.add_interaction(1, 3, 2, 5)
>>>    G.add_interaction(2, 3, 4)
        EdgeView([(1, 2), (1, 3), (2, 3)])

Compute receive centrality

>>>   rc, alpha = cm.receive_centrality(G)

References