Faster Space-Efficient Algorithms for Subset Sum

Slides:



Advertisements
Similar presentations
Optimal Approximations of the Frequency Moments of Data Streams Piotr Indyk David Woodruff.
Advertisements

PRG for Low Degree Polynomials from AG-Codes Gil Cohen Joint work with Amnon Ta-Shma.
A threshold of ln(n) for approximating set cover By Uriel Feige Lecturer: Ariel Procaccia.
Shortest Vector In A Lattice is NP-Hard to approximate
Approximate List- Decoding and Hardness Amplification Valentine Kabanets (SFU) joint work with Russell Impagliazzo and Ragesh Jaiswal (UCSD)
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
1/17 Deterministic Discrepancy Minimization Nikhil Bansal (TU Eindhoven) Joel Spencer (NYU)
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Great Theoretical Ideas in Computer Science.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Computational aspects of stability in weighted voting games Edith Elkind (NTU, Singapore) Based on joint work with Leslie Ann Goldberg, Paul W. Goldberg,
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
1 The Santa Claus Problem (Maximizing the minimum load on unrelated machines) Nikhil Bansal (IBM) Maxim Sviridenko (IBM)
Chapter Complexity of Algorithms –Time Complexity –Understanding the complexity of Algorithms 1.
Great Theoretical Ideas in Computer Science.
A few leftover Decrease-and-conquer Algorithms
Great Theoretical Ideas in Computer Science.
Nattee Niparnan. Recall  Complexity Analysis  Comparison of Two Algos  Big O  Simplification  From source code  Recursive.
Design of Algorithms using Brute Force Approach. Primality Testing (given number is n binary digits)
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
CSC401: Analysis of Algorithms CSC401 – Analysis of Algorithms Chapter Dynamic Programming Objectives: Present the Dynamic Programming paradigm.
Great Theoretical Ideas in Computer Science.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
List Decoding Using the XOR Lemma Luca Trevisan U.C. Berkeley.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Search Algorithms Written by J.J. Shepherd. Sequential Search Examines each element one at a time until the item searched for is found or not found Simplest.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Theory of Computational Complexity Yusuke FURUKAWA Iwama Ito lab M1.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
The Subset-sum Problem
Clustering Data Streams
New Characterizations in Turnstile Streams with Applications
The Design and Analysis of Algorithms
Fast Hamiltonicity Checking via Bases of Perfect Matchings
Hans Bodlaender, Marek Cygan and Stefan Kratsch
CMPS 3130/6130 Computational Geometry Spring 2017
Homomorphic Hashing for Sparse Coefficient Extraction
Sharper Upper Bounds for Unbalanced Uniquely Decodable Code Pairs
Homework 3 As announced: not due today 
Intro to Theory of Computation
Computability and Complexity
Randomized Algorithms CS648
Analysis and design of algorithm
Finding Large Set Covers Faster via the Representation Method
Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas
ICS 353: Design and Analysis of Algorithms
Pseudo-derandomizing learning and approximation
Bin Fu Department of Computer Science
RS – Reed Solomon List Decoding.
Locally Decodable Codes from Lifting
Cryptography Lecture 12 Arpita Patra © Arpita Patra.
K-wise vs almost K-wise permutations, and general group actions
Exponential Time Paradigms Through the Polynomial Time Lens
General Strong Polarization
PTAS for Bin-Packing.
Chapter 11 Limitations of Algorithm Power
Prabhas Chongstitvatana
“(More) Consequences of Falsifying SETH
Cryptographic Hash Functions Part I
On Approximating Covering Integer Programs
Pseudorandom number, Universal Hashing, Chaining and Linear-Probing
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Trevor Brown DC 2338, Office hour M3-4pm
Chapter 8: Overview Comparison sorts: algorithms that sort sequences by comparing the value of elements Prove that the number of comparison required to.
Bin Packing Michael T. Goodrich Some slides adapted from slides from
On Derandomizing Algorithms that Err Extremely Rarely
Treewidth meets Planarity
Presentation transcript:

Faster Space-Efficient Algorithms for Subset Sum Jesper Nederlof (Eindhoven University, Netherlands) Joint work with Nikhil Bansal, Shashwat Garg, and Nikhil Vyas of 11

Subset Sum Given ints 𝑤 1 ,…, 𝑤 𝑛 ,𝑡, is there 𝑋⊆ 𝑛 with 𝑤 𝑋 := 𝑖∈𝑋 𝑤 𝑖 =𝑡? Today: how efficiently can we solve this in the wost case? NP-complete -> exponential time Basic DP [Bellman(50’s)] runs in 𝑂 ∗ (𝑡) time and space What if 𝑡 is huge (i.e 2 𝑛 )? of 11

Meet in the Middle [HS(JACM’74)] Let L=( 𝑤 1 ,…, 𝑤 𝑛/2 ) R=( 𝑤 𝑛/2+1 ,…, 𝑤 𝑛 ) Compute all possible 2 𝑛/2 sums For each v∈𝑥, check v∈𝑦 Sort 𝑦 + binary search in 3: 𝑂 ∗ (2 𝑛/2 ) time and space [SS(SICOMP’81)] improved to 𝑂 ∗ (2 𝑛/2 ) time, 𝑂 ∗ ( 2 𝑛/4 ) space Natural question: can we beat O ∗ ( 2 𝑛 ) using polynomial space? 𝑤 1 ,…, 𝑤 𝑛/2 𝑤 𝑛/2+1 ,…, 𝑤 𝑛 𝑅 𝐿 x = 𝑤 𝑋 𝑋⊆𝐿 y = 𝑡−𝑤 𝑋 𝑋⊆𝑅 of 11

Our contribution Main thm: SSS in 𝑂 ∗ ( 2 0.86𝑛 ) time and poly space, if given a random oracle is given. 010011110010000010100001100001101010010 The oracle stores the random bits for us! Weaker assumption than sufficiently strong PRG’s Algo i’th bit? 𝑝𝑜𝑙𝑦(𝑛) time 0/1 of 11

Our contribution Main thm: SSS in 𝑂 ∗ ( 2 0.86𝑛 ) time and poly space, if given a random oracle is given. Generalization to Knapsack Further generalization to Binary IP with few constraints Random* 3SUM in 𝑂 ( 𝑛 2.5 ) time and 𝑂( log 𝑛 ) space without oracle of 11

Union bound over d events Main Idea Consider w( 2 [𝑛] ) = {𝑤⋅𝑥 : x ∈ 0,1 𝑛 } i.e. all possible 2 𝑛 sums generated by 𝑤= 𝑤 1 ,…, 𝑤 𝑛 Let 𝑑=|𝑤( 2 [𝑛] )| i.e. # distinct possible sums Case 1: If d< 2 0.86𝑛 (few distinct sums) a) Hash mod 𝑂(𝑑), which makes 𝑡= 𝑂 ∗ (𝑑) b) 𝑂 ∗ (𝑡) time DP, but in poly space [LN(STOC’10)] Interpolates 𝑝 𝑥 = 𝑖=1 𝑛 (1+ 𝑥 𝑤 𝑖 ) to find coeff. of 𝑥 𝑡 Consider w( 2 [𝑛] ) = {𝑤⋅𝑥 : x ∈ 0,1 𝑛 } i.e. all possible 2 𝑛 sums generated by 𝑤= 𝑤 1 ,…, 𝑤 𝑛 Let 𝑑=|𝑤( 2 [𝑛] )| i.e. # distinct possible sums Case 1: If d< 2 0.86𝑛 (few distinct sums) a) Hash mod 𝑂(𝑑), which makes t= 𝑂 ∗ (𝑑) b) 𝑂 ∗ (𝑡) time DP, but in poly space [LN(STOC’10)] Case 2: If d > 2 0.86𝑛 (many distinct sums) a) Upper bound max bin size via combinatorics of subset sums b) Use Floyd’s cycle finding (and the oracle ) Union bound over d events of 11

Main Idea Consider w( 2 [𝑛] ) = {𝑤⋅𝑥 : x ∈ 0,1 𝑛 } i.e. all possible 2 𝑛 sums generated by 𝑤= 𝑤 1 ,…, 𝑤 𝑛 Let 𝑑=|𝑤( 2 [𝑛] )| i.e. # distinct possible sums Case 1: If d< 2 0.86𝑛 (few distinct sums) a) Hash mod 𝑂(𝑑), which makes t= 𝑂 ∗ (𝑑) b) 𝑂 ∗ (𝑡) time DP, but in poly space [LN(STOC’10)] Case 2: If d > 2 0.86𝑛 (many distinct sums) a) Upper bound max bin size via combinatorics of subset sums b) Use Floyd’s cycle finding (and the oracle ) of 11

 Main Idea Lemma [AKKN(STACS’16)]: 𝑑⋅ 𝑏 𝑚𝑎𝑥 ≤ 2 1.5𝑛 Case 2: If d > 2 0.86𝑛 (many distinct sums) a) Upper bound max bin size via combinatorics of subset sums  Consider w( 2 [𝑛] ) = {𝑤⋅𝑥 : x ∈ 0,1 𝑛 } i.e. all possible 2 𝑛 sums generated by 𝑤= 𝑤 1 ,…, 𝑤 𝑛 Let 𝑑=|𝑤( 2 [𝑛] )| i.e. # distinct possible sums Case 1: If d< 2 0.86𝑛 (few distinct sums) a) Hash mod 𝑂(𝑑), which makes t= 𝑂 ∗ (𝑑) b) 𝑂 ∗ (𝑡) time DP, but in poly space [LN(STOC’10)] Case 2: If d > 2 0.86𝑛 (many distinct sums) a) Proof max bucket size low via combinatorics of subset sums b) Use Floyd’s cycle finding (and the oracle ) max bin size 𝑏 𝑚𝑎𝑥 = 𝑚𝑎𝑥 𝑣 |{𝑥∈{0,1 } 𝑙 :𝑤⋅𝑥=𝑣}| Lemma [AKKN(STACS’16)]: 𝑑⋅ 𝑏 𝑚𝑎𝑥 ≤ 2 1.5𝑛 𝒘 𝒅 𝒃 𝒎𝒂𝒙 Histogram 0 0 0 0 0 1 32 1 2 4 8 16 Cool add. comb. result Smoothness Subset Sum distrib. Proved via simple connection with `Uniquely Decodable Code Pairs’ As d > 2 0.86𝑛 , 𝑏 𝑚𝑎𝑥 ≤ 2 0.64𝑛 of 11

Meet in the Middle [HS(JACM’74)] Let L=( 𝑤 1 ,…, 𝑤 𝑛/2 ) R=( 𝑤 𝑛/2+1 ,…, 𝑤 𝑛 ) Compute all possible 2 𝑛/2 sums For each v∈𝑥, check v∈𝑦 Sort 𝑦 + binary search in 3: 𝑂 ∗ (2 𝑛/2 ) time and space Looks like the Element Distinctness problem: Given list 𝑧 of 𝑚 ints find two positions with equal ints, if exist Repeat 1. Define z as the concatenation of x and y 2. (Almost) uniformly sample a solution of ED instance 𝑧 3. Check if `fake’ solution or a real SSS solution U = 𝑤 1 ,…, 𝑤 𝑛/2 𝑤 𝑛/2+1 ,…, 𝑤 𝑛 𝑅 𝐿 x = 𝑤 𝑋 𝑋⊆𝐿 y = 𝑡−𝑤 𝑋 𝑋⊆𝑅 5 3 4 3 2 10 7 8 1 6 5 3 4 9 2 10 7 8 1 6 none How many times? 𝑂 #𝑓𝑎𝑘𝑒 𝑠𝑜𝑙𝑠 ≤𝑂( 2 0.89𝑛 ) Using max bin bound!! of 11

Sample solution of ED instance A priori for even finding a solution, 𝑂( 𝑚 2 ) time seems best with polylog 𝑚 space Crucially relies on Floyd’s rho algorithm Thm [BCM(FOCS’13)]: ED in 𝑂 ( 𝑚 1.5 ) time, 𝑂( log 𝑚 ) space, if given random oracle LD: Given two lists 𝑥,𝑦∈ 𝑚 𝑁 , is there a common value? Define 𝑓 𝑥,𝑦 = 𝑣=1 𝑚 |𝑥 −1 𝑣 ​ 2 + |𝑦 −1 𝑣 ​ 2 Refined analysis of [BCM(FOCS’13)]. Sample time 𝑂(𝑚/ 𝑓 ) Thm: LD In 𝑂 𝑚 𝑓 time and 𝑂( log 𝑚 ) space, if given f≥𝑓(𝑥,𝑦) and random oracle of 11

Take-home Messages Cycle finding is a great tool low space algo’s Win/win approach for many/few distinct sums Similar idea useful for other problems? To improve [HS(JACM’74)] it remains to `win’ in the case of few sums Thanks for listening, hope to see you at our poster! of 11