You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by simulated annealing meta-heuristic, which involves solving a problem by a sequence of choices from the nubmer of r_j neighbors and T_j distance.
133
134
134
135
Pseudocode:
@@ -185,7 +186,7 @@ For annealing sort, it is tested over the following temparature and repetition s
@@ -215,20 +216,43 @@ In this section, the input testing data is permuted using uniformly distributed
215
216
216
217
4. The following graph shows the running time of annealing sort over all different temparature sequences and repetition sequences above:
217
218
218
-

219
+

219
220
220
221
The best two cases of annealing sort are: annealing 2 (orange line) and annealing 4 (red line). The lines of these two different parameters almost overlapped. Annealing 4 is a little bit better than annealing 2.
221
222
222
-
Annealing 4 has temparature sequence: [243, 81, 27, 9, 3, 0] and reqetition sequence: [2, 2, 2, 2, 2, 0]
In this section, the input testing data is almost sorted by independently choosing 2logn pairs, (i, j), where i and j are uniformly-chosen random integers in the range from 0 to n-1, and swap the numbers at positions i and j in the array/vector.
227
228
228
229
1. The graph below shows the running time of different algorithms on increasing problem size.
229
230
231
+

232
+
233
+
Among all the sorting algorithms tested, insertion sort is the fastest.
234
+
230
235
2. Regression analysis of the running time experiements
231
236
237
+

238
+
239
+
Regression analysis also shows insertion sort has the smallest slope on log-log scale which means it is the fastest.
240
+
232
241
3. The following graph shows the running time of shell sort over all different gap sequences:
233
242
243
+

244
+
245
+
The best two cases of shell sort are: shell 3 and shell 5. And shell 5 is even faster than shell 3. Overall, gap sequence: [200, 190, 180, 170, 160, 150] has the best performance.
246
+
234
247
4. The following graph shows the running time of annealing sort over all different temparature sequences and repetition sequences:
248
+
249
+

250
+
251
+
The best two cases of annealing sort are: annealing 2 and annealing 6.
252
+
Annealing 2 has a faster run time than annealing 6.
253
+
254
+
Annealing 2 has temparature sequence: [1000, 800, 600, 400, 200, 0] and reqetition sequence: [2, 2, 2, 2, 2, 0]
255
+
256
+
## Conclusion
257
+
258
+
Overall, annealing sort 4 is the fastest when input testing data is in uniformly distributed permutations. And insertion sort is the fastest when input testing data in almost-sorted permutations.
0 commit comments