Skip to content

Releases: DmitryBakin/AlgStr

Отчет по побитовой сортировке

Choose a tag to compare

@DmitryBakin DmitryBakin released this 03 Dec 17:57

Running time of the bitwise sort(border = 10, size = 10000) = 0.00166667
Running time of the bitwise sort(border = 10, size = 100000) = 0.02
Running time of the bitwise sort(border = 10, size = 1000000) = 0.127667

Running time of the bitwise sort(border = 1000, size = 10000) = 0.003
Running time of the bitwise sort(border = 1000, size = 100000) = 0.0273333
Running time of the bitwise sort(border = 1000, size = 1000000) = 0.340333

Running time of the bitwise sort(border = 100000, size = 10000) = 0.00433333
Running time of the bitwise sort(border = 100000, size = 100000) = 0.0516667
Running time of the bitwise sort(border = 100000, size = 1000000) = 0.779667

Отчет по сортировке Хоара

Choose a tag to compare

@DmitryBakin DmitryBakin released this 25 Nov 04:16

Running time of the hoare sort(border = 10, size = 10000) = 0.00333333
Running time of the hoare sort(border = 10, size = 100000) = 0.08
Running time of the hoare sort(border = 10, size = 1000000) = 0.492

Running time of the hoare sort(border = 1000, size = 10000) = 0.00666667
Running time of the hoare sort(border = 1000, size = 100000) = 0.0406667
Running time of the hoare sort(border = 1000, size = 1000000) = 0.510667

Running time of the hoare sort(border = 100000, size = 10000) = 0.00333333
Running time of the hoare sort(border = 100000, size = 100000) = 0.044
Running time of the hoare sort(border = 100000, size = 1000000) = 0.602667

Отчет по пирамидальной сортировке

Choose a tag to compare

@DmitryBakin DmitryBakin released this 10 Nov 18:58

Running time of the pyramid sort(border = 10, size = 10000) = 0.00533333
Running time of the pyramid sort(border = 10, size = 100000) = 0.214
Running time of the pyramid sort(border = 10, size = 1000000) = 0.864

Running time of the pyramid sort(border = 1000, size = 10000) = 0.00566667
Running time of the pyramid sort(border = 1000, size = 100000) = 0.0926667
Running time of the pyramid sort(border = 1000, size = 1000000) = 1.34867

Running time of the pyramid sort(border = 100000, size = 10000) = 0.00566667
Running time of the pyramid sort(border = 100000, size = 100000) = 0.086
Running time of the pyramid sort(border = 100000, size = 1000000) = 1.35333

Отчет по сортировке Шелла

Choose a tag to compare

@DmitryBakin DmitryBakin released this 07 Nov 06:46

Running time of the first algorithm(border = 10, size = 10000) = 0.002

The array has been sorted


Running time of the second algorithm(border = 10, size = 10000) = 0.003

The array has been sorted


Running time of the third algorithm(border = 10, size = 10000) = 0.009

The array has been sorted



Running time of the first algorithm(border = 10, size = 100000) = 0.146

The array has been sorted


Running time of the second algorithm(border = 10, size = 100000) = 0.044

The array has been sorted


Running time of the third algorithm(border = 10, size = 100000) = 0.107

The array has been sorted



Running time of the first algorithm(border = 10, size = 1000000) = 0.286

The array has been sorted


Running time of the second algorithm(border = 10, size = 1000000) = 0.265

The array has been sorted


Running time of the third algorithm(border = 10, size = 1000000) = 2.457

The array has been sorted



Running time of the first algorithm(border = 1000, size = 10000) = 0.004

The array has been sorted


Running time of the second algorithm(border = 1000, size = 10000) = 0.003

The array has been sorted


Running time of the third algorithm(border = 1000, size = 10000) = 0.008

The array has been sorted



Running time of the first algorithm(border = 1000, size = 100000) = 0.035

The array has been sorted


Running time of the second algorithm(border = 1000, size = 100000) = 0.038

The array has been sorted


Running time of the third algorithm(border = 1000, size = 100000) = 0.157

The array has been sorted



Running time of the first algorithm(border = 1000, size = 1000000) = 0.587

The array has been sorted


Running time of the second algorithm(border = 1000, size = 1000000) = 0.506

The array has been sorted


Running time of the third algorithm(border = 1000, size = 1000000) = 2.736

The array has been sorted



Running time of the first algorithm(border = 100000, size = 10000) = 0.003

The array has been sorted


