absorbing_centrality.compute_personalized_transition_matrix

compute_personalized_transition_matrix(G, alpha=0.85, restart_set=['_super_'])[source]

Returns the transition matrix of the random walk with restarts.

Parameters:
  • G (graph) –
  • alpha (float, optional) – The probability of the random surfer to continue their walk (default is 0.85).
  • restart_set (list, optional) – The set of nodes to restart from. If not supplied, the restarts lead to the supernode (default is [SUPER_NODE]).
Returns:

P – The probability matrix for the random walk with restarts.

Return type:

scipy.sparse.matrix