Abstract

Given a sequence π 1 π 2 … π n , a longest increasing subsequence (LIS) in a window π 〈 l , r 〉 = π l π l + 1 … π r is a longest subsequence σ = π i 1 π i 2 … π i T such that l ≤ i 1 < i 2 < ⋯ < i T ≤ r and π i 1 < π i 2 < ⋯ < π i T . We consider the Lisw problem, which is to find the longest increasing subsequences in a sliding window of fixed-size w over a sequence. Formally, it is to find a LIS for every window in a set S FIX = { π 〈 i + 1 , i + w 〉 ∣ 0 ≤ i ≤ n − w } ∪ { π 〈 1 , i 〉 , π 〈 n − i , n 〉 ∣ i < w } . By maintaining a canonical antichain partition in windows, we present an optimal output-sensitive algorithm to solve this problem in O ( output ) time, where output is the sum of the lengths of the n + w − 1 LISs in those windows of S FIX . In addition, we propose a more generalized problem called Lisset problem, which is to find a LIS for every window in a set S VAR containing variable-size windows. By applying our algorithm, we provide an efficient solution for the Lisset problem to output a LIS (or all the LISs) in every window which is better than the straightforward generalization of classical LIS algorithms. An upper bound of our algorithm on the Lisset problem is discussed.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.