From 27c055193dc70f5629b4f37783f3f1c2034f56b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Jul 2020 12:03:08 +0700 Subject: [PATCH] Update algorithm --- pagerank.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagerank.py b/pagerank.py index 3493821..f555762 100644 --- a/pagerank.py +++ b/pagerank.py @@ -3,13 +3,13 @@ import pandas as pd import matplotlib.pyplot as plt if __name__ == '__main__': - data = pd.read_csv('./data/testmini.txt', sep=" ", header=None, skiprows=4) + data = pd.read_csv('./data/web-Stanford.txt', sep="\t", header=None, skiprows=4) G = nx.DiGraph() for i in range(len(data)): G.add_node(data.iloc[i][0]) G.add_node(data.iloc[i][1]) G.add_edge(data.iloc[i][0], data.iloc[i][1]) - + # pr = nx.pagerank(G, alpha=0.85) N = len(G) d = 0.9 rank = {}