78 research outputs found

    Multivariate Fine-Grained Complexity of Longest Common Subsequence

    Full text link
    We revisit the classic combinatorial pattern matching problem of finding a longest common subsequence (LCS). For strings xx and yy of length nn, a textbook algorithm solves LCS in time O(n2)O(n^2), but although much effort has been spent, no O(n2ε)O(n^{2-\varepsilon})-time algorithm is known. Recent work indeed shows that such an algorithm would refute the Strong Exponential Time Hypothesis (SETH) [Abboud, Backurs, Vassilevska Williams + Bringmann, K\"unnemann FOCS'15]. Despite the quadratic-time barrier, for over 40 years an enduring scientific interest continued to produce fast algorithms for LCS and its variations. Particular attention was put into identifying and exploiting input parameters that yield strongly subquadratic time algorithms for special cases of interest, e.g., differential file comparison. This line of research was successfully pursued until 1990, at which time significant improvements came to a halt. In this paper, using the lens of fine-grained complexity, our goal is to (1) justify the lack of further improvements and (2) determine whether some special cases of LCS admit faster algorithms than currently known. To this end, we provide a systematic study of the multivariate complexity of LCS, taking into account all parameters previously discussed in the literature: the input size n:=max{x,y}n:=\max\{|x|,|y|\}, the length of the shorter string m:=min{x,y}m:=\min\{|x|,|y|\}, the length LL of an LCS of xx and yy, the numbers of deletions δ:=mL\delta := m-L and Δ:=nL\Delta := n-L, the alphabet size, as well as the numbers of matching pairs MM and dominant pairs dd. For any class of instances defined by fixing each parameter individually to a polynomial in terms of the input size, we prove a SETH-based lower bound matching one of three known algorithms. Specifically, we determine the optimal running time for LCS under SETH as (n+min{d,δΔ,δm})1±o(1)(n+\min\{d, \delta \Delta, \delta m\})^{1\pm o(1)}. [...]Comment: Presented at SODA'18. Full Version. 66 page

    Parameterized Lower Bounds for Problems in P via Fine-Grained Cross-Compositions

    Get PDF

    Fine-Grained Complexity Analysis of Two Classic TSP Variants

    Get PDF
    We analyze two classic variants of the Traveling Salesman Problem using the toolkit of fine-grained complexity. Our first set of results is motivated by the Bitonic TSP problem: given a set of nn points in the plane, compute a shortest tour consisting of two monotone chains. It is a classic dynamic-programming exercise to solve this problem in O(n2)O(n^2) time. While the near-quadratic dependency of similar dynamic programs for Longest Common Subsequence and Discrete Frechet Distance has recently been proven to be essentially optimal under the Strong Exponential Time Hypothesis, we show that bitonic tours can be found in subquadratic time. More precisely, we present an algorithm that solves bitonic TSP in O(nlog2n)O(n \log^2 n) time and its bottleneck version in O(nlog3n)O(n \log^3 n) time. Our second set of results concerns the popular kk-OPT heuristic for TSP in the graph setting. More precisely, we study the kk-OPT decision problem, which asks whether a given tour can be improved by a kk-OPT move that replaces kk edges in the tour by kk new edges. A simple algorithm solves kk-OPT in O(nk)O(n^k) time for fixed kk. For 2-OPT, this is easily seen to be optimal. For k=3k=3 we prove that an algorithm with a runtime of the form O~(n3ϵ)\tilde{O}(n^{3-\epsilon}) exists if and only if All-Pairs Shortest Paths in weighted digraphs has such an algorithm. The results for k=2,3k=2,3 may suggest that the actual time complexity of kk-OPT is Θ(nk)\Theta(n^k). We show that this is not the case, by presenting an algorithm that finds the best kk-move in O(n2k/3+1)O(n^{\lfloor 2k/3 \rfloor + 1}) time for fixed k3k \geq 3. This implies that 4-OPT can be solved in O(n3)O(n^3) time, matching the best-known algorithm for 3-OPT. Finally, we show how to beat the quadratic barrier for k=2k=2 in two important settings, namely for points in the plane and when we want to solve 2-OPT repeatedly.Comment: Extended abstract appears in the Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming (ICALP 2016
    corecore