Skip to content

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

Choose a tag to compare

@DmitryBakin DmitryBakin released this 01 Oct 17:13
· 25 commits to main since this release

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%