def PersonalRank(G,alpha,root):
    rank = {x:0 for x in G.keys()}
    rank[root] = 1
    for k in range(20):
        tmp = {x:0 for x in G.keys()}
        for i,ri in G.items():
            for j,wij in ri.items():
                if j not in tmp:
                    tmp[j] = 0
                tmp[j] += 0.6 * rank[i] / (1.0*len(ri))
                if j == root:
                    tmp[j] += 1 - alpha
        rank = tmp
    return rank
b1cc0ddf57b92cf88d16424e1777352f1a5d1166
<mask token>

def PersonalRank(G, alpha, root):
    rank = {x: (0) for x in G.keys()}
    rank[root] = 1
    for k in range(20):
        tmp = {x: (0) for x in G.keys()}
        for i, ri in G.items():
            for j, wij in ri.items():
                if j not in tmp:
                    tmp[j] = 0
                tmp[j] += 0.6 * rank[i] / (1.0 * len(ri))
                if j == root:
                    tmp[j] += 1 - alpha
        rank = tmp
    return rank

def PersonalRank(G,alpha,root):
    rank = {x:0 for x in G.keys()}
    rank[root] = 1
    for k in range(20):
        tmp = {x:0 for x in G.keys()}
        for i,ri in G.items():
            for j,wij in ri.items():
                if j not in tmp:
                    tmp[j] = 0
                tmp[j] += 0.6 * rank[i] / (1.0*len(ri))
                if j == root:
                    tmp[j] += 1 - alpha
        rank = tmp
    return rank