Running time of the second algorithm(border = 100000, size = 10000) = 0.003

The array has been sorted


Running time of the third algorithm(border = 100000, size = 10000) = 0.007

The array has been sorted



Running time of the first algorithm(border = 100000, size = 100000) = 0.037

The array has been sorted


Running time of the second algorithm(border = 100000, size = 100000) = 0.053

The array has been sorted


Running time of the third algorithm(border = 100000, size = 100000) = 0.127

The array has been sorted



Running time of the first algorithm(border = 100000, size = 1000000) = 0.657

The array has been sorted


Running time of the second algorithm(border = 100000, size = 1000000) = 0.704

The array has been sorted


Running time of the third algorithm(border = 100000, size = 1000000) = 2.947

The array has been sorted

random_mas_10000_10.txt
random_mas_10000_1000.txt
random_mas_10000_100000.txt
random_mas_100000_10.txt
random_mas_100000_1000.txt
random_mas_100000_100000.txt
random_mas_1000000_10.txt
random_mas_1000000_1000.txt
random_mas_1000000_100000.txt

Отчет по задаче коммивояжера №2

Choose a tag to compare

@DmitryBakin DmitryBakin released this 01 Oct 17:13

Enter the number of cities - 3

Enter your starting city - 1

0 61 40
2 0 2
82 3 0

The min Way = 45
Minimum way: 1 3 2 1
The max Way = 145
Maximum way: 1 2 3 1
the running time of the exact algorithm = 0.045

Heuristic way massiv: 1 3 2 1
The Way in heuristic = 45
the running time of the heuristic algorithm = 0.044

accuracy of execution = 100%

Enter the number of cities - 3

Enter your starting city - 2

0 84 43
79 0 5
80 22 0

The min Way = 144
Minimum way: 2 1 3 2
The max Way = 169
Maximum way: 2 3 1 2
the running time of the exact algorithm = 0.002

Heuristic way massiv: 2 3 1 2
The Way in heuristic = 169
the running time of the heuristic algorithm = 0.002

accuracy of execution = 0%

Enter the number of cities - 4

Enter your starting city - 1

0 7 46 56
8 0 46 41
31 70 0 63
1 20 75 0

The min Way = 117
Minimum way: 1 2 3 4 1
The max Way = 209
Maximum way: 1 4 3 2 1
the running time of the exact algorithm = 0.008

Heuristic way massiv: 1 2 4 3 1
The Way in heuristic = 154
the running time of the heuristic algorithm = 0.003

accuracy of execution = 59.7826%

Enter the number of cities - 4

Enter your starting city - 3

0 20 72 77
57 0 37 48
13 61 0 74
77 28 52 0

The min Way = 133
Minimum way: 3 1 2 4 3
The max Way = 258
Maximum way: 3 2 4 1 3
the running time of the exact algorithm = 0.005

Heuristic way massiv: 3 1 2 4 3
The Way in heuristic = 133
the running time of the heuristic algorithm = 0.002

accuracy of execution = 100%

Enter the number of cities - 7

Enter your starting city - 2

0 39 26 58 65 88 40
88 0 65 39 57 41 16
55 100 0 27 21 70 36
45 76 32 0 56 19 32
69 50 81 31 0 53 5
59 8 95 61 25 0 61
83 3 22 62 45 73 0

The min Way = 172
Minimum way: 2 4 6 1 3 5 7 2
The max Way = 536
Maximum way: 2 1 6 7 4 5 3 2
the running time of the exact algorithm = 0.005

Heuristic way massiv: 2 7 3 5 4 6 1 2
The Way in heuristic = 207
the running time of the heuristic algorithm = 0.002

accuracy of execution = 90.3846%

Enter the number of cities - 7

Enter your starting city - 5

0 52 84 79 14 78 47
69 0 56 50 32 49 92
7 49 0 60 37 38 1
68 70 58 0 12 42 23
45 49 11 98 0 89 41
63 19 51 33 9 0 63
6 60 38 2 27 68 0

The min Way = 158
Minimum way: 5 3 7 4 6 2 1 5
The max Way = 512
Maximum way: 5 4 2 7 6 1 3 5
the running time of the exact algorithm = 0.007

Heuristic way massiv: 5 3 7 4 6 2 1 5
The Way in heuristic = 158
the running time of the heuristic algorithm = 0.003

accuracy of execution = 100%

Enter the number of cities - 8

Enter your starting city - 3

