-
Notifications
You must be signed in to change notification settings - Fork 0
/
timetest.py
63 lines (38 loc) · 1.05 KB
/
timetest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import time
import RicciDiffusion as RD
import networkx as nx
import numpy as np
from tqdm import tqdm
import evolution as evo
f = open("datatime_classic.txt","w")
for i in tqdm(range (2,500)):
G=nx.complete_graph(i)
vec=np.ones(i)
vec=evo.normalize(vec)
start=time.time()
evo.evolution(G,vec,10)
end=time.time()
f.write(f"{i}\t{round((end-start),5)}\n")
f.close()
f = open("datatime_ollivierricci.txt","w")
for i in tqdm(range (2,250)):
G=nx.complete_graph(i)
vec=np.ones(i)
vec=evo.normalize(vec)
start=time.time()
G=RD.preprocces_Ollivier(G)
RD.OllivierRicciEvolve_sign(G,vec,10)
end=time.time()
f.write(f"{i}\t{round((end-start),3)}\n")
f.close()
f = open("datatime_formanricci.txt","w")
for i in tqdm(range (2,500)):
G=nx.complete_graph(i)
vec=np.ones(i)
vec=evo.normalize(vec)
start=time.time()
G=RD.preprocces_Forman(G)
RD.FormanRicciEvolve_sign(G,vec,10)
end=time.time()
f.write(f"{i}\t{round((end-start),4)}\n")
f.close()