Probabilistic analysis of optimal multi-pivot QuickSort
Cecilia Holmgren, Jasper Ischebeck, Daniel Krenn, Florian Lesny, Ralph Neininger
TL;DR
This work analyzes the number of key comparisons $X_n$ in a multi-pivot QuickSort with $K$ pivots under a uniform random input. It shows that the mean grows like $E[X_n] = \alpha_K n \log n + \beta_K n + o(n)$ and that the normalized error converges to a limit $Z_K$ in distribution and all moments, where $Z_K$ satisfies a fixed-point recursion involving spacings $D$ with $D_i \sim \text{Beta}(1,K)$. The limit $Z_K$ has a smooth density, and the authors establish rate-of-convergence bounds for small $K$ (in Wasserstein and KS metrics) via the contraction method linked to $(K+1)$-ary search trees. As $K$ grows, the leading mean coefficient $\alpha_K$ tends to $1/\log 2$, indicating convergence toward the information-theoretic lower bound for sorting cost.
Abstract
We consider a multi-pivot QuickSort algorithm using $K\in\mathbb{N}$ pivot elements to partition a nonsorted list into $K+1$ sublists in order to proceed recursively on these sublists. For the partitioning stage, various strategies are in use. We focus on the strategy that minimizes the expected number of key comparisons in the standard random model, where the list is given as a uniformly permuted list of distinct elements. We derive asymptotic expansions for the expectation and variance of the number of key comparisons as well as a limit law for all $K\in\mathbb{N}$, where the convergence holds for all (exponential) moments. For $K\le 4$ we also bound the rate of convergence within the Wasserstein and Kolmogorov--Smirnov distance. Our analysis of the expectation is based on classical results for random $m$-ary search trees. For the remaining results, combinatorial considerations are used to make the contraction method applicable.
