This paper studies parallel algorithms for the longest increasing subsequence (LIS) problem. Let $n$ be the input size and $k$ be the LIS length of the input. Sequentially, LIS is a simple problem that can be solved using dynamic programming (DP) in $O(n\log n)$ work. However, parallelizing LIS is a long-standing challenge. We are unaware of any parallel LIS algorithm that has optimal $O(n\log n)$ work and non-trivial parallelism (i.e., $\tilde{O}(k)$ or $o(n)$ span). This paper proposes a parallel LIS algorithm that costs $O(n\log k)$ work, $\tilde{O}(k)$ span, and $O(n)$ space, and is much simpler than the previous parallel LIS algorithms. We also generalize the algorithm to a weighted version of LIS, which maximizes the weighted sum for all objects in an increasing subsequence. To achieve a better work bound for the weighted LIS algorithm, we designed parallel algorithms for the van Emde Boas (vEB) tree, which has the same structure as the sequential vEB tree, and supports work-efficient parallel batch insertion, deletion, and range queries. We also implemented our parallel LIS algorithms. Our implementation is light-weighted, efficient, and scalable. On input size $10^9$, our LIS algorithm outperforms a highly-optimized sequential algorithm (with $O(n\log k)$ cost) on inputs with $k\le 3\times 10^5$. Our algorithm is also much faster than the best existing parallel implementation by Shen et al. (2022) on all input instances.
翻译:本文研究了最长递增子序列(LIS)问题的并行算法。设$n$为输入规模,$k$为输入LIS长度。顺序地,LIS是一个简单的问题,可以通过动态规划(DP)以$O(n\log n)$的工作量解决。然而,并行化LIS是一个长期的挑战。我们不知道有任何具有最佳$O(n\log n)$工作量和非平凡并行性(即$\tilde{O}(k)$或$o(n)$跨度)的并行LIS算法。本文提出了一种并行LIS算法,成本为$O(n\log k)$,$\tilde{O}(k)$的跨度,$O(n)$空间,且比之前的并行LIS算法要简单得多。我们还将该算法推广到LIS的加权版本,该算法通过增加子序列中所有对象的加权和来实现最大化。为了实现更好的工作量界限,我们设计了van Emde Boas(vEB)树的并行算法,该树与顺序vEB树具有相同的结构,并支持工作效率高的并行批量插入、删除和区间查询。我们还实现了我们的并行LIS算法。我们的实现轻量化、高效、可伸缩。在输入规模为$10^9$的情况下,我们的LIS算法在$k\le 3\times 10^5$的输入实例上优于高度优化的顺序算法(成本为$O(n\log k)$)。我们的算法也比Shen等人(2022年)的最佳现有并行实现快得多。