Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas

Similar presentations


Presentation on theme: "Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas"β€” Presentation transcript:

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!!


Download ppt "Nikhil Bansal, Shashwat Garg, Jesper Nederlof, Nikhil Vyas"

Similar presentations


Ads by Google