SearcharxivSearch

arXiv · 2608.10696

When More Generators Hurt: Shellsort on Full Product Grids

Abstract

Shellsort repeatedly runs insertion sort with decreasing gaps, so its worst-case cost depends on the gap sequence. Pratt's $2^u3^v$ sequence, one of the few systematic constructions with a proven $O(n\log^2 n)$ bound, includes every product below $n$ of two base numbers, or generators. We ask whether adding more base numbers, and thus more intermediate gaps, can improve this full product grid. We show that it cannot when every product is retained and each base is at most a fixed power of the smallest. With $r$ independent bases (different exponent choices give different products) and $\Theta(\log n)$ gaps, the best possible worst-case cost is $n\exp(\Theta((\log n)^{1-1/r}))$. Thus two bases give the exponent $\sqrt{\log n}$, whereas three give $(\log n)^{2/3}$: more bases are worse. With a budget of $p$ gaps, matching bounds give the factor $\exp(\Theta(\log n/p^{1/r}))$ beyond linear cost. The reason is simple. Few products force the smallest base $m$ to be large, and fullness makes $m$ the next-to-last gap. An input built from reversed blocks is already sorted for every earlier gap, forcing $\Omega(nm)$ work in the final pass. Powers of distinct primes give a matching construction. For arbitrary gaps, we count current-gap multiples that earlier gaps cannot form. This gives upper and lower bounds for individual passes. A Fourier argument gives necessary conditions for small total cost, while short nonnegative sums give sufficient conditions. In both settings, useful distances must be available before they are needed.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ziqi Zhao, Qingjian Ni. 2026-08-11. When More Generators Hurt: Shellsort on Full Product Grids. https://arxiv.org/abs/2608.10696

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

The Computational Complexity of Holant Problems on 4-regular Graphs from the Stable Subgroup Sequence of $SL(2,\mathbb{C})$

The Holant framework provides a general setting for studying counting problems and includes graph homomorphisms (\#GH) and counting constraint satisfaction problems (\#CSP) as special cases. Over the past twenty years, a series of computational complexity dichotomies have been established for Holant problems, but the classification for complex-valued signatures is still open. The main obstacle is the case in which all signatures have even arity. In this paper, we establish a dichotomy for Holant problems with a complex-valued 4-ary signature, which is a key base case for the full classification of Holant problems. We present a new strategy by introducing Schur's theorem, the classification of finite subgroups of $\mathrm{SL}(2,\mathbb{C})$ and stable subgroup sequences into the proof. These new techniques are of independent interest.

cs.CC

Topology inside NC$^1$

We show that ACC$^0$ is precisely what can be computed with constant-width circuits of polynomial size and polylogarithmic genus. This extends a characterization given by Hansen, showing that planar constant-width circuits also characterize ACC$^0$. Thus polylogarithmic genus provides no additional computational power in this model. We consider other generalizations of planarity, including crossing number and thickness. We show that constant-width circuits of polynomial size and thickness two already suffice to capture all of NC$^1$.

cs.CC