English

Efficient Algorithms for Sorting in Trees

Data Structures and Algorithms 2022-06-03 v2

Abstract

Sorting is a foundational problem in computer science that is typically employed on sequences or total orders. More recently, a more general form of sorting on partially ordered sets (or posets), where some pairs of elements are incomparable, has been studied. General poset sorting algorithms have a lower-bound query complexity of Ω(wn+nlogn)\Omega(wn + n \log n), where ww is the width of the poset. We consider the problem of sorting in trees, a particular case of partial orders, and parametrize the complexity with respect to dd, the maximum degree of an element in the tree, as dd is usually much smaller than ww in trees. For example, in complete binary trees, d=Θ(1),w=Θ(n)d = \Theta(1), w = \Theta(n). We present a randomized algorithm for sorting a tree poset in worst-case expected O(dnlogn)O(dn\log n) query and time complexity. This improves the previous upper bound of O(dnlog2n)O(dn \log^2 n). Our algorithm is the first to be optimal for bounded-degree trees. We also provide a new lower bound of Ω(dn+nlogn)\Omega(dn + n \log n) for the worst-case query complexity of sorting a tree poset. Finally, we present the first deterministic algorithm for sorting tree posets that has lower total complexity than existing algorithms for sorting general partial orders.

Keywords

Cite

@article{arxiv.2205.15912,
  title  = {Efficient Algorithms for Sorting in Trees},
  author = {Jishnu Roychoudhury and Jatin Yadav},
  journal= {arXiv preprint arXiv:2205.15912},
  year   = {2022}
}