-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute_onbra.jl
109 lines (105 loc) · 3.52 KB
/
compute_onbra.jl
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
include("src/MANTRA.jl")
path = "graphs/"
function print_samplig_stats(epsilon,delta,trials,ss)
println(" ε = "*string(epsilon)*" δ = "*string(delta)*" #trials = "*string(trials)*" starting sample size/ub sample size "*string(ss))
flush(stdout)
end
#= test
datasets = ["00_workplace.txt"]
epsilon_list = [0.1,0.07]
sample_list = [100,350]
=#
datasets = [
"01_college_msg.txt",
"02_digg_reply.txt",
"03_slashdot_reply.txt",
"04_facebook_wall.txt",
"05_topology.txt",
"06_bordeaux.txt",
"07_mathoverflow.txt",
"08_SMS.txt",
"09_askubuntu.txt",
"10_superuser.txt",
"11_wiki_talk.txt"
]
epsilon_list = [0.1,0.07,0.05,0.01,0.007,0.005,0.001]
sample_list = [100,350,750,1000,1350,1500,2000]
delta = 0.1
trials = 10
global big_int = false
geo = 1.2
algo = "ob"
vc_upperbound = true
println("Computing absolute (ε,δ)-Approximation of the (*)-temporal betweenness using ONBRA")
println("Suggestion : Go and grab a coffee ;)")
flush(stdout)
println("Computing (ε,δ)-Approximation for the prefix-foremost temporal betweenness")
flush(stdout)
topt = "pfm"
for i in 1:lastindex(epsilon_list)
epsilon = epsilon_list[i]
starting_ss = sample_list[i]
for gn in datasets
nn = String(split(gn, ".t")[1])
tg = load_temporal_graph(path*gn," ")
print_samplig_stats(epsilon,delta,trials,starting_ss)
print_stats(tg, graph_name= gn)
println("Running Progressive ONBRA")
flush(stdout)
for i in 1:trials
result = progressive_bernstein(tg,epsilon,delta,geo, big_int,algo,topt,vc_upperbound)
save_results_progressive_sampling(nn,"b_"*algo*"_"*topt,result[1],result[2][end],result[4],starting_ss,result[3])
clean_gc()
end
end
end
println("Computing (ε,δ)-Approximation for the shortest temporal betweenness")
flush(stdout)
topt = "sh"
for i in 1:lastindex(epsilon_list)
epsilon = epsilon_list[i]
starting_ss = sample_list[i]
for gn in datasets
nn = String(split(gn, ".t")[1])
tg = load_temporal_graph(path*gn," ")
if gn == "06_bordeaux.txt"
global big_int = true
else
global big_int = false
end
print_samplig_stats(epsilon,delta,trials,starting_ss)
print_stats(tg, graph_name= gn)
println("Running Progressive ONBRA")
flush(stdout)
for i in 1:trials
result = progressive_bernstein(tg,epsilon,delta,geo, big_int,algo,topt,vc_upperbound)
save_results_progressive_sampling(nn,"b_"*algo*"_"*topt,result[1],result[2][end],result[4],starting_ss,result[3])
clean_gc()
end
end
end
println("Computing (ε,δ)-Approximation for the shortest-foremost temporal betweenness")
flush(stdout)
topt = "sfm"
for i in 1:lastindex(epsilon_list)
epsilon = epsilon_list[i]
starting_ss = sample_list[i]
for gn in datasets
nn = String(split(gn, ".t")[1])
tg = load_temporal_graph(path*gn," ")
if gn == "06_bordeaux.txt"
global big_int = true
else
global big_int = false
end
print_samplig_stats(epsilon,delta,trials,starting_ss)
print_stats(tg, graph_name= gn)
println("Running Progressive ONBRA")
flush(stdout)
for i in 1:trials
result = progressive_bernstein(tg,epsilon,delta,geo, big_int,algo,topt,vc_upperbound)
save_results_progressive_sampling(nn,"b_"*algo*"_"*topt,result[1],result[2][end],result[4],starting_ss,result[3])
clean_gc()
end
end
end