WorksComputer Science
Maximum Letter-Duplicated and Longest Run Subsequences: Algorithms, Approximation, and Interval-Selection Connections
Abstract
We study Max-LL-DUP: given a string , find a letter-duplicated subsequence containing the maximum number of distinct symbols. A preliminary version showed that the problem is solvable in linear time when every symbol occurs at most three times and is APX-hard when every symbol occurs at most four times. We develop a more complete algorithmic picture of the problem. Our main structural observation is that feasible solutions can be represented using intervals between consecutive occurrences of symbols, with a linear number of relevant intervals. This gives a deterministic linear-time 2-approximation for unrestricted Max-LL-DUP and an exact reduction to the Job Interval Selection Problem. Consequently, for every constant , unrestricted Max-LL-DUP admits a randomized -approximation, while the frequency-four case admits a randomized -approximation through an exact reduction to JISP. We also give an exact -time algorithm, where is the number of symbols occurring more than three times. For 3-Max-LL-DUP range queries, we obtain linear space and query time via weighted-ancestor queries. We further study single-deletion sensitivity and compute all deletion answers in total time. Finally, we consider the related Longest Run Subsequence problem. Both problems admit an interval-selection interpretation, but their objectives differ: one counts represented symbols whereas the other counts selected positions. Exploiting this connection, we give a value-preserving reduction to weighted Job Interval Selection and obtain a polynomial-time 2-approximation without any restriction on symbol frequencies. To the best of our knowledge, this is the first constant-factor approximation for unrestricted Longest Run Subsequence.