The longest almost-increasing subsequence

  • Authors:
  • Amr Elmasry

  • Affiliations:
  • Max-Planck Institut für Informatik, Saarbrücken, Germany

  • Venue:
  • COCOON'10 Proceedings of the 16th annual international conference on Computing and combinatorics
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given a sequence of n elements, we introduce the notion of an almost-increasing subsequence in two contexts. The first notion is the longest subsequence that can be converted to an increasing subsequence by possibly adding a value, that is at most a fixed constant c, to each of the elements. We show how to optimally construct such subsequence in O(n log k) time, where k is the length of the output subsequence. As an exercise, we show how to produce in O(n2 log k) time a special type of subsequences, that we call subsequences obeying the triangle inequality, by using as a subroutine our algorithm for the above case. The second notion is the longest subsequence where every element is at least the value of a monotonically non-decreasing function in terms of the r preceding elements (or even with respect to every r elements among those preceding it). We show how to construct such subsequence in O(nr log k) time.