0 62 61 35 100 54 60 7
42 0 17 56 6 24 88 20
100 83 0 88 41 60 8 36
18 18 99 0 86 58 1 57
68 61 98 94 0 8 54 63
90 74 36 7 15 0 39 98
57 52 90 100 8 20 0 23
75 22 62 3 88 55 76 0

The min Way = 95
Minimum way: 3 7 5 6 4 1 8 2 3
The max Way = 700
Maximum way: 3 2 7 4 6 8 1 5 3
the running time of the exact algorithm = 0.007

Heuristic way massiv: 3 7 5 6 4 1 8 2 3
The Way in heuristic = 95
the running time of the heuristic algorithm = 0.003

accuracy of execution = 100%

Enter the number of cities - 9

Enter your starting city - 7

0 72 38 92 54 30 40 44 60
15 0 12 62 56 68 23 41 62
6 48 0 84 46 15 93 27 42
59 66 59 0 48 79 48 1 68
33 8 86 17 0 41 43 45 96
51 60 57 24 55 0 8 96 56
10 49 40 82 85 6 0 2 6
83 26 61 59 98 84 44 0 43
98 18 46 48 97 52 80 41 0

The min Way = 178
Minimum way: 7 1 5 4 8 9 2 3 6 7
The max Way = 761
Maximum way: 7 4 9 1 2 6 8 5 3 7
the running time of the exact algorithm = 0.013

Heuristic way massiv: 7 8 2 3 1 6 4 5 9 7
The Way in heuristic = 324
the running time of the heuristic algorithm = 0.003

accuracy of execution = 74.9571%

Enter the number of cities - 10

Enter your starting city - 3

0 85 64 12 4 20 79 26 51 26
88 0 70 33 20 72 5 78 74 45
7 41 0 9 81 50 33 3 33 89
15 14 84 0 5 11 21 80 70 19
96 100 93 68 0 2 55 88 76 28
63 46 60 3 25 0 77 43 14 77
66 46 29 21 48 49 0 38 47 60
34 78 22 95 29 25 56 0 8 40
22 41 67 19 64 63 58 79 0 50
7 99 50 54 63 78 94 39 72 0

The min Way = 125
Minimum way: 3 8 9 10 1 5 6 4 2 7 3
The max Way = 813
Maximum way: 3 5 1 7 6 10 2 9 8 4 3
the running time of the exact algorithm = 0.084

Heuristic way massiv: 3 8 9 4 5 6 2 7 10 1 3
The Way in heuristic = 219
the running time of the heuristic algorithm = 0.006

accuracy of execution = 86.3372%

Enter the number of cities - 10

Enter your starting city - 8

0 1 70 29 16 57 12 88 83 48
15 0 31 53 10 68 62 65 92 35
61 92 0 50 82 88 38 13 91 28
57 11 5 0 41 91 40 4 16 97
75 70 20 35 0 56 82 87 74 46
99 94 64 71 72 0 65 11 27 30
11 96 3 49 34 21 0 11 76 69
33 30 28 47 63 20 36 0 16 62
21 38 85 59 24 23 36 35 0 62
27 56 67 32 67 22 97 9 100 0

The min Way = 175
Minimum way: 8 9 7 1 2 5 4 3 10 6 8
The max Way = 851
Maximum way: 8 5 7 2 4 10 9 3 6 1 8
the running time of the exact algorithm = 0.073

Heuristic way massiv: 8 9 1 2 5 3 10 6 7 4 8
The Way in heuristic = 236
the running time of the heuristic algorithm = 0.003

accuracy of execution = 90.9763%

Отчет по задаче коммивояжера

Choose a tag to compare

@DmitryBakin DmitryBakin released this 26 Sep 06:55

№1

Vvedite Kolichestvo gorodov - 3

Vvedite gorod-Nachalo 1

0   88   60

78 0 25
2 46 0

Minimalni put = 115
Maximalni put = 184
Vremya raboti tochnogo algoritma = 0.913

SumEvristika = 184
Vremya raboti evristiki = 0

Tochost vipolnenia = 0%

№2
Vvedite Kolichestvo gorodov - 3

Vvedite gorod-Nachalo 2

0   56   93

48 0 37
29 58 0

Minimalni put = 122
Maximalni put = 199
Vremya raboti tochnogo algoritma = 0.005

SumEvristika = 122
Vremya raboti evristiki = 0

Tochost vipolnenia = 100%

№3
Vvedite Kolichestvo gorodov - 4

Vvedite gorod-Nachalo 1

0   88   66   52

