- Research Article
10
- 10.1016/j.dam.2022.03.005
A faster FPTAS for knapsack problem with cardinality constraint
- Apr 04, 2022
- Discrete Applied Mathematics
- Wenxin Li + 2 more +2
A faster FPTAS for knapsack problem with cardinality constraint
We revisit the 3SUM problem in the \emph{preprocessed universes} setting. We present an algorithm that, given three sets $A$, $B$, $C$ of $n$ integers, preprocesses them in quadratic time, so that given any subsets $A' \subseteq A$, $B' \subseteq B$, $C' \subseteq C$, it can decide if there exist $a \in A'$, $b \in B'$, $c \in C'$ with $a+b=c$ in time $O(n^{1.5} \log n)$. In contrast to both the first subquadratic $\tilde{O}(n^{13/7})$-time algorithm by Chan and Lewenstein (STOC 2015) and the current fastest $\tilde{O}(n^{11/6})$-time algorithm by Chan, Vassilevska Williams, and Xu (STOC 2023), which are based on the Balog--Szemerédi--Gowers theorem from additive combinatorics, our algorithm uses only standard 3SUM-related techniques, namely FFT and linear hashing modulo a prime. It is therefore not only faster but also simpler. Just as the two previous algorithms, ours not only decides if there is a single 3SUM solution but it actually determines for each $c \in C'$ if there is a solution containing it. We also modify the algorithm to still work in the scenario where the set $C$ is unknown at the time of preprocessing. Finally, even though the simplest version of our algorithm is randomized, we show how to make it deterministic losing only polylogarithmic factors in the running time. 12 pages. This is the TheoretiCS journal version (invited article from SOSA 2025)
A faster FPTAS for knapsack problem with cardinality constraint
A faster FPTAS for knapsack problem with cardinality constraint
Greedy Localization and Color-Coding: Improved Matching and Packing Algorithms
Matching and packing problems have formed an important class of NP-hard problems. There have been a number of recently developed techniques for parameterized algorithms for these problems, including greedy localization, color-coding plus dynamic programming, and randomized divide-and-conquer. In this paper, we provide further theoretical study on the structures of these problems, and develop improved algorithmic methods that combine existing and new techniques to obtain improved algorithms for matching and packing problems. For the 3-set packing problem, we present a deterministic algorithm of time O *(4.613k), which significantly improves the previous best deterministic algorithm of time O *(12.83k). For the 3-d matching problem, we develop a new randomized algorithm of running time O *(2.323k) and a new deterministic algorithm of running time O *(2.773k). Our randomized algorithm improves the previous best randomized algorithm of running time O *(2.523k), and our deterministic algorithm significantly improves the previous best deterministic algorithm of running time O *(12.83k). Our results also imply improved algorithms for various triangle packing problems in graphs.KeywordsTime ComplexityDynamic ProgrammingMatch ProblemPacking ProblemDynamic Programming AlgorithmThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Read moreSensitive Distance and Reachability Oracles for Large Batch Updates
In the sensitive distance oracle problem, there are three phases. We first preprocess a given directed graph $G$ with $n$ nodes and integer weights from $[-W,W]$. Second, given a single batch of $f$ edge insertions and deletions, we update the data structure. Third, given a query pair of nodes $(u,v)$, return the distance from $u$ to $v$. In the easier problem called sensitive reachability oracle problem, we only ask if there exists a directed path from $u$ to $v$. Our first result is a sensitive distance oracle with $\tilde{O}(Wn^{\omega+(3-\omega)\mu})$ preprocessing time, $\tilde{O}(Wn^{2-\mu}f^{2}+Wnf^{\omega})$ update time, and $\tilde{O}(Wn^{2-\mu}f+Wnf^{2})$ query time where the parameter $\mu\in[0,1]$ can be chosen. The data-structure requires $O(Wn^{2+\mu} \log n)$ bits of memory. This is the first algorithm that can handle $f\ge\log n$ updates. Previous results (e.g. [Demetrescu et al. SICOMP'08; Bernstein and Karger SODA'08 and FOCS'09; Duan and Pettie SODA'09; Grandoni and Williams FOCS'12]) can handle at most 2 updates. When $3\le f\le\log n$, the only non-trivial algorithm was by [Weimann and Yuster FOCS'10]. When $W=\tilde{O}(1)$, our algorithm simultaneously improves their preprocessing time, update time, and query time. In particular, when $f=\omega(1)$, their update and query time is $\Omega(n^{2-o(1)})$, while our update and query time are truly subquadratic in $n$, i.e., ours is faster by a polynomial factor of $n$. To highlight the technique, ours is the first graph algorithm that exploits the kernel basis decomposition of polynomial matrices by [Jeannerod and Villard J.Comp'05; Zhou, Labahn and Storjohann J.Comp'15] developed in the symbolic computation community. [...]
Read moreLabeled Search Trees and Amortized Analysis: Improved Upper Bounds for NP-Hard Problems
A sequence of exact algorithms to solve the Vertex Cover and Maximum Independent Set problems have been proposed in the literature. All these algorithms appeal to a very conservative analysis that considers the size of the search tree, under a worst-case scenario, to derive an upper bound on the running time of the algorithm. In this paper we propose a different approach to analyze the size of the search tree. We use amortized analysis to show how simple algorithms, if analyzed properly, may perform much better than the upper bounds on their running time derived by considering only a worst-case scenario. This approach allows us to present a simple algorithm of running time O(1.194kk2 + n) for the parameterized Vertex Cover problem on degree-3 graphs, and a simple algorithm of running time O(1.1255n) for the Maximum Independent Set problem on degree-3 graphs. Both algorithms improve the previous best algorithms for the problems.
Read moreAn almost 2-approximation for all-pairs of shortest paths in subquadratic time
Let G = (V, E) be an unweighted undirected graph with n vertices and m edges. Dor, Halperin, and Zwick [FOCS 1996, SICOMP 2000] presented an Õ(n2)-time algorithm that computes estimated distances with a multiplicative approximation of 3. Berman and Kasiviswanathan [WADS 2007] improved the approximation of Dor et al. and presented an Õ(n2)-time algorithm that produces for every u, v ϵ V an estimate (u, v) such that: dG(u, v) ≤ (u, v) ≤ 2dG(u, v) + 1. We refer to such an approximation as an (α, β)-approximation, where a is the multiplicative approximation and β is the additive approximation. A prerequisite for an O(n2−ε)-time algorithm, where ε ϵ (0, 1), is a data structure that uses O(n2−δ) space, for some δ ≥ ε, and answers queries in constant time. An O(n2−ε)-time (3, 0)-approximation algorithm became plausible after Thorup and Zwick [STOC 2001, JACM 2005] presented their approximate distance oracles, and in particular an O(n1.5)-space data structure that reports a (3, 0)-approximate distance in O(1) time. Indeed, using Thorup and Zwick distance oracles together with more ideas, Baswana, Gaur, Sen, and Upadhyay [ICALP 2008] improved the running time of Dor et al., and obtained an O(n2−ε) time algorithm, at the cost of introducing also an additive approximation. They presented an algorithm that in Õ(m + n23/12) expected running time constructs an O(n1.5)-space data structure, that in O(1) time reports a (3, 14)-approximate distance. An O(n2−ε)-time (2, 1)-approximation algorithm became plausible only after Pǎtraşcu and Roditty [FOCS 2010, SICOMP 2014] presented an O(n5/3)-space data structure that reports (2, 1)-approximate distances in O(1) time. However, only few years ago, Sommer [ICALP 2016] obtained an Õ(n2) time algorithm that computes a (2, 1)-distance oracle with Õ(n5/3) space. This leads to the following natural question of whether Ω(n2) time is a lower bound for any (3−α, β)-approximation, where α ϵ (0, 1), and β is constant. In this paper we show that this is not the case by presenting an algorithm that for every ε ϵ (0, 1/2) computes in Õ(m) + n2−Ω(ε) time an -space data structure that in O(1/ε) time reports, for every u, v ϵ V, an estimate (u, v) such that: Our result improves, simultaneously, the running time and the multiplicative approximation of the Õ(n2)-time (3, 0)-approximation algorithm of Dor et al. at the cost of introducing also an additive approximation.
Read moreDistributed Random Walks
Performing random walks in networks is a fundamental primitive that has found applications in many areas of computer science, including distributed computing. In this article, we focus on the problem of sampling random walks efficiently in a distributed network and its applications. Given bandwidth constraints, the goal is to minimize the number of rounds required to obtain random walk samples. All previous algorithms that compute a random walk sample of length ℓ as a subroutine always do so naively, that is, in O (ℓ) rounds. The main contribution of this article is a fast distributed algorithm for performing random walks. We present a sublinear time distributed algorithm for performing random walks whose time complexity is sublinear in the length of the walk. Our algorithm performs a random walk of length ℓ in Õ (√ℓ D ) rounds ( Õ hides polylog n factors where n is the number of nodes in the network) with high probability on an undirected network, where D is the diameter of the network. For small diameter graphs, this is a significant improvement over the naive O (ℓ) bound. Furthermore, our algorithm is optimal within a poly-logarithmic factor as there exists a matching lower bound [Nanongkai et al. 2011]. We further extend our algorithms to efficiently perform k independent random walks in Õ (√ k ℓ D + k ) rounds. We also show that our algorithm can be applied to speedup the more general Metropolis-Hastings sampling. Our random-walk algorithms can be used to speed up distributed algorithms in applications that use random walks as a subroutine. We present two main applications. First, we give a fast distributed algorithm for computing a random spanning tree (RST) in an arbitrary (undirected unweighted) network which runs in Õ (√ mD ) rounds with high probability ( m is the number of edges). Our second application is a fast decentralized algorithm for estimating mixing time and related parameters of the underlying network. Our algorithm is fully decentralized and can serve as a building block in the design of topologically-aware networks.
Read moreTree-Adjoining Language Parsing in $O(n^6 )$ Time
In this paper, we present algorithms for parsing general tree-adjoining languages (TALs). Tree-adjoining grammars (TAGs) have been proposed as an elegant formalism for natural languages. It was an open question for the past ten years as to whether TAL parsing can be done in time $O(n^6 )$. We settle this question affirmatively by presenting an $O(n^3 M(n))$-time algorithm, where $M(k)$ is the time needed for multiplying two Boolean matrices of size $k \times k$ each. Since $O(k^{2.376} )$ is the current best-known value for $M(k)$, the time bound of our algorithm is $O(n^{5.376} )$. On an exclusive-read exclusive-write parallel random-access machine (EREW PRAM), our algorithm runs in time $O(n\log n)$ using ${{(n^2 M(n))} / {\log n}}$ processors. In comparison, the best-known previous parallel algorithm had a run time of $O(n)$ using $n^5 $ processors (on a systolic-array machine). We also present algorithms for parsing context-free languages (CFLs) and TALs whose worst-case run times are $O(n^3 )$ and $O(n^6 )$, respectively, but whose average run times are better. Therefore, these algorithms may be of practical interest.
Read moreHow to Achieve an Equivalent Simple Permutation in Linear Time
The problem of Sorting signed permutations by reversals is a well studied problem in computational biology. The first polynomial time algorithm was presented by Hannenhalli and Pevzner in 1995 [5]. The algorithm was improved several times, and nowadays the most efficient algorithm has a subquadratic running time [9,8]. Simple permutations played an important role in the development of these algorithms. Although the latest result of Tannier et al. [8] does not require simple permutations the preliminary version of their algorithm [9] as well as the first polynomial time algorithm of Hannenhalli and Pevzner [5] use the structure of simple permutations. However, the latter algorithms require a precomputation that transforms a permutation into an equivalent simple permutation. To the best of our knowledge, all published algorithms for this transformation have at least a quadratic running time. For further investigations on genome rearrangement problems, the existence of a fast algorithm for the transformation could be crucial. In this paper, we present a linear time algorithm for the transformation.
Read moreParameterized Complexity of Bandwidth on Trees
The bandwidth of a n-vertex graph G is the smallest integer b such that there exists a bijective function f : V(G) → {1,...,n}, called a layout of G, such that for every edge uv ∈ E(G), |f(u) − f(v)| ≤ b. In the Bandwidth problem we are given as input a graph G and integer b, and asked whether the bandwidth of G is at most b. We present two results concerning the parameterized complexity of the Bandwidth problem on trees.First we show that an algorithm for Bandwidth with running time f(b)n o(b) would violate the Exponential Time Hypothesis, even if the input graphs are restricted to be trees of pathwidth at most two. Our lower bound shows that the classical 2O(b) n b + 1 time algorithm by Saxe [SIAM Journal on Algebraic and Discrete Methods, 1980] is essentially optimal.Our second result is a polynomial time algorithm that given a tree T and integer b, either correctly concludes that the bandwidth of T is more than b or finds a layout of T of bandwidth at most b O(b). This is the first parameterized approximation algorithm for the bandwidth of trees.
Read moreAlgorithms for two-agent unbounded serial-batch scheduling with makespan and maximum lateness objectives
<abstract><p>We study the problem of non-preemptively scheduling jobs from two agents on an unbounded serial-batch machine. Agents $ A $ and $ B $ have $ n_A $ and $ n_B $ jobs. The machine can process any number of jobs sequentially as a batch, and the processing time of the batch is equal to the total processing time of the jobs in it. Each batch requires a setup time before it is processed. Compatibility means that the jobs from different agents can be processed in a common batch; Otherwise, the jobs from different agents are incompatible. Both the compatible and incompatible models are considered, under both the batch availability and item availability assumptions. Batch availability means that any job in a batch is not available until all the jobs in this batch are completed. Item availability means that a job in a batch becomes available immediately after it is completed processing. The completion time of a job is defined to be the moment when it is available. The goal is to minimize the makespan of agent $ A $ and the maximum lateness of agent $ B $ simultaneously. For the compatible model with batch availability, an $ O(n_A+n_B^2\log n_B) $-time algorithm is presented which improves the existing $ O(n_A+n_B^4\log n_B) $-time algorithm. A slight modification of the algorithm solves the incompatible model with batch availability in $ O(n_A+n_B^2\log n_B) $ time, which has the same time complexity as the existing algorithm. For the compatible model with item availability, the analysis shows that it is easy and admits an $ O(n_A+n_B\log n_B) $-time algorithm. For the incompatible model with item availability, an $ O(n_A+n_B\log n_B) $-time algorithm is also obtained which improves the existing $ O(n_A+n_B^2) $-time algorithm. The algorithms can generate all Pareto optimal points and find a corresponding Pareto optimal schedule for each Pareto optimal point.</p></abstract>
Read moreA Polynomial Time Constant Approximation For Minimizing Total Weighted Flow-time
We consider the classic scheduling problem of minimizing the total weighted flow-time on a single machine (min-WPFT), when preemption is allowed. In this problem, we are given a set of $n$ jobs, each job having a release time $r_j$, a processing time $p_j$, and a weight $w_j$. The flow-time of a job is defined as the amount of time the job spends in the system before it completes; that is, $F_j = C_j - r_j$, where $C_j$ is the completion time of job. The objective is to minimize the total weighted flow-time of jobs. This NP-hard problem has been studied quite extensively for decades. In a recent breakthrough, Batra, Garg, and Kumar presented a {\em pseudo-polynomial} time algorithm that has an $O(1)$ approximation ratio. The design of a truly polynomial time algorithm, however, remained an open problem. In this paper, we show a transformation from pseudo-polynomial time algorithms to polynomial time algorithms in the context of min-WPFT. Our result combined with the result of Batra, Garg, and Kumar settles the long standing conjecture that there is a polynomial time algorithm with $O(1)$-approximation for min-WPFT.
Read moreA near-linear time algorithm for constructing a cactus representation of minimum cuts
We present an O(m) (near-linear) time Monte Carlo algorithm for constructing the cactus data structure, a useful representation of all the global minimum edge cuts of an undirected graph. Our algorithm represents a fundamental improvement over the best previous (quadratic time) algorithms: because there can be quadratically many min-cuts, our algorithm must avoid looking at all min-cuts during the construction, but nonetheless builds a data structure representing them all. Our result closes the gap between the (near-linear) time required to find a single min-cut and that for (implicitly) finding all the min-cuts.
Read moreDeterministic Rectangle Enclosure and Offline Dominance Reporting on the RAM
We revisit a classical problem in computational geometry that has been studied since the 1980s: in the rectangle enclosure problem we want to report all k enclosing pairs of n input rectangles in 2D. We present the first deterministic algorithm that takes O(nlogn + k) worst-case time and O(n) space in the word-RAM model. This improves previous deterministic algorithms with O((nlogn + k)loglogn) running time. We achieve the result by derandomizing the algorithm of Chan, Larsen and Pătraşcu [SoCG’11] that attains the same time complexity but in expectation.The 2D rectangle enclosure problem is related to the offline dominance range reporting problem in 4D, and our result leads to the currently fastest deterministic algorithm for offline dominance reporting in any constant dimension d ≥ 4.A key tool behind Chan et al.’s previous randomized algorithm is shallow cuttings for 3D dominance ranges. Recently, Afshani and Tsakalidis [SODA’14] obtained a deterministic O(nlogn)-time algorithm to construct such cuttings. We first present an improved deterministic construction algorithm that runs in O(nloglogn) time in the word-RAM; this result is of independent interest. Many additional ideas are then incorporated, including a linear-time algorithm for merging shallow cuttings and an algorithm for an offline tree point location problem.KeywordsQuery PointDeterministic AlgorithmInput PointOuter CornerPlanar SeparatorThese keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Read moreMore on change-making and related problems
More on change-making and related problems
On the Fine-Grained Complexity of the Unbounded SubsetSum and the Frobenius Problem
Consider positive integral solutions to the equation a0x0 + … + anxn = t. In the so called unbounded subset sum problem, the objective is to decide whether such a solution exists, whereas in the Frobenius problem, the objective is to compute the largest t such that there is no such solution. In this paper we study the algorithmic complexity of the unbounded subset sum, the Frobenius problem and a generalization of both problems. More precisely, we study pseudo-polynomial time algorithms with a running time that depends on the smallest number a0 or respectively the largest number an. For the parameter a0, we show that all considered problems are subquadratically equivalent to (min, +)-convolution, a fundamental algorithmic problem from the area of fine-grained complexity. By this equivalence, we obtain hardness results for the considered problems (based on the assumption that an algorithm with a subquadratic running time for (min, +)-convolution does not exist) as well as algorithms with improved running time. The proof for the equivalence makes use of structural properties of solutions, a technique that was developed in the area of integer programming. In case of the complexity of the problems parameterized by an, we present improved algorithms. For example we give a quasi linear time algorithm for the Frobenius problem as well as a hardness result based on the strong exponential time hypothesis.
Read more