Hi all,
I am trying to compute the row-normalized adjacency matrix P which appears inside the Google matrix (that whose leading eigenvector is the PageRank centrality). In order to do so, one option is to use nx.google_matrix(G, alpha = 1) . However if the graph is big (tens of millions of nodes) this becomes undoable.
Another option is computing P by hand: taking the scipy sparse version of the adjacency matrix of G, and applying some scipy operations on it. This is efficient and works for huge networks, BUT this can't handle the issue of dangling nodes (those with no outlinks), it just leaves the null rows like that. So unless the graph has no dangling nodes, this is not ideal.
I can only think of perhaps manually adding the links from the dangling nodes to other nodes of the network before applying this second method, but it seems a lot of work and a loss of efficiency for something not that complicated (in principle).
Thank you in advance,
Gonzalo