arXiv:2610.32731cs.DSOct 2026

Manuscript Offprint

arXiv:2610.32731

Selection under partial information

Benjamin Aram Berendsohn

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Benjamin Aram Berendsohn ∗^{*}

The selection problem asks to find the kk-th smallest element in a given set XX. Its complexity is well-known to be Θ(∣X∣)\Theta(|X|) for every fixed kk. We consider the poset selection problem where a partial order PP on XX is given, and the underlying order of XX is guaranteed to be a linear extension of PP. This generalizes several variants of the selection problem studied before.

Our main result is an algorithm that performs O(k+OPT(P,k))\mathcal{O}(k + \text{OPT}(P, k)) comparisons, where OPT(P,k)\text{OPT}(P, k) is the minimum number of comparisons required for the input (P,k)(P, k). If PP is a rooted tree, we obtain an O(OPTlog⁡(k/OPT))\mathcal{O}(\text{OPT}\log(k/\text{OPT})) algorithm, which can be further improved to O(OPTlog⁡log⁡(k/OPT))\mathcal{O}(\text{OPT}\log\log(k/\text{OPT})) or O(OPTlog⁡OPT)\mathcal{O}(\text{OPT}\log\text{OPT}) under mild assumptions about PP. Our algorithms are based on the work of Kaplan, Kozma, Zamir, and Zwick [SOSA 2019], who used Chazelle's soft heaps [J. ACM 2000] to simplify several older results. We introduce a new soft heap variant, the weighted soft heap, which allows greater control over which elements get corrupted.

1 Introduction

In the selection problem, we are given a set XX of nn distinct comparable elements1^{1} and a number k∈[n]k \in [n], and need to find the kk-smallest element of XX. While sorting XX easily solves this problem in O(nlog⁡n)\mathcal{O}(n \log n) time, the famous median-of-medians algorithm [BFP+^{+}73] runs in optimal Θ(n)\Theta(n) time.

In this paper, we consider the poset selection 2^2, or generalized selection [KKZZ18] problem, where additionally a poset PP on XX is given, and we know that the (unknown) order of XX must be a linear extension of PP. More precisely, the input is a directed acyclic graph (DAG) GG and a comparison oracle ≺\prec on V(G)V(G), and it is known that for each edge (u,v)∈E(G)(u, v) \in E(G), we have u≺vu \prec v. Depending on GG and kk, selection may be solved much faster than Θ(n)\Theta(n); see fig. 1 for some simple examples.

Several special cases of the poset selection problem have been solved with algorithms using an asymptotically optimal number of comparisons. Frederickson and Johnson [FJ82] considered

*Max Planck Institute for Informatics, Saarbrücken, Germany; benjamin.berendsohn@fu-berlin.de

1^{1}Throughout the paper, we assume the comparison model, where these elements can only be accessed via comparisons.

2^{2}This is different from the “selection in posets” problem studied by Daskalakis, Karp, Mossel, Riesenfeld, and Verbin [DKM +^{+}11].

Figure

Figure 1: Three special cases of the poset selection problem. Left: Zero comparisons are needed for all kk. Center: Θ(log⁡n)\Theta(\log n) comparisons are needed [KKZZ18]. Right: Zero comparisons are need for k≤5k \leq 5, but Θ(n)\Theta(n) for k≥6k \geq 6.

selection from column-sorted matrices. Note that this corresponds to poset selection when the poset is a collection of equal-length chains. The same authors [FJ84] studied selection from collections of row- and column-sorted matrices, which corresponds to another set of highly structured partial orders. Frederickson [Fre93] gave an algorithm for selection from a binary min-heap, or, more generally, a t-nary min-heap. This corresponds to the case where G is a rooted tree where each inner node has degree tt. 3^{3}

Kaplan, Kozma, Zamir, and Zwick utilized Chazelle's soft heaps [Cha00, KTZ13, Bro21] to simplify several older results, including the optimal algorithms for column-sorted matrices and t-nary heaps. They also gave a simple, though not optimal, algorithm for general trees (see section 1.1). We refer to their paper for several applications of selection in these special cases.

In contrast to this somewhat sparse set of results, the corresponding poset sorting problem has been solved in its full generality with an optimal O(log⁡e(P))\mathcal{O}(\log e(P)) comparisons, where e(P)e(P) denotes the number of linear extensions of PP [Kis68, Fre76, Lin84, KK92, BFT95, CFJ +^{+}10, vR24, HHI +^{+}25, vdHRR25, Rut26].

In this paper, we develop an algorithm for selection with arbitrary posets. For a DAG G and a number k≤∣V(G)∣k \leq |V(G)|, let OPT(G,k)\text{OPT}(G, k) denote the minimum number of comparisons that any algorithm needs to solve a worst-case instance (G,k,≺)(G, k, \prec). Note that here G and k are fixed, but the comparison oracle ≺\prec is chosen to be worst possible for the given algorithm. Our main result is:

Theorem 1. There is a poset selection algorithm using O(k+OPT(G,k))\mathcal{O}(k + \text{OPT}(G, k)) comparisons for each input (G,k,≺)(G, k, \prec).

When GG is a rooted forest, the running time of this algorithm is also O(k+OPT(G,k))\mathcal{O}(k + \mathrm{OPT}(G, k)). This assumes a simple pointer-representation of GG, where the degree of each node can be determined in constant time. If GG is a general DAG, we cannot bound the running time only in terms of kk and OPT(G,k)\mathrm{OPT}(G, k), but it is linear in the size of GG.

Our algorithm is not optimal when OPT(G,k)≪k\mathrm{OPT}(G, k) \ll k. In fact, it can be arbitrarily far from optimal in that case. When GG is a forest, we obtain some improved algorithms in the case OPT(G,k)≪k\mathrm{OPT}(G, k) \ll k:

Theorem 2. There is a poset selection algorithm using O(OPT(G,k)⋅log⁡(k/OPT(G,k)))\mathcal{O}(\mathrm{OPT}(G,k) \cdot \log(k/\mathrm{OPT}(G,k))) comparisons for each input (G,k,≺)(G, k, \prec) when GG is a rooted forest and OPT(G,k)≤12k\mathrm{OPT}(G, k) \leq \frac{1}{2}k.

3^{3}We interpret a rooted tree or forest as a DAG where all edges are directed away from the root. That is, the set of roots of the forest are the minima of the corresponding poset.

Theorem 3. There is a poset selection algorithm using O(OPT(G,k)⋅log⁡log⁡(k/OPT(G,k)))\mathcal{O}(\text{OPT}(G,k) \cdot \log \log(k/\text{OPT}(G,k))) comparisons for each input (G,k,≺)(G,k, \prec) when GG is a rooted forest where each node of depth less than kk has at least one child, and OPT(G,k)≤14k\text{OPT}(G,k) \leq \frac{1}{4}k.

Alternatively, the number of comparisons can be bounded by O(OPT(G,k)log⁡OPT(G,k))\mathcal{O}(\mathrm{OPT}(G,k)\log\mathrm{OPT}(G,k)).

The running time of these two algorithms is O(OPT(G,k)+klog⁡OPT(G,k))\mathcal{O}(\mathrm{OPT}(G,k)+k\log\mathrm{OPT}(G,k)).

References (27)