96 0 68 12
53 20 0 67
37 75 50 0

Minimalni put = 135
Maximalni put = 304
Vremya raboti tochnogo algoritma = 0

SumEvristika = 218
Vremya raboti evristiki = 0

Tochost vipolnenia = 50.8876%

№4
Vvedite Kolichestvo gorodov - 5

Vvedite gorod-Nachalo 4

0   92   67   50   58

54 0 95 48 52
50 7 0 42 60
55 56 46 0 56
60 10 18 23 0

Minimalni put = 185
Maximalni put = 345
Vremya raboti tochnogo algoritma = 0

SumEvristika = 215
Vremya raboti evristiki = 0

Tochost vipolnenia = 81.25%

№5
Vvedite Kolichestvo gorodov - 7

Vvedite gorod-Nachalo 1

0   90   39   19   61   12   25

17 0 37 10 73 5 81
61 26 0 51 11 68 11
3 67 77 0 30 1 4
24 67 23 78 0 39 53
97 90 41 32 83 0 75
89 72 42 18 98 25 0

Minimalni put = 176
Maximalni put = 589
Vremya raboti tochnogo algoritma = 0

SumEvristika = 185
Vremya raboti evristiki = 0

Tochost vipolnenia = 97.8208%

№6
Vvedite Kolichestvo gorodov - 7

Vvedite gorod-Nachalo 5

0   56   99   54    8   95   23

30 0 28 62 16 47 62
87 5 0 42 25 40 67
50 8 11 0 37 86 24
71 66 10 12 0 90 38
80 40 18 26 4 0 55
36 52 19 51 11 99 0

Minimalni put = 136
Maximalni put = 487
Vremya raboti tochnogo algoritma = 0

SumEvristika = 209
Vremya raboti evristiki = 0

Tochost vipolnenia = 79.2023%

№7
Vvedite Kolichestvo gorodov - 10

Vvedite gorod-Nachalo 1

0   47   43   31   52   91  100   75  100   34

78 0 5 95 83 50 31 71 80 85
42 39 0 65 51 17 24 39 32 25
79 81 96 0 3 45 71 65 59 39
61 10 59 32 0 58 94 51 15 82
45 64 69 89 74 0 42 74 86 42
55 35 34 8 49 72 0 36 57 6
63 52 90 22 69 58 4 0 25 47
66 31 51 68 90 10 24 57 0 56
25 71 33 77 52 18 65 88 72 0

Minimalni put = 196
Maximalni put = 832
Vremya raboti tochnogo algoritma = 0.106

SumEvristika = 306
Vremya raboti evristiki = 0

Tochost vipolnenia = 82.7044%

№8
Vvedite Kolichestvo gorodov - 10

Vvedite gorod-Nachalo 6

0   35   38   44    2   41   18   75   68   63

20 0 12 85 9 17 95 48 1 47
35 45 0 72 20 1 10 3 7 32
71 47 5 0 92 13 92 53 19 48
31 55 21 17 0 34 25 10 33 92
85 57 60 41 73 0 15 92 47 45
50 38 94 45 64 61 0 9 35 83
36 81 21 93 82 97 90 0 95 76
43 69 98 51 6 98 94 63 0 33
2 47 79 98 45 68 94 83 54 0

Minimalni put = 151
Maximalni put = 847
Vremya raboti tochnogo algoritma = 0.419

SumEvristika = 273
Vremya raboti evristiki = 0

Tochost vipolnenia = 82.4713%

№9
Vvedite Kolichestvo gorodov - 12

Vvedite gorod-Nachalo 1

0   14   55  100   65   47   55   70   49   25   38   62

42 0 54 12 19 78 41 68 5 81 32 47
9 21 0 26 74 17 71 2 26 79 75 57
19 57 30 0 1 24 13 58 30 93 1 46
73 50 30 15 0 39 67 69 22 26 30 31
10 2 85 21 40 0 79 48 42 22 34 83
19 1 5 48 55 30 0 67 30 49 43 12
10 30 69 73 32 96 76 0 39 10 31 35
22 85 74 26 59 17 13 73 0 17 89 80
21 76 9 80 69 15 27 52 3 0 44 69
76 95 62 42 20 1 58 87 63 34 0 61
2 82 95 5 15 30 69 65 79 83 96 0

Minimalni put = 119
Maximalni put = 973
Vremya raboti tochnogo algoritma = 10.825

SumEvristika = 179
Vremya raboti evristiki = 0

Tochost vipolnenia = 92.9742%