We generalize the classical nuts and bolts problem to a setting where the input is a collection of $n$ nuts and $m$ bolts, and there is no promise of any matching pairs. It is not allowed to compare a nut directly with a nut or a bolt directly with a bolt, and the goal is to perform the fewest nut-bolt comparisons to discover the partial order between the nuts and bolts. We term this problem \emph{bipartite sorting}. We show that instances of bipartite sorting of the same size exhibit a wide range of complexity, and propose to perform a fine-grained analysis for this problem. We rule out straightforward notions of instance-optimality as being too stringent, and adopt a \emph{neighborhood-based} definition. Our definition may be of independent interest as a unifying lens for instance-optimal algorithms for other static problems existing in literature. This includes problems like sorting (Estivill-Castro and Woods, ACM Comput. Surv. 1992), convex hull (Afshani, Barbay and Chan, JACM 2017), adaptive joins (Demaine, L\'{o}pez-Ortiz and Munro, SODA 2000), and the recent concept of universal optimality for graphs (Haeupler, Hlad\'ik, Rozho\v{n}, Tarjan and T\v{e}tek, 2023). As our main result on bipartite sorting, we give a randomized algorithm that is within a factor of $O(\log ^3 (n+m))$ of being instance-optimal w.h.p., with respect to the neighborhood-based definition. As our second contribution, we generalize bipartite sorting to DAG sorting, when the underlying DAG is not necessarily bipartite. As an unexpected consequence of a simple algorithm for DAG sorting, we rule out a potential lower bound on the widely-studied problem of \emph{sorting with priced information}, posed by (Charikar, Fagin, Guruswami, Kleinberg, Raghavan and Sahai, STOC 2000).
翻译:本文将经典的螺母螺栓问题推广至如下场景:输入包含 $n$ 个螺母与 $m$ 个螺栓,且不保证存在任何匹配对。禁止直接比较螺母与螺母或螺栓与螺栓,目标是通过最少的螺母-螺栓比较次数揭示螺母与螺栓之间的偏序关系。我们将此问题称为\emph{二分图排序}。研究表明,相同规模的二分图排序实例呈现出广泛的复杂度差异,因此建议对该问题进行细粒度分析。我们排除了若干过于严格的实例最优性直接定义,采用一种\emph{基于邻域}的定义方式。该定义作为统一视角,可能对文献中现有其他静态问题的实例最优算法研究具有独立意义,包括排序(Estivill-Castro与Woods,ACM Comput. Surv. 1992)、凸包(Afshani、Barbay与Chan,JACM 2017)、自适应连接(Demaine、López-Ortiz与Munro,SODA 2000)以及近期提出的图通用最优性概念(Haeupler、Hladík、Rozhoň、Tarjan与Tětek,2023)。针对二分图排序的主要成果,我们提出一种随机算法,在基于邻域的定义下以高概率达到实例最优性的 $O(\log ^3 (n+m))$ 倍范围内。作为第二项贡献,我们将二分图排序推广至底层有向无环图不必为二分图的\emph{有向无环图排序}问题。通过对有向无环图排序的简单算法分析,我们意外地排除了(Charikar、Fagin、Guruswami、Kleinberg、Raghavan与Sahai,STOC 2000)针对广受关注的\emph{带代价信息排序}问题所提出的潜在下界。