Algorithm - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

PageRank weighted algorithm implementation:

\[PR(A) = (1 - \alpha) + \alpha (\frac{PR(B)}{Out(B)}+\frac{PR(C)}{Out(C)}+\frac{PR(D)}{Out(D)}+...)\]

\(A, B, C ,D...\) are different vertex. \(PR\) is the pagerank value of vertex, \(Out\) represents the out degree of vertex and \(\alpha\) is the damping factor, normally equals to 0.85

The algorithm’s pseudocode is as follows

for each edge (u, v) in graph   // calculate du degree
    degree(v) += weight(v)

for each node u in graph    // initiate DDR
    const(u) := alpha / degree(u)
    PR_old(u) := 1.0

while norm(PR_old - PR_new) > tolerance   // iterative add
    for each vertex u in graph
        PR_new(u) := 1 - alpha
        for each vertex v point to u
            PR_new(u) += const(v)*PR_old(v)*weight(v)

sum := 0
for each node u in graph  // calculate sum of vector PR
    sum += PR_new(u)

for each node u in graph  // normalization of order 1
    PR_new(u) := PR_new(u) / sum

return PR_new