108,043 research outputs found

    Faster space-efficient algorithms for Subset Sum, k -Sum, and related problems

    Get PDF
    We present randomized algorithms that solve subset sum and knapsack instances with n items in Oβˆ— (20.86n) time, where the Oβˆ— (βˆ™ ) notation suppresses factors polynomial in the input size, and polynomial space, assuming random read-only access to exponentially many random bits. These results can be extended to solve binary integer programming on n variables with few constraints in a similar running time. We also show that for any constant k β‰₯ 2, random instances of k-Sum can be solved using O(nk -0.5polylog(n)) time and O(log n) space, without the assumption of random access to random bits.Underlying these results is an algorithm that determines whether two given lists of length n with integers bounded by a polynomial in n share a common value. Assuming random read-only access to random bits, we show that this problem can be solved using O(log n) space significantly faster than the trivial O(n2) time algorithm if no value occurs too often in the same list.</p

    Faster Space-Efficient Algorithms for Subset Sum, k-Sum and Related Problems

    Get PDF
    We present space efficient Monte Carlo algorithms that solve Subset Sum and Knapsack instances with nn items using Oβˆ—(20.86n)O^*(2^{0.86n}) time and polynomial space, where the Oβˆ—(β‹…)O^*(\cdot) notation suppresses factors polynomial in the input size. Both algorithms assume random read-only access to random bits. Modulo this mild assumption, this resolves a long-standing open problem in exact algorithms for NP-hard problems. These results can be extended to solve Binary Linear Programming on nn variables with few constraints in a similar running time. We also show that for any constant kβ‰₯2k\geq 2, random instances of kk-Sum can be solved using O(nkβˆ’0.5polylog(n))O(n^{k-0.5}polylog(n)) time and O(log⁑n)O(\log n) space, without the assumption of random access to random bits. Underlying these results is an algorithm that determines whether two given lists of length nn with integers bounded by a polynomial in nn share a common value. Assuming random read-only access to random bits, we show that this problem can be solved using O(log⁑n)O(\log n) space significantly faster than the trivial O(n2)O(n^2) time algorithm if no value occurs too often in the same list

    Equal-Subset-Sum Faster Than the Meet-in-the-Middle

    Get PDF
    In the Equal-Subset-Sum problem, we are given a set S of n integers and the problem is to decide if there exist two disjoint nonempty subsets A,B subseteq S, whose elements sum up to the same value. The problem is NP-complete. The state-of-the-art algorithm runs in O^*(3^(n/2)) <= O^*(1.7321^n) time and is based on the meet-in-the-middle technique. In this paper, we improve upon this algorithm and give O^*(1.7088^n) worst case Monte Carlo algorithm. This answers a question suggested by Woeginger in his inspirational survey. Additionally, we analyse the polynomial space algorithm for Equal-Subset-Sum. A naive polynomial space algorithm for Equal-Subset-Sum runs in O^*(3^n) time. With read-only access to the exponentially many random bits, we show a randomized algorithm running in O^*(2.6817^n) time and polynomial space

    Deterministic Time-Space Tradeoffs for k-SUM

    Get PDF
    Given a set of numbers, the kk-SUM problem asks for a subset of kk numbers that sums to zero. When the numbers are integers, the time and space complexity of kk-SUM is generally studied in the word-RAM model; when the numbers are reals, the complexity is studied in the real-RAM model, and space is measured by the number of reals held in memory at any point. We present a time and space efficient deterministic self-reduction for the kk-SUM problem which holds for both models, and has many interesting consequences. To illustrate: * 33-SUM is in deterministic time O(n2lg⁑lg⁑(n)/lg⁑(n))O(n^2 \lg\lg(n)/\lg(n)) and space O(nlg⁑(n)lg⁑lg⁑(n))O\left(\sqrt{\frac{n \lg(n)}{\lg\lg(n)}}\right). In general, any polylogarithmic-time improvement over quadratic time for 33-SUM can be converted into an algorithm with an identical time improvement but low space complexity as well. * 33-SUM is in deterministic time O(n2)O(n^2) and space O(n)O(\sqrt n), derandomizing an algorithm of Wang. * A popular conjecture states that 3-SUM requires n2βˆ’o(1)n^{2-o(1)} time on the word-RAM. We show that the 3-SUM Conjecture is in fact equivalent to the (seemingly weaker) conjecture that every O(n.51)O(n^{.51})-space algorithm for 33-SUM requires at least n2βˆ’o(1)n^{2-o(1)} time on the word-RAM. * For kβ‰₯4k \ge 4, kk-SUM is in deterministic O(nkβˆ’2+2/k)O(n^{k - 2 + 2/k}) time and O(n)O(\sqrt{n}) space

    The Flexible Group Spatial Keyword Query

    Full text link
    We present a new class of service for location based social networks, called the Flexible Group Spatial Keyword Query, which enables a group of users to collectively find a point of interest (POI) that optimizes an aggregate cost function combining both spatial distances and keyword similarities. In addition, our query service allows users to consider the tradeoffs between obtaining a sub-optimal solution for the entire group and obtaining an optimimized solution but only for a subgroup. We propose algorithms to process three variants of the query: (i) the group nearest neighbor with keywords query, which finds a POI that optimizes the aggregate cost function for the whole group of size n, (ii) the subgroup nearest neighbor with keywords query, which finds the optimal subgroup and a POI that optimizes the aggregate cost function for a given subgroup size m (m <= n), and (iii) the multiple subgroup nearest neighbor with keywords query, which finds optimal subgroups and corresponding POIs for each of the subgroup sizes in the range [m, n]. We design query processing algorithms based on branch-and-bound and best-first paradigms. Finally, we provide theoretical bounds and conduct extensive experiments with two real datasets which verify the effectiveness and efficiency of the proposed algorithms.Comment: 12 page
    • …
    corecore