-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtime_test.py
113 lines (84 loc) · 3.95 KB
/
runtime_test.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
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
import time
import sys
from random_points_generator import Random
from mbr import Mbr
from convexhull import Graham
sys.setrecursionlimit(100_000_000)
points_n_100 = Random.generate_uniform_points(n = 100)
points_n_1_000 = Random.generate_uniform_points(n = 1_000)
points_n_10_000 = Random.generate_uniform_points(n = 10_000)
points_n_100_000 = Random.generate_uniform_points(n = 100_000)
points_n_1_000_000 = Random.generate_uniform_points(n = 1_000_000)
start = time.time()
Mbr.smallest_rectangle(points_n_100, compare=Mbr.compare_area)
print("Random uniform dla n = 100: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_n_1_000, compare=Mbr.compare_area)
print("Random uniform dla n = 1_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_n_10_000, compare=Mbr.compare_area)
print("Random uniform dla n = 10_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_n_100_000, compare=Mbr.compare_area)
print("Random uniform dla n = 100_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_n_1_000_000, compare=Mbr.compare_area)
print("Random uniform dla n = 1_000_000: ", time.time() - start)
points_circle_n_100 = Random.generate_circle_points(n = 100)
points_circle_n_1_000 = Random.generate_circle_points(n = 1_000)
points_circle_n_10_000 = Random.generate_circle_points(n = 10_000)
points_circle_n_100_000 = Random.generate_circle_points(n = 100_000)
points_circle_n_1_000_000 = Random.generate_circle_points(n = 1_000_000)
start = time.time()
Graham.graham_algorithm(points_circle_n_100)
print("Graham dla n = 50: ", time.time() - start)
start = time.time()
Graham.graham_algorithm(points_circle_n_1_000)
print("Graham dla n = 1_000: ", time.time() - start)
0
start = time.time()
Graham.graham_algorithm(points_circle_n_10_000)
print("Graham dla n = 10_000: ", time.time() - start)
start = time.time()
Graham.graham_algorithm(points_circle_n_100_000)
print("Graham dla n = 100_000: ", time.time() - start)
start = time.time()
Graham.graham_algorithm(points_circle_n_1_000_000)
print("Graham dla n = 1_000_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_circle_n_100, compare=Mbr.compare_area)
print("Circle dla n = 100: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_circle_n_1_000, compare=Mbr.compare_area)
print("Circle dla n = 1_000: ", time.time() - start)
0
start = time.time()
Mbr.smallest_rectangle(points_circle_n_10_000, compare=Mbr.compare_area)
print("Circle dla n = 10_000: ", time.time() - start)
#start = time.time()
#Mbr.smallest_rectangle(points_circle_n_100_000, compare=Mbr.compare_area)
#print("Circle dla n = 100_000: ", time.time() - start)
#start = time.time()
#Mbr.smallest_rectangle(points_circle_n_1_000_000, compare=Mbr.compare_area)
#print("Circle dla n = 1_000_000: ", time.time() - start)
points_rectangle_n_100 = Random.generate_rectangle_points(n = 100)
points_rectangle_n_1_000 = Random.generate_rectangle_points(n = 1_000)
points_rectangle_n_10_000 = Random.generate_rectangle_points(n = 10_000)
points_rectangle_n_100_000 = Random.generate_rectangle_points(n = 100_000)
points_rectangle_n_1_000_000 = Random.generate_rectangle_points(n = 1_000_000)
start = time.time()
Mbr.smallest_rectangle(points_rectangle_n_100, compare=Mbr.compare_area)
print("Rectangle dla n = 50: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_rectangle_n_1_000, compare=Mbr.compare_area)
print("Rectangle dla n = 1_000: ", time.time() - start)
0
start = time.time()
Mbr.smallest_rectangle(points_rectangle_n_10_000, compare=Mbr.compare_area)
print("Rectangle dla n = 10_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_rectangle_n_100_000, compare=Mbr.compare_area)
print("Rectangle dla n = 100_000: ", time.time() - start)
start = time.time()
Mbr.smallest_rectangle(points_rectangle_n_1_000_000, compare=Mbr.compare_area)
print("Rectangle dla n = 1_000_000: ", time.time() - start)