This commit is contained in:
unknown 2020-07-15 09:11:26 +07:00
parent 44b1495b4c
commit 680a27c4ec
3 changed files with 88236 additions and 3 deletions

88234
data/facebook_combined.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ import pandas as pd
import matplotlib.pyplot as plt
if __name__ == '__main__':
data = pd.read_csv('./data/web-Stanford.txt', sep="\t", header=None, skiprows=4)
data = pd.read_csv('./data/testmini.txt', sep=" ", header=None, skiprows=4)
G = nx.DiGraph()
for i in range(len(data)):
G.add_node(data.iloc[i][0])

View File

@ -2,12 +2,11 @@ import networkx as nx
import pandas as pd
if __name__ == '__main__':
data = pd.read_csv('./data/web-Stanford.txt', sep="\t", header=None, skiprows=4)
data = pd.read_csv('./data/testmini.txt', sep=" ", 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.9)
print(pr)