The subject of this paper is the time complexity of approximating Knapsack, Subset Sum, Partition, and some other related problems. The main result is an $\widetilde{O}(n+1/\varepsilon^{5/3})$ time randomized FPTAS for Partition, which is derived from a certain relaxed form of a randomized FPTAS for Subset Sum. To the best of our knowledge, this is the first NP-hard problem that has been shown to admit a subquadratic time approximation scheme, i.e., one with time complexity of $O((n+1/\varepsilon)^{2-δ})$ for some $δ>0$. To put these developments in context, note that a quadratic FPTAS for \partition has been known for 40 years.
Our main contribution lies in designing a mechanism that reduces an instance of Subset Sum to several simpler instances, each with some special structure, and keeps track of interactions between them. This allows us to combine techniques from approximation algorithms, pseudo-polynomial algorithms, and additive combinatorics.
We also prove several related results. Notably, we improve approximation schemes for 3SUM, (min,+)-convolution, and Tree Sparsity. Finally, we argue why breaking the quadratic barrier for approximate Knapsack is unlikely by giving an $Ω((n+1/\varepsilon)^{2-o(1)})$ conditional lower bound.
Approximating Subset Sum is a classic and fundamental problem in computer science and mathematical optimization. The state-of-the-art approximation scheme for Subset Sum computes a $(1-\varepsilon)$-approximation in time $\tilde{O}(\min\{n/\varepsilon, n+1/\varepsilon^2\})$ [Gens, Levner'78, Kellerer et al.'97]. In particular, a $(1-1/n)$-approximation can be computed in time $O(n^2)$. We establish a connection to Min-Plus-Convolution, a problem that is of particular interest in fine-grained complexity theory and can be solved naively in time $O(n^2)$. Our main result is that computing a $(1-1…
In this paper we provide a $\tilde{O}(m\sqrt{n})$ time algorithm that computes a $3$-multiplicative approximation of the girth of a $n$-node $m$-edge directed graph with non-negative edge lengths. This is the first algorithm which approximates the girth of a directed graph up to a constant multiplicative factor faster than All-Pairs Shortest Paths (APSP) time, i.e. $O(mn)$. Additionally, for any integer $k \ge 1$, we provide a deterministic algorithm for a $O(k\log\log n)$-multiplicative approximation to the girth in directed graphs in $\tilde{O}(m^{1+1/k})$ time. Combining the techniques from…
Consider the following distance query for an $n$-node graph $G$ undergoing edge insertions and deletions: given two sets of nodes $I$ and $J$, return the distances between every pair of nodes in $I\times J$. This query is rather general and captures several versions of the dynamic shortest paths problem. In this paper, we develop an efficient $(1+ε)$-approximation algorithm for this query using fast matrix multiplication. Our algorithm leads to answers for some open problems for Single-Source and All-Pairs Shortest Paths (SSSP and APSP), as well as for Diameter, Radius, and Eccentricities. Bel…
Longest common subsequence ($\mathsf{LCS}$) is a classic and central problem in combinatorial optimization. While $\mathsf{LCS}$ admits a quadratic time solution, recent evidence suggests that solving the problem may be impossible in truly subquadratic time. A special case of $\mathsf{LCS}$ wherein each character appears at most once in every string is equivalent to the longest increasing subsequence problem ($\mathsf{LIS}$) which can be solved in quasilinear time. In this work, we present novel algorithms for approximating $\mathsf{LCS}$ in truly subquadratic time and $\mathsf{LIS}$ in truly …
This paper investigates the approximability of the Longest Common Subsequence (LCS) problem. The fastest algorithm for solving the LCS problem exactly runs in essentially quadratic time in the length of the input, and it is known that under the Strong Exponential Time Hypothesis the quadratic running time cannot be beaten. There are no such limitations for the approximate computation of the LCS however, except in some limited scenarios. There is also a scarcity of approximation algorithms. When the two given strings are over an alphabet of size $k$, returning the subsequence formed by the most…
We consider the classic problem of computing the Longest Common Subsequence (LCS) of two strings of length $n$. While a simple quadratic algorithm has been known for the problem for more than 40 years, no faster algorithm has been found despite an extensive effort. The lack of progress on the problem has recently been explained by Abboud, Backurs, and Vassilevska Williams [FOCS'15] and Bringmann and Künnemann [FOCS'15] who proved that there is no subquadratic algorithm unless the Strong Exponential Time Hypothesis fails. This has led the community to look for subquadratic approximation algorit…
Dynamic time warping distance (DTW) is a widely used distance measure between time series. The best known algorithms for computing DTW run in near quadratic time, and conditional lower bounds prohibit the existence of significantly faster algorithms. The lower bounds do not prevent a faster algorithm for the special case in which the DTW is small, however. For an arbitrary metric space $Σ$ with distances normalized so that the smallest non-zero distance is one, we present an algorithm which computes $\operatorname{dtw}(x, y)$ for two strings $x$ and $y$ over $Σ$ in time $O(n \cdot \operatornam…
On sparse graphs, Roditty and Williams [2013] proved that no $O(n^{2-\varepsilon})$-time algorithm achieves an approximation factor smaller than $\frac{3}{2}$ for the diameter problem unless SETH fails. In this article, we solve an open question formulated in the literature: can we use the structural properties of median graphs to break this global quadratic barrier? We propose the first combinatiorial algorithm computing exactly all eccentricities of a median graph in truly subquadratic time. Median graphs constitute the family of graphs which is the most studied in metric graph theory becaus…
The edit distance between two strings is defined as the smallest number of insertions, deletions, and substitutions that need to be made to transform one of the strings to another one. Approximating edit distance in subquadratic time is "one of the biggest unsolved problems in the field of combinatorial pattern matching". Our main result is a quantum constant approximation algorithm for computing the edit distance in truly subquadratic time. More precisely, we give an $O(n^{1.858})$ quantum algorithm that approximates the edit distance within a factor of $7$. We further extend this result to a…
The Longest Common Subsequence (LCS) of two strings is a fundamental string similarity measure with a classical dynamic programming solution taking quadratic time. Despite significant efforts, little progress was made in improving the runtime. Even in the realm of approximation, not much was known for linear time algorithms beyond the trivial $\sqrt{n}$-approximation. Recent breakthrough result provided a $n^{0.497}$-factor approximation algorithm [HSSS19], which was more recently improved to a $n^{0.4}$-factor one [BCD21]. The latter paper also showed a $n^{2-2.5α}$ time algorithm which outpu…
Longest common subsequence (LCS) is one of the most fundamental problems in combinatorial optimization. Apart from theoretical importance, LCS has enormous applications in bioinformatics, revision control systems, and data comparison programs. Although a simple dynamic program computes LCS in quadratic time, it has been recently proven that the problem admits a conditional lower bound and may not be solved in truly subquadratic time. In addition to this, LCS is notoriously hard with respect to approximation algorithms. Apart from a trivial sampling technique that obtains a $n^{x}$ approximatio…
Given a graph $G = (V, E)$, the $3$-path partition problem is to find a minimum collection of vertex-disjoint paths each of order at most $3$ to cover all the vertices of $V$. It is different from but closely related to the well-known $3$-set cover problem. The best known approximation algorithm for the $3$-path partition problem was proposed recently and has a ratio $13/9$. Here we present a local search algorithm and show, by an amortized analysis, that it is a $4/3$-approximation. This ratio matches up to the best approximation ratio for the $3$-set cover problem.
Given a directed graph $G = (V, E)$, the $k$-path partition problem is to find a minimum collection of vertex-disjoint directed paths each of order at most $k$ to cover all the vertices of $V$. The problem has various applications in facility location, network monitoring, transportation and others. Its special case on undirected graphs has received much attention recently, but the general directed version is seemingly untouched in the literature. We present the first $k/2$-approximation algorithm, for any $k \ge 3$, based on a novel concept of augmenting path to minimize the number of singleto…
Several algorithms with an approximation guarantee of $O(\log n)$ are known for the Set Cover problem, where $n$ is the number of elements. We study a generalization of the Set Cover problem, called the Partition Set Cover problem. Here, the elements are partitioned into $r$ \emph{color classes}, and we are required to cover at least $k_t$ elements from each color class $\mathcal{C}_t$, using the minimum number of sets. We give a randomized LP-rounding algorithm that is an $O(β+ \log r)$ approximation for the Partition Set Cover problem. Here $β$ denotes the approximation guarantee for a relat…
The arboricity $Γ$ of a graph is the minimum number of forests its edge set can be partitioned into. Previous approximation schemes were nonconstructive, i.e., they only approximated the arboricity as a value without computing a corresponding forest partition. This is because they operate on the related pseudoforest partitions or the dual problem of finding dense subgraphs. We propose an algorithm for converting a partition of $k$ pseudoforests into a partition of $k+1$ forests in $O(mk\log k + m \log n)$ time with a data structure by Brodal and Fagerberg that stores graphs of arboricity $k$. …
Our motivation is to improve on the best approximation guarantee known for the problem of finding a minimum-cost 2-node connected spanning subgraph of a given undirected graph with nonnegative edge costs. We present an LP (Linear Programming) relaxation based on partition constraints. The special case where the input contains a spanning tree of zero cost is called 2NC-TAP. We present a greedy algorithm for 2NC-TAP, and we analyze it via dual-fitting for our partition LP relaxation. Keywords: 2-node connected graphs, approximation algorithms, connectivity augmentation, greedy algorithm, network…
Given an $n$-vertex $m$-edge graph $G$ with non negative edge-weights, the girth of $G$ is the weight of a shortest cycle in $G$. For any graph $G$ with polynomially bounded integer weights, we present a deterministic algorithm that computes, in $\tilde{\cal O}(n^{5/3}+m)$-time, a cycle of weight at most twice the girth of $G$. Our approach combines some new insights on the previous approximation algorithms for this problem (Lingas and Lundell, IPL'09; Roditty and Tov, TALG'13) with Hitting Set based methods that are used for approximate distance oracles and date back from (Thorup and Zwick, J…
We consider the problem of estimating the partition function $Z(β)=\sum_x \exp(-β(H(x))$ of a Gibbs distribution with a Hamilton $H(\cdot)$, or more precisely the logarithm of the ratio $q=\ln Z(0)/Z(β)$. It has been recently shown how to approximate $q$ with high probability assuming the existence of an oracle that produces samples from the Gibbs distribution for a given parameter value in $[0,β]$. The current best known approach due to Huber [9] uses $O(q\ln n\cdot[\ln q + \ln \ln n+\varepsilon^{-2}])$ oracle calls on average where $\varepsilon$ is the desired accuracy of approximation and $…
In this paper, we provide new approximation algorithms for dynamic variations of the longest increasing subsequence (\textsf{LIS}) problem, and the complementary distance to monotonicity (\textsf{DTM}) problem. In this setting, operations of the following form arrive sequentially: (i) add an element, (ii) remove an element, or (iii) substitute an element for another. At every point in time, the algorithm has an approximation to the longest increasing subsequence (or distance to monotonicity). We present a $(1+ε)$-approximation algorithm for \textsf{DTM} with polylogarithmic worst-case update t…
We describe the first strongly subquadratic time algorithm with subexponential approximation ratio for approximately computing the Fréchet distance between two polygonal chains. Specifically, let $P$ and $Q$ be two polygonal chains with $n$ vertices in $d$-dimensional Euclidean space, and let $α\in [\sqrt{n}, n]$. Our algorithm deterministically finds an $O(α)$-approximate Fréchet correspondence in time $O((n^3 / α^2) \log n)$. In particular, we get an $O(n)$-approximation in near-linear $O(n \log n)$ time, a vast improvement over the previously best know result, a linear time $2^{O(n)}$-appro…
We give a constant-factor approximation algorithm for the asymmetric traveling salesman problem (ATSP). Our approximation guarantee is analyzed with respect to the standard LP relaxation, and thus our result confirms the conjectured constant integrality gap of that relaxation. The main idea of our approach is a reduction to Subtour Partition Cover, an easier problem obtained by significantly relaxing the general connectivity requirements into local connectivity conditions. We first show that any algorithm for Subtour Partition Cover can be turned into an algorithm for ATSP while only losing a …
Given a simple connected graph $G = (V, E)$, we seek to partition the vertex set $V$ into $k$ non-empty parts such that the subgraph induced by each part is connected, and the partition is maximally balanced in the way that the maximum cardinality of these $k$ parts is minimized. We refer this problem to as {\em min-max balanced connected graph partition} into $k$ parts and denote it as {\sc $k$-BGP}. The general vertex-weighted version of this problem on trees has been studied since about four decades ago, which admits a linear time exact algorithm; the vertex-weighted {\sc $2$-BGP} and {\sc …
Zero-free based algorithm is a major technique for deterministic approximate counting. In Barvinok's original framework[Bar17], by calculating truncated Taylor expansions, a quasi-polynomial time algorithm was given for estimating zero-free partition functions. Patel and Regts[PR17] later gave a refinement of Barvinok's framework, which gave a polynomial-time algorithm for a class of zero-free graph polynomials that can be expressed as counting induced subgraphs in bounded-degree graphs. In this paper, we give a polynomial-time algorithm for estimating classical and quantum partition functions…
Partitioning a connected graph into $k$~vertex-disjoint connected subgraphs of similar (or given) orders is a classical problem that has been intensively investigated since late seventies. Given a connected graph $G=(V,E)$ and a weight function $w : V \to \mathbb{Q}_\geq$, a connected $k$-partition of $G$ is a partition of $V$ such that each class induces a connected subgraph. The balanced connected $k$-partition problem consists in finding a connected $k$-partition in which every class has roughly the same weight. To model this concept of balance, one may seek connected $k$-partitions that ei…
Variational approximation, such as mean-field (MF) and tree-reweighted (TRW), provide a computationally efficient approximation of the log-partition function for a generic graphical model. TRW provably provides an upper bound, but the approximation ratio is generally not quantified. As the primary contribution of this work, we provide an approach to quantify the approximation ratio through the property of the underlying graph structure. Specifically, we argue that (a variant of) TRW produces an estimate that is within factor $\frac{1}{\sqrt{κ(G)}}$ of the true log-partition function for any di…
We consider the SUBSET SUM problem and its important variants in this paper. In the SUBSET SUM problem, a (multi-)set $X$ of $n$ positive numbers and a target number $t$ are given, and the task is to find a subset of $X$ with the maximal sum that does not exceed $t$. It is well known that this problem is NP-hard and admits fully polynomial-time approximation schemes (FPTASs). In recent years, it has been shown that there does not exist an FPTAS of running time $\tilde\OO( 1/ε^{2-δ})$ for arbitrary small $δ>0$ assuming ($\min$,+)-convolution conjecture~\cite{bringmann2021fine}. However, the low…
We study approximations of the partition function of dense graphical models. Partition functions of graphical models play a fundamental role is statistical physics, in statistics and in machine learning. Two of the main methods for approximating the partition function are Markov Chain Monte Carlo and Variational Methods. An impressive body of work in mathematics, physics and theoretical computer science provides conditions under which Markov Chain Monte Carlo methods converge in polynomial time. These methods often lead to polynomial time approximation algorithms for the partition function in …
We study the problem of approximating the partition function of the ferromagnetic Ising model in graphs and hypergraphs. Our first result is a deterministic approximation scheme (an FPTAS) for the partition function in bounded degree graphs that is valid over the entire range of parameters $β$ (the interaction) and $λ$ (the external field), except for the case $\vertλ\vert=1$ (the "zero-field" case). A randomized algorithm (FPRAS) for all graphs, and all $β,λ$, has long been known. Unlike most other deterministic approximation algorithms for problems in statistical physics and counting, our al…
The Longest Common Subsequence (LCS) is a fundamental string similarity measure, and computing the LCS of two strings is a classic algorithms question. A textbook dynamic programming algorithm gives an exact algorithm in quadratic time, and this is essentially best possible under plausible fine-grained complexity assumptions, so a natural problem is to find faster approximation algorithms. When the inputs are two binary strings, there is a simple $\frac{1}{2}$-approximation in linear time: compute the longest common all-0s or all-1s subsequence. It has been open whether a better approximation …