Download presentation
Presentation is loading. Please wait.
Published byBudi Hermawan Modified over 6 years ago
1
Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas
Faster Space-Efficient Algorithms for Subset Sum, k-Sum and related problems (available at arXiv: ) Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas disclaimer: no turtles or hares were harmed during this research
2
Subset Sum Algo iβth bit? 0/1
Subset Sum Given integers π€ 1 ,β¦, π€ π ,π‘ find πβ π with πβπ π€ π =π‘ π(ππ‘) time by DP π π+π‘ randomized time B(SODAβ17) π (ππ‘) randomized time, poly space B(SODAβ17) π β (2 π ) time, poly space ( π β omits poly factors in input) π β (2 π/2 ) time, π β ( 2 π/2 ) space HS(JACM72) π β (2 π/2 ) time, π β ( 2 π/4 ) space SS(SICOMP81) Can solve any instance in either π β ( π ) time or π β ( π ) time and poly space AKKN(STACSβ16) Algo iβth bit? ππππ¦(π) time 0/1 Main Result: There is a Monte Carlo algorithm for Subset Sum using π β ( π ) time and poly space, assuming random read-only access to random bits
3
BCM:Element Distinctness Crypto: List merging
Floyd: Cycle Finding BCM (FOCS13): Shuffle function HS (JACM72): MitM BCM:Element Distinctness Crypto: List merging AKKN (STACS16): Subset Sum distribution is smooth LN(STOC10): Save space with DFT Hash mod p List Disjointness (with small freqs2) Subset Sum (many distinct sums) Subset Sum (few distinct sums) Subset Sum
4
BCM:Element Distinctness
Floyd: Cycle Finding BCM (FOCS13): Shuffle function BCM:Element Distinctness
5
Element Distinctness (ED): BCM(FOCS13)
Given zβ π π with πβ€ππππ¦(π), are all values distinct? Unlimited space: π (π) time (sort) π( log π ) space: π ( π 2 ) time (brute-force) Suppose π§ β π
π π ; find a repeated value-pair whp Unlimited space: π ( π ) time ( π ( π ) samples) π( πππ π ) space: π (π) time ( π (1) samples and compare) Theorem(BCM): π (π 1.5 ) time, π( log π ) space, assuming random read-only access to random bits Weβll first see π ( π ) time, π( log π ) space if π§ β π
π π Approach: set π π = π§ π , and use cycle finding to find πβ π such that π π =π π
6
Floydβs Cycle Finding s Finds such π,π using little space
Basic algo in crypto, much more obscure in TCS View π as digraph (with arcs (π,π(π))) s
7
Floydβs Cycle Finding i s j Finds such π,π using little space
Basic algo in crypto, much more obscure in TCS View π as digraph (with arcs (π,π(π))) i s j T = #steps turtle in first round (6 in ex) p= stem-length (3 in ex), q=cycle length (6 in ex) 2T=T+xq -> T=xq -> T+p=xq+p
8
Floydβs Cycle Finding i s j Finds such π,π using little space
Basic algo in crypto, much more obscure in TCS View π as digraph (with arcs (π,π(π))) i s j Only works if start outside cycle! Works well assuming π is random: π and π are π( π ) whp (birthday paradox)
9
`Shufflingβ f Theorem(BCM): π (π 1.5 ) time, π( log π ) space, assuming random read-only access to random bits What if π is not random? Answer: `shuffleβ π Let β: π β[π] be a random function Cannot remember β, but use assumed oracle Define π π =β π§ π Use Floyd to sample πβ π such that π π =π(π) Call π,π a bad pair if β π§ π =β( π§ π ) but π§ π β π§ π Expect at most π 2 /π bad pairs Using π π samples, expect to see real solution
10
BCM:Element Distinctness
Floyd: Cycle Finding BCM (FOCS13): Shuffle function List Disjointness (with small freqs2) Crypto: List merging BCM:Element Distinctness
11
List Disjointness Given two lists π₯,π¦β π π , πβ€ππππ¦(π)
Asked do they share a common value? π₯=(1, 9, 2, 4, 9, 4, 6, 5, 2) π¦=(7, 8, 5, 0, 3, 7, 3, 0, 8) Very similar to ED; but want values from different lists Define π π₯ = π£β[π] |π₯ β1 π£ β 2 ; i.e p π¦ =1+4β
π π₯,π¦ =π π₯ +π π¦ Counts number of pseudo-solutions Theorem: There is an π n π time, π( log π ) space algorithm for List Disjointness, if given π π₯,π¦ β€π assuming random read-only access to random bits
12
List Disjointness Define π§β π π by merging π₯,π¦
Theorem: There is an π n π time, π( log π ) space algorithm for List Disjointness, if given π π₯,π¦ β€π assuming random read-only access to random bits Define π§β π π by merging π₯,π¦ E.g. just concatenate π₯ and π¦ In paper we set π§ π := π₯ π or π§ π := π¦ π with prob 1/2 Sample π,π such that π π =π(π) as before If π§ π =π§(π) and πβ π, also check π₯ π = π¦ π or π₯ π = π¦ π Need π(π₯,π¦) samples Expect π(π/ π(π₯,π¦) ) vertices needed for a sample
13
BCM:Element Distinctness
Floyd: Cycle Finding BCM (FOCS13): Shuffle function HS (JACM72): MitM BCM:Element Distinctness Crypto: List merging List Disjointness (with small freqs2) Subset Sum (many distinct sums)
14
πΏ π
Meet in the Middle Ints π€ 1 ,β¦, π€ π ,π‘. Denote w π β πβπ π€ π
Reduce SSS on π integers to List Disjointness on lists of length 2 π/2 ; run the sorting algo πΏ π
π€ 1 ,β¦, π€ π/2 , π€ π/2+1 ,β¦, π€ π π₯= π€ π πβπΏ π¦= π‘βπ€ π πβπ
LD instance solved in π( 2 π/2 polylog ( 2 π/2 ) ) time, which is O β ( 2 π/2 ). Also uses 2 π/2 space
15
πΏ π
Meet in the Middle new Ints π€ 1 ,β¦, π€ π ,π‘. Denote w π β πβπ π€ π
Reduce SSS on π integers to List Disjointness on lists of length 2 π/2 ; run the sorting algo. new πΏ π
π€ 1 ,β¦, π€ π/2 , π€ π/2+1 ,β¦, π€ π π₯= π€ π πβπΏ π¦= π‘βπ€ π πβπ
π β 1 space, π β ( 2 π/2 π ) time π π₯ = {π,πβπΏ:π€ π =π€ π } β€ 2 π If π€ π =0, π π₯ ,π π¦ = 2 π -> 2 π time ο How do instances with π π₯ β₯ π look?
16
BCM:Element Distinctness Crypto: List merging
Floyd: Cycle Finding BCM (FOCS13): Shuffle function HS (JACM72): MitM BCM:Element Distinctness Crypto: List merging AKKN (STACS16): Subset Sum distribution is smooth List Disjointness (with small freqs2) Subset Sum (many distinct sums)
17
Subset Sum Distribution is smooth (AKKN)
Lemma: π π₯ β
|{π€ π :πβπΏ}|β€ 6 π/2 Note: 6 π/2 < 2 1.3π π π³ π(π) |{π πΏ :πΏβπ³}| Histogram 32 2 1 32β
1 2 32 6β
β
β
3 2 =76 16
18
Subset Sum Distribution is smooth (AKKN)
Lemma: π π₯ β
|{π€ π :πβπΏ}|β€ 6 π/2 Note: 6 π/2 < 2 1.3π We use this as follows: Suppose π€ π :πβ π β₯ π then π€ π :πβπΏ β₯ π and thus π π₯ β€ 6 π/2 / π β€ π Cor: If π€ π :πβ π β₯ π , can solve SSS in π β (2 π/ π )= π β ( π ) time and poly space, assuming random read-only access to random bits Proof of Lemma uses a connection to UDCPβs
19
Uniquely Decodable Code Pairs (UDCP)
Pair π 1 , π 2 β{0,1 } π s.t. π 1 + π 2 = π 1 | π 2 |. π 1 + π 2 ={x+y: x,y β π 1 Γ π 2 }, x+y is addition over β€ π . 1 π 1 ?? 2 1 π 2 1
20
Uniquely Decodable Code Pairs (UDCP)
Pair π 1 , π 2 β{0,1 } π s.t. π 1 + π 2 = π 1 | π 2 |. π 1 ={10,01}, π 2 ={00,01,11} is UDCP: π 1 + π 2 ={10,11,21,01,02,12} π 1 + π 2 β€ { 0,1,2} π β€ 3 π Side remark: In general π 1 || π 2 β€ 2 1.5π is best known (elegant upper bound, might tell afterwards)
21
Subset Sum Distribution is smooth (AKKN)
Lemma: π π₯ β
|{π€ π :πβπΏ}|β€ 6 π/2 There exists a frequent sum π s.t. B v ={π₯β 0,1 π/2 :π€β
π₯ =π£}; π π₯ β€ π΅ π£ 2 π/2 Let π΄β{ 0,1} π/2 be such that for all π 1 , π 2 βπ΄ π 1 β
π€= π 2 β
π€ implies π 1 = π 2 Then |π΄+ π΅ π£ |= π΄ β
| π΅ π£ | (i.e. π΄, π΅ π£ is a UDCP): Suppose π 1 + π 1 = π 2 + π 2 (add in β€ π/2 ) Thus π΄ β
π΅ π£ = π΄+ π΅ π£ β€ 3 π/2 lemma follows: π π₯ π΄ β€ π΅ π£ 2 π/2 π΄ β€ 6 π/2 π€β
(π 1 + π€β
π 1 )= π€β
(π 2 +π€β
π 2 ) π€β
π 1 + π€β
π 1 )= π€β
π 2 +π€β
π 2 ) π€β
π 1 + π€β
π¦ 1 )= π€β
π 2 +π€β
π¦ 2 ) π€β
(π 1 + π€β
π 1 )= π€β
(π 2 +π€β
π 2 ) β π 1 = π 2 β π 1 = π 2
22
BCM:Element Distinctness Crypto: List merging
Floyd: Cycle Finding BCM (FOCS13): Shuffle function HS (JACM72): MitM BCM:Element Distinctness Crypto: List merging AKKN (STACS16): Subset Sum distribution is smooth List Disjointness (with small freqs2) Hash mod p + DFT Subset Sum (many distinct sums) Subset Sum (few distinct sums) Subset Sum
23
Subset Sum with few Distinct Sums
Lemma: Can solve instance π€ 1 ,β¦, π€ π ,π‘ in time O β ( π€ π :πβ π ) and poly space. Done by hashing numbers mod a prime of order π€ π :πβ π and run π β π‘ time π β (1) space algorithm, that uses DFT. Combining with previous lemma we obtain Main Resultβ: There is a Monte Carlo for Subset Sum using π β ( π ) time and poly space, assuming random read-only access to random bits Omitted optimization to get the π β ( π )
24
BCM:Element Distinctness Crypto: List merging
Floyd: Cycle Finding BCM (FOCS13): Shuffle function HS (JACM72): MitM BCM:Element Distinctness Crypto: List merging AKKN (STACS16): Subset Sum distribution is smooth List Disjointness (with small freqs2) Hash mod p + DFT Random k-Sum Subset Sum (many distinct sums) Subset Sum (few distinct sums) Subset Sum Knapsack & Binary Linear Programming NvdZvL (MFCS12):Reduce without adding variables
25
Further Results Using reduction to Subset Sum NvLvdZ (MFCSβ12)
Theorem: Binary LP on π vars, π constraints, max int π in time π β π log ππ π π π and poly space, assuming random read-only access to random bits Using reduction to Subset Sum NvLvdZ (MFCSβ12) Established by simple recursive rounding scheme Time/space tradeoffs for List Disjointness By extending techniques from BCM List Disjointness in π (π π/π ) time given π β€ π 2 /π space Theorem: Random 3-Sum in π ( π 2.5 ) time and log π space if ints independently and u.a.r from [π] with πβ€ππππ¦(π) being a multiple of π
26
Further Research How strong is random oracle assumption exactly?
Weaker than the existence of sufficiently strong PRGβs Still donβt know exact (low-space) complexity of ED!! Can we do something specific for SSS? Solve Subset Sum in time π β βπ π Can restrict to π€ 1 ,β¦, π€ π, ,π‘β€ π AKKN (STACSβ16) Show π 1 π 2 β€ π for UDCP π 1 , π 2 β{0,1 } π True if π 1 β₯ π AKKN (ISITβ16) Big open question in information theory Study Subset Sum combinatorics If spike of size 2 ππ for some constant π>0, bound |{π€ π :πβ[π]}|β€ 2 1β π β² π for some π β² βπ(π)>0
27
Take-home Messages Cycle finding is a great tool low space algoβs
Several worst-case algoβs for SSS are inspired on techniques from the literature of average-case complexity of SSS: Cycle finding in poly space setting (this work) Howgrave-Graham approach in exp. space setting (AKKN) Win/win approach for many/few distinct sums In exponential space setting it remains to `winβ in the case of few sums Thanks for listening!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.