-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
63 lines (51 loc) · 1.55 KB
/
main.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
from numpy import number
from networks import erdos_renyi, rw, draw, sub_graph, comparison_graph, run_multiple_runners, plt, random, watts_strogatz
from dimensionator.generators import DataGen, DDDRandomWalk, figures_to_html
import plotly.express as px
def main():
# my_data = DataGen(num_points=500_000)
# my_data.generate()
# my_data.explore()
dims = [49, 499, 999, 1499]
dims = [1499]
times = 100
for dim in dims:
print(dim)
shape = dim
curr = []
my_cube = DDDRandomWalk(shape, shape, shape)
my_cube.walk()
# # for step in range(times):
# # print(step)
# curr.append(my_cube.walk(unique_path=True))
# # fig = px.histogram(x=curr)
# # fig.update_layout(font_size=20)
# # fig.show()
def networks():
G = erdos_renyi(50, 0.2, directed=True)
# G = watts_strogatz(50, 30, 0.5)
#draw(G)
# plt.show()
# running single walker
# length_of_walk = 100
# # random walk will start at 0
# start = random.randrange(0, G.number_of_nodes())
# visited = rw(G, length_of_walk, start)
# draw(G)
# plt.show()
# H = sub_graph(G, visited)
# draw(H)
# plt.show()
# comparison_graph(G, H, 1)
# running more than one walker
number_of_runners = 3
visited = run_multiple_runners(G, number_of_runners, walk_length=50)
H = sub_graph(G, visited)
draw(G)
plt.show()
draw(H)
plt.show()
comparison_graph(G, H, number_of_runners)
if __name__ == '__main__':
main()
# networks()