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$,输入序列LIS长度为$k$。在串行环境下,LIS是一个可通过动态规划(DP)在$O(n\log n)$工作复杂度内解决的简单问题。然而,LIS的并行化是一个长期存在的挑战。目前尚无任何并行LIS算法能同时实现最优的$O(n\log n)$工作复杂度和非平凡并行性(即$\tilde{O}(k)$或$o(n)$的展度)。本文提出一种并行LIS算法,其工作复杂度为$O(n\log k)$,展度为$\tilde{O}(k)$,空间复杂度为$O(n)$,且比现有并行LIS算法更为简洁。我们还将该算法推广至加权LIS版本,该版本旨在最大化递增子序列中所有对象的加权和。为实现加权LIS算法更优的工作复杂度界,我们设计了van Emde Boas(vEB)树的并行算法。该并行vEB树保持与串行vEB树相同的结构,支持工作高效的并行批量插入、删除及范围查询操作。我们还实现了所提出的并行LIS算法。该实现轻量、高效且可扩展。在输入规模为$10^9$时,当$k\le 3\times 10^5$时,我们的LIS算法性能优于高度优化的串行算法(其复杂度为$O(n\log k)$)。在所有输入实例上,我们的算法均显著快于Shen等人(2022)提出的现有最佳并行实现。