Manuscript Offprint
arXiv:2611.26297Exact guarantees and faster algorithms for -rollercoasters
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
For , a -rollercoaster is a sequence of distinct values whose maximal increasing and decreasing runs all have length at least . We discover the maximum guaranteed length of -rollercoasters appearing as subsequences of -point permutations. In particular, letting , we prove that for , for and otherwise. We prove that the guarantees are tight by constructing an -point permutation whose longest -rollercoaster has exactly points. Our proof extends Seidenberg's argument [Journal of the London Mathematical Society, 1959] for proving the Erdős--Szekeres theorem by representing points in a subsequence with respect to the lengths of longest monotonic (increasing and decreasing) subsequences that reach each point. The combinatorial proof yields a deterministic comparison-based algorithm that finds a rollercoaster of length at least in time and space for . Independently, we give an -time, -space algorithm for a longest -rollercoaster, improving the previous bound. We use the dynamic program of Gawrychowski et al. [STACS 2019, Algorithmica 2022], and process its weighted predecessor queries through monotone subsequences with finger-search trees. Both algorithms return such subsequences.
Preparing the full text