Multi-Way Co-Ranking: Index-Space Partitioning of Sorted Sequences Without Merge
Amit Joshi
TL;DR
The paper addresses the problem of computing a global rank split across $m$ sorted sequences without performing any merge or value-space search. It introduces a merge-free, index-space multi-way co-ranking algorithm that generalizes two-list co-ranking through a donor/receiver greedy strategy with explicit per-list bounds, achieving $O(\log(\sum_t n_t) \ \log m)$ time and $O(m)$ space. Correctness is established via an exchange argument on an imbalance potential, and the approach is shown to readily apply to distributed fractional knapsack, parallel multi-way partitioning, and multi-stream joins. The method provides a deterministic, $K$-independent primitive for fast, scalable partitioning in distributed and database settings, with an accessible implementation path.
Abstract
We present a merge-free algorithm for multi-way co-ranking, the problem of computing cut indices $i_1,\dots,i_m$ that partition each of the $m$ sorted sequences such that all prefix segments together contain exactly $K$ elements. Our method extends two-list co-ranking to arbitrary $m$, maintaining per-sequence bounds that converge to a consistent global frontier without performing any multi-way merge or value-space search. Rather, we apply binary search to \emph{index-space}. The algorithm runs in $O(\log(\sum_t n_t)\,\log m)$ time and $O(m)$ space, independent of $K$. We prove correctness via an exchange argument and discuss applications to distributed fractional knapsack, parallel merge partitioning, and multi-stream joins. Keywords: Co-ranking \sep partitioning \sep Merge-free algorithms \sep Index-space optimization \sep Selection and merging \sep Data structures
