The Longest Wave Subsequence Problem: Generalizations of the Longest Increasing Subsequence Problem

Guan-Zhi Chen,Chang-Biau Yang,Yu-Cheng Chang
DOI: https://doi.org/10.1142/s012905412450014x
2024-07-18
International Journal of Foundations of Computer Science
Abstract:International Journal of Foundations of Computer Science, Ahead of Print. The longest increasing subsequence (LIS) problem aims to find the subsequence exhibiting an increasing trend in a numeric sequence with the maximum length. In this paper, we generalize the LIS problem to the longest wave subsequence (LWS) problem, which encompasses two versions: LWSt and LWSr. Given a numeric sequence [math] of distinct values and a target trend sequence [math], the LWSt problem aims to identify the longest subsequence of [math] that preserves the trend of the prefix of [math]. And, the LWSr problem aims to find the longest subsequence of [math] within [math] segments, alternating increasing and decreasing subsequences. We propose two efficient algorithms for solving the two versions of the LWS problem. For the LWSt problem, the time complexity of our algorithm is O[math], where [math] represents the length of the given numeric sequence [math]. Additionally, we propose an O[math]-time algorithm for solving the LWSr problem. In both algorithms, we utilize the priority queues for the insertion, deletion, and successor operations.
computer science, theory & methods
What problem does this paper attempt to address?