absorbing_centrality.absorbing_centrality¶
-
absorbing_centrality
(G, team, query=None, P=None, epsilon=1e-05, max_iterations=None, with_restarts=False, alpha=0.85)[source]¶ Compute the absorbing centrality of a team. The algorithm works by iteratively computing the powers of the non-absorbing submatrix of the transition matrix P.
Parameters: - G (NetworkX graph) – The graph on which to compute the centrality.
- team (list) – The team of nodes, whose centrality to compute.
- query (list, optional) – The set of query nodes to use for the random walks. If None (default) or empty, the query set is equal to the set of all nodes in the graph.
- P (matrix, optional) – The precomputed transition matrix of the graph (default is None).
- epsilon (float, optional) – The iterative algorithm stops when the error between the centrality computed by two successive iterations falls below epsilon (default is 1e-5).
- max_iterations (int, optional) – The upper limit to the number of iteratios of the algorithm (default is None).
- with_restarts (bool, optional) – If True, restarts the random surfer to the the query set (default is False).
- alpha (float, optional) – The probability of the random surfer to continue (default is 0.85).
Returns: score – The absorbing centrality score.
Return type: Note
Both team and query should use the original node names.