Python 实现的PageRank算法,纯粹使用python原生模块,没有使用numpy、scipy。这个程序实现还比较原始,可优化的地方较多。...range(len(A)):
for j in range(len(A[0])):
result[i][j] = A[i][j]+B[i][j]
return result
def pageRank...norm > delt:
P = New_P
New_P = matrix_add(r,matrix_multiN(d,matrix_multi(A,P))) #P=(1-d)*e/n+d*M'P PageRank...1,0,0,1,0,0,1,1],\
[0,0,0,1,0,0,0,0],\
[0,0,1,0,0,0,0,0],\
[0,0,0,1,0,0,1,0]]
M = tran_and_convert(A)
pageRank