Multi-Way Co-Ranking: Index-Space Partitioning of Sorted Sequences Without Merge
Joshi
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
academic
Multi-Way Co-Ranking: Index-Space Partitioning of Sorted Sequences Without Merge
This paper proposes a merge-free multi-way co-ranking algorithm for computing cutting indices i1,…,im that partition m sorted sequences such that all prefix segments collectively contain exactly K elements. The method extends Siebert and Träff's two-list co-ranking to arbitrary m-way partitioning, maintaining boundaries for each sequence and converging to a consistent global frontier without performing multi-way merge or value-space search. The algorithm applies binary search in index space with time complexity O(log(∑tnt)logm) and space complexity O(m), independent of K. Correctness is established through exchange arguments, and applications in distributed fractional knapsack, parallel merge partitioning, and multi-stream joins are discussed.
The multi-way co-ranking problem is defined as follows: Given m sequences L1,…,Lm sorted in non-decreasing order (duplicates allowed), each of length nt, and a global target rank K∈{0,…,N} (where N=∑tnt), find cutting indices i1,…,im such that:
∑t=1mit=Kandmaxtℓt≤mintrt
where ℓt and rt denote the left and right boundary values, respectively.
If Φ(i)>0, let p=argmaxtℓt and q=argmintrt. Among all feasible infinitesimal transfers maintaining ∑tit=K, the (p,q) pair achieves the maximum non-increasing change in Φ.
Proof Sketch: Decreasing ip reduces ℓp (the local maximum of left boundaries), while increasing iq increases rq (the local minimum of right boundaries). Since ℓp≥ℓu and rq≤rv for all u,v, the extremal pair (p,q) produces the steepest reduction in the gap maxℓ−minr.
Any sequence of feasible transfers reducing Φ can be reordered such that all extremal (p,q) transfers occur before any non-extremal transfers, without worsening Φ at any intermediate step.
In each round, the feasible distance of either the donor or receiver is halved. The distance Ub[t]−Lb[t] for each sequence is reduced at most O(lognt) times. Aggregating across all m sequences, the total number of rounds is:
Employs a "water-filling" strategy for feasible solution initialization:
def water_fill_initialization(K, capacities):
i = [0] * len(capacities)
need = K
for t in range(len(capacities)):
take = min(capacities[t], need)
i[t] = take
need -= take
if need == 0:
break
return i
In multi-source fractional knapsack problems, when items are sorted by density and distributed across m shards, co-ranking computes global K-prefix partitioning without merging source data.
Assigns disjoint prefixes to processors without executing preliminary merge. The co-ranking vector determines exact handoff points, allowing processors to perform only local merging over their ranges.
In database or stream processing pipelines, partitioning join frontiers at global rank is a natural requirement. This method produces per-stream cursors consistent with the global prefix.
While the paper primarily focuses on theoretical analysis, the author provides implementation code for verification. Algorithm practical performance can be evaluated through:
Siebert and Träff's work established the foundation for co-ranking, primarily used for work partitioning in parallel merge. This paper extends their approach from 2-way to arbitrary m-way.
Siebert and Wolf's exact splitter method operates in value space, searching for key thresholds that balance partitions. In contrast, this paper operates in index space, directly outputting co-ranking vectors.
Frederickson-Johnson's classical work studies selection and ranking on structured inputs (such as unions of m sorted lists). Their algorithm is essentially a value-space process, while this paper provides an index-space primitive.
3 Christian Siebert. Simple in-place yet comparison-optimal mergesort, arXiv:2509.24540, 2025.
4 Christian Siebert and Felix Wolf. A scalable parallel sorting algorithm using exact splitting. RWTH Aachen University technical report, 2011.
Overall Assessment: This is a theoretically strong algorithmic paper that successfully addresses the important multi-way co-ranking problem. While lacking experimental verification, it features rigorous theoretical analysis and strong methodological innovation, providing valuable theoretical tools for related fields.