Download presentation
Presentation is loading. Please wait.
Published byPatricia Malone Modified over 6 years ago
1
Faster Space-Efficient Algorithms for Subset Sum
Jesper Nederlof (Eindhoven University, Netherlands) Joint work with Nikhil Bansal, Shashwat Garg, and Nikhil Vyas of 11
2
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
3
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
4
Our contribution Main thm: SSS in π β ( π ) time and poly space, if given a random oracle is given. The oracle stores the random bits for us! Weaker assumption than sufficiently strong PRGβs Algo iβth bit? ππππ¦(π) time 0/1 of 11
5
Our contribution Main thm: SSS in π β ( π ) 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
6
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< π (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< π (few distinct sums) a) Hash mod π(π), which makes t= π β (π) b) π β (π‘) time DP, but in poly space [LN(STOCβ10)] Case 2: If d > π (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
7
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< π (few distinct sums) a) Hash mod π(π), which makes t= π β (π) b) π β (π‘) time DP, but in poly space [LN(STOCβ10)] Case 2: If d > π (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
8
οΎ Main Idea Lemma [AKKN(STACSβ16)]: πβ
π πππ₯ β€ 2 1.5π
Case 2: If d > π (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< π (few distinct sums) a) Hash mod π(π), which makes t= π β (π) b) π β (π‘) time DP, but in poly space [LN(STOCβ10)] Case 2: If d > π (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 1 32 Cool add. comb. result Smoothness Subset Sum distrib. Proved via simple connection with `Uniquely Decodable Code Pairsβ As d > π , π πππ₯ β€ π of 11
9
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 = π‘βπ€ π πβπ
none How many times? π #ππππ π πππ β€π( π ) Using max bin bound!! of 11
10
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.