Which sorting algorithm is most robust to noisy comparisons?
March 26, 2025
Which sorting algorithm is most robust to noisy comparisons?
I was wondering about this and I had some time to spare, so I coded up a simulation that benchmarks some popular sorting algorithms under and noise models.
Specifically, I sorted 100-sized lists of numbers drawn from using different sorting algorithms, conducting 100 independent trials for each algorithm while simulating noisy comparisons under Gaussian and Uniform noise models (for various values of noise stddev).
So what did I find?
Nice curves. Some algorithms are much more sensitive to noise than others, wow.
It appears the ranking of these algorithms from best to worst in terms of their robustness to noise is pretty (cough… cough..) robust to the specific choice of noise model and looks like
- Cocktail shaker sort
- Shellsort
- Bubble sort
- Merge sort
- Quicksort
- Heapsort
- Selection sort
- Insertion sort
Thoughts
Notice that the list begins with a few algorithms, followed by the algorithms, and finally ends with some more algorithms. I wonder if there exists an algorithm that’s at least as robust as the top-performing ones, or if this increased sensitivity provably persists in any algorithm that runs in .