PageRank Centrality

Motivation

PageRank centrality measures the importance of a node by counting the number of incoming edges. Incoming edges are weighted by the number of outgoing edges of the source node, i.e., the importance of the referencing node is weighted with the number of nodes it is pointing to.

Definition

Given a directed graph with \(n\) nodes. The PageRank for node \(v_i\) is given by where \(L(v_j)\) is the outdegree of node \(n_j\), and \(N_{in}(v_i)\) is the set of neighbor vertices \(v_j\) pointing to \(v_i\). The damping factor \(d\) is commonly chosen to have the value \(d=0.85\).

Remarks

Algorithm

The PageRank centrality can be obtained by iteration. Let \(pr(i,k)\) be the value of the PageRank centrality of node \(i\) at iteration step \(k\). At \(k=0\) we set \[ pr(i,0) = \frac{1}{n} \] where \(n\) is the number of nodes. At each iteration, the PageRank is given by \[ pr(i,k+1) = \frac{1-d}{n} + d\sum_{j\in N_{in}(i)} \frac{pr(j,k)}{L(j)} \] where \(N_{in}(i)\) contain the indices of all neighbor nodes pointing to node \(i\), \(L(j)\) is the outdegree of node \(j\) and \(d\) is the damping factor. 



The JavaScript Code