A Tight Lower Bound for Dynamic Membership in the External Memory Model

Similar documents
THE LIMITS OF BUFFERING: A TIGHT LOWER BOUND FOR DYNAMIC MEMBERSHIP IN THE EXTERNAL MEMORY MODEL

Using Hashing to Solve the Dictionary Problem (In External Memory)

Cache-Oblivious Hashing

Notes on Logarithmic Lower Bounds in the Cell Probe Model

Lower Bounds for Dynamic Connectivity (2004; Pǎtraşcu, Demaine)

Asymmetric Communication Complexity and Data Structure Lower Bounds

On Adaptive Integer Sorting

Optimal Color Range Reporting in One Dimension

Cache-Oblivious Algorithms

Cache-Oblivious Algorithms

The Batched Predecessor Problem in External Memory

The Cell Probe Complexity of Dynamic Range Counting

Lecture 15 April 9, 2007

Rank and Select Operations on Binary Strings (1974; Elias)

Problems. Mikkel Thorup. Figure 1: Mihai lived his short life in the fast lane. Here with his second wife Mirabela Bodic that he married at age 25.

DecreaseKeys are Expensive for External Memory Priority Queues

Higher Cell Probe Lower Bounds for Evaluating Polynomials

Communication Complexity

Distributed Statistical Estimation of Matrix Products with Applications

Tight Bounds for Sliding Bloom Filters

Bottom-k and Priority Sampling, Set Similarity and Subset Sums with Minimal Independence. Mikkel Thorup University of Copenhagen

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 32

Proving lower bounds in the LOCAL model. Juho Hirvonen, IRIF, CNRS, and Université Paris Diderot

Scanning and Traversing: Maintaining Data for Traversals in a Memory Hierarchy

Lecture 4 Thursday Sep 11, 2014

Finger Search in the Implicit Model

Optimal Bounds for the Predecessor Problem and Related Problems

Optimal Bounds for the Predecessor Problem and Related Problems

Cell-Probe Proofs and Nondeterministic Cell-Probe Complexity

Balls and Bins: Smaller Hash Families and Faster Evaluation

Lower Bounds for External Memory Integer Sorting via Network Coding

Lower Bound Techniques for Multiparty Communication Complexity

Balls and Bins: Smaller Hash Families and Faster Evaluation

The Complexity of Constructing Evolutionary Trees Using Experiments

Tight Bounds for Distributed Functional Monitoring

Lecture Lecture 3 Tuesday Sep 09, 2014

Lower Bounds for 2-Dimensional Range Counting

Data Structures 1 NTIN066

Lecture 2 September 4, 2014

Cache-Oblivious Computations: Algorithms and Experimental Evaluation

Basics of hashing: k-independence and applications

lsb(x) = Least Significant Bit?

Connections between exponential time and polynomial time problem Lecture Notes for CS294

Maintaining Significant Stream Statistics over Sliding Windows

Geometric Optimization Problems over Sliding Windows

Data Structures 1 NTIN066

arxiv: v1 [cs.dc] 4 Oct 2018

Hashing. Martin Babka. January 12, 2011

Space-Efficient Re-Pair Compression

Algorithms for Data Science

Theory of Computing Systems 2006 Springer Science+Business Media, Inc.

Trace Reconstruction Revisited

Tight Bounds for Distributed Streaming

Approximate Pattern Matching and the Query Complexity of Edit Distance

On the tightness of the Buhrman-Cleve-Wigderson simulation

Cell-Probe Lower Bounds for Prefix Sums and Matching Brackets

On the Limits of Cache-Obliviousness

Testing Graph Isomorphism

Multi-Dimensional Online Tracking

Algorithms for Calculating Statistical Properties on Moving Points

2 RASMUS PAGH bulky data. This means that the best space complexity one can hope for is O(n) words, where n is the size of S. We will only consider da

New Characterizations in Turnstile Streams with Applications

Communication Lower Bounds via Critical Block Sensitivity

BRICS. Hashing, Randomness and Dictionaries. Basic Research in Computer Science BRICS DS-02-5 R. Pagh: Hashing, Randomness and Dictionaries

Lecture 16: Communication Complexity

Tabulation-Based Hashing

Linear Sketches A Useful Tool in Streaming and Compressive Sensing

Fast Output-Sensitive Matrix Multiplication

ON RANGE SEARCHING IN THE GROUP MODEL AND COMBINATORIAL DISCREPANCY

Cache-Oblivious Range Reporting With Optimal Queries Requires Superlinear Space

CS369N: Beyond Worst-Case Analysis Lecture #6: Pseudorandom Data and Universal Hashing

Dynamic Ordered Sets with Exponential Search Trees

arxiv: v1 [cs.ds] 15 Feb 2012

Radix Sorting With No Extra Space

1 Approximate Quantiles and Summaries

A Unified Theorem on SDP Rank Reduction. yyye

Faster Primal-Dual Algorithms for the Economic Lot-Sizing Problem

Finding Frequent Items in Probabilistic Data

Asymptotic redundancy and prolixity

Matching Triangles and Basing Hardness on an Extremely Popular Conjecture

Benny Pinkas Bar Ilan University

A Linear Time Algorithm for Ordered Partition

Data Structure. Mohsen Arab. January 13, Yazd University. Mohsen Arab (Yazd University ) Data Structure January 13, / 86

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs

Leveraging Big Data: Lecture 13

An Optimal Algorithm for l 1 -Heavy Hitters in Insertion Streams and Related Problems

Theoretical Computer Science. Dynamic rank/select structures with applications to run-length encoded texts

arxiv: v2 [cs.ds] 3 Oct 2017

Cell-Probe Lower Bounds for the Partial Match Problem

Lecture 4 February 2nd, 2017

An Efficient Algorithm for Batch Stability Testing

Space Complexity vs. Query Complexity

Advanced Data Structures

Lecture 4: Divide and Conquer: van Emde Boas Trees

Separating Deterministic from Nondeterministic NOF Multiparty Communication Complexity

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Approximability of Packing Disjoint Cycles

Quantum Algorithms for Graph Traversals and Related Problems

A Subquadratic-Time Algorithm for Decremental Single-Source Shortest Paths

Transcription:

A Tight Lower Bound for Dynamic Membership in the External Memory Model Elad Verbin ITCS, Tsinghua University Qin Zhang Hong Kong University of Science & Technology April 2010 1-1

The computational model External memory (EM) model (or I/O model) (Aggarwal and Vitter 1988): Cache Cache of size M = Ω(B) (M, B in words) Each I/O reads/writes a cell Disk Disk partitioned into cells of size B 2-1

The computational model External memory (EM) model (or I/O model) (Aggarwal and Vitter 1988): Cache Cache of size M = Ω(B) (M, B in words) Each I/O reads/writes a cell Disk Disk partitioned into cells of size B Cost of an operation: # of cells read/changed; accessing the cache is free of charge. 2-2

The computational model External memory (EM) model (or I/O model) (Aggarwal and Vitter 1988): Cache Cache of size M = Ω(B) (M, B in words) Each I/O reads/writes a cell Disk Disk partitioned into cells of size B Cost of an operation: # of cells read/changed; accessing the cache is free of charge. Motivated by the real-world applications: accessing the cache is much faster than accessing higher level memory hierarchies. 2-3

The computational model External memory (EM) model (or I/O model) (Aggarwal and Vitter 1988): Cache Cache of size M = Ω(B) (M, B in words) Each I/O reads/writes a cell Disk Disk partitioned into cells of size B Cost of an operation: # of cells read/changed; accessing the cache is free of charge. Similar to Yao s cell probe model, only that in the EM model (1) cell size is large; (2) has an explicit cache. 2-4

The power of buffering For numerous dynamic data structure problems in external memory, updates can be buffered. Buffer tree [Arge 1995] Logarithmic method [Bentley 1980] + B-tree 3-1

The power of buffering For numerous dynamic data structure problems in external memory, updates can be buffered. Buffer tree [Arge 1995] Logarithmic method [Bentley 1980] + B-tree problem update query cache-oblivious stack O(1/B) trivial queue O(1/B) trivial priority-queue O( 1 log B B n) [Arge et. al. STOC 02] predecessor O( 1 log n) O(log n) trivial B range-sum range-reporting... O( Bɛ B log n) O(log B B: size of a block/cell (in words) n) [Brodal et. al. SODA 10] 3-2

How about Dictionary and Membership? Membership: Maintain a set S U with S n. Given an x U, is x S? Yes or No. Dictionary: If x S, return associated info, otherwise say No. Often assumes indivisibility. Objective: Tradeoff between update cost t u and query cost t q Two of the most fundamental data structure problems in computer science! 4-1

How about Dictionary and Membership (Cont.)? Dictionary and membership (selected) Knuth, 1973: External hashing Expected average cost of an operation is 1 + 1/2 Ω(b), provided the load factor α is less than a constant smaller than 1. (truly random hash function) Data structures like Arge s Buffer tree: Update = O( bɛ b log n), Query = O(log b n). 5-1

How about Dictionary and Membership (Cont.)? Dictionary and membership (selected) Knuth, 1973: External hashing Expected average cost of an operation is 1 + 1/2 Ω(b), provided the load factor α is less than a constant smaller than 1. (truly random hash function) Data structures like Arge s Buffer tree: Update = O( bɛ b log n), Query = O(log b n). Question: can we improve the amortized update cost to o(1) in external memory, without sacrificing the query speed by much? 5-2

The conjecture A long-time folklore conjecture inem community: (explicitly stated by Jensen and Pagh, 2007) t u must be Ω(1) if t q is required to be O(1) t u : expected amortized update cost t q : expected average query cost 6-1

The conjecture A long-time folklore conjecture inem community: (explicitly stated by Jensen and Pagh, 2007) t u must be Ω(1) if t q is required to be O(1) Our result: 0.99 10 5 log b log n n t u : expected amortized update cost t q : expected average query cost 6-2

The conjecture A long-time folklore conjecture inem community: (explicitly stated by Jensen and Pagh, 2007) t u must be Ω(1) if t q is required to be O(1) Our result: 0.99 10 5 log b log n n t u : expected amortized update cost t q : expected average query cost holds even when u = O(n), no deletion randomization 6-3

Consequences A strong dichotomy result: when designing an external memory data structure for dynamic membership, either use external hash (t u = t q = 1 + o(1)) or use buffer tree (t u = o(1), t q = O(log b n)) 7-1

Consequences A strong dichotomy result: when designing an external memory data structure for dynamic membership, either use external hash (t u = t q = 1 + o(1)) or use buffer tree (t u = o(1), t q = O(log b n)) Striking implications: the query complexities of many problems such as 1D-range reporting, predecessor, partial-sum, etc., are all the same in the regime where the update time is less than 1. 7-2

Compared with the rich results in RAM! 1D-range reporting O( log N/ log log N) insertion and query [Andersson, Thorup, JACM 07] O(log N/ log log N) insertion and O(log log N) query [Mortensen, Pagh, Pǎtraşcu, STOC 05] Other results that depend on the word size w Predecessor Θ( log N/ log log N) insertion and query [Andersson, Thorup, JACM 07] Partial-sum Θ(log N) insertion query [Pǎtraşcu, Demaine, SODA 04] 8-1

Two useful messages 1. Buffering is impossible to achieve in the EM model with sublogarithmic query time. 2. EM model is a clearner model than RAM in certain perspectives. 9-1

The landscape of the membership problem Query [Brodal, Fagerberg, SODA 03] truncated buffer tree upper bounds lower bounds n ɛ buffer tree log B log n n l B log l n, log l n [Yi, Zhang, SODA 10] hashing 1.1 1 0 1 B log M B n [This paper] 1 B log n B ɛ log n 0.9 1 B 1 + 1/2 Ω(B) Insert 10-1

11-1 Now, technical details...

Outline Preliminaries 12-1

Outline Preliminaries Deterministic algorithm + random update sequence 12-2

Outline Preliminaries Deterministic algorithm + random update sequence Can be extended to: randomized algorithm 12-3

Outline Preliminaries Deterministic algorithm + random update sequence Can be extended to: randomized algorithm Future work 12-4

Preliminaries U = {0, 1,..., u 1}: universe. U = u. m: size of cache. In bits. b: size of one cell. In bits. n: total number of inserted elements. S: set of elements we are maintaining. S n q snapshot (x): query path of x at time snapshot state 13-1

Preliminaries U = {0, 1,..., u 1}: universe. U = u. m: size of cache. In bits. b: size of one cell. In bits. n: total number of inserted elements. S: set of elements we are maintaining. S n q snapshot (x): query path of x at time snapshot state A very mild assumption u c n for sufficiently large c 13-2

Framework of the proof Exponentially growing epoches Y i time Y i growing at a ratio of Ω(t q b), with Y 0 = Ω(m) END (picked randomly) 14-1

Framework of the proof Exponentially growing epoches Y i time Y i growing at a ratio of Ω(t q b), with Y 0 = Ω(m) END (picked randomly) C u i : set of cells probed by inserting Y i. C q i : set of cells probed when querying all elements in Y i at END. (cheat a bit here.) C i = Cu i Cq i, C <i = j<i C j. 14-2

Framework of the proof Exponentially growing epoches Y i time Y i growing at a ratio of Ω(t q b), with Y 0 = Ω(m) END (picked randomly) C u i : set of cells probed by inserting Y i. C q i : set of cells probed when querying all elements in Y i at END. (cheat a bit here.) C i = Cu i Cq i, C <i = j<i C j. Key Lemma Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects C i \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. 14-3

Framework of the proof Exponentially growing epoches Y i time Y i growing at a ratio of Ω(t q b), with Y 0 = Ω(m) END (picked randomly) C u i : set of cells probed by inserting Y i. C q i : set of cells probed when querying all elements in Y i at END. (cheat a bit here.) C i = Cu i Cq i, C <i = j<i C j. Key Lemma t q Ω(log b log n (n/m)) Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects C i \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. 14-4

Proof for the key lemma Key Lemma Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects C i \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. 15-1

Proof for the key lemma Key Lemma Conceptually, we put C<i into the cache. Let m i = m + C<i Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects Ci \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. Ci 15-2

Proof for the key lemma Key Lemma Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects Ci \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. Proof. We prove for each epoch i. Conceptually, we put C<i into the cache. Let m i = m + C<i C i Step 1: (the encoding lemma) If m i γ Y i (γ: small const), then with probability at least 0.9 over the choice of Y i, it holds that {y Y i q END (y) C u i } 0.99 Y i. Y i C i 15-3

Proof for the key lemma Key Lemma Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects Ci \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. Proof. We prove for each epoch i. Conceptually, we put C<i into the cache. Let m i = m + C<i C i Step 1: (the encoding lemma) If m i γ Y i (γ: small const), then with probability at least 0.9 over the choice of Y i, it holds that {y Y i q END (y) C u i } 0.99 Y i. U Step 2: (the snake lemma) If Ci u 10/11 Y i and m i γ Y i, then E[ {x U q END (x) Ci } ] Ω(u). C i 15-4

Proof for the key lemma Key Lemma Suppose that t u 0.9 and pick x U uniformly at random. E i is an indicator random variable = 1 if q END (x) intersects Ci \C <i. Then E[E i ] Ω(1) for all i = 1, 2,..., d. Proof. We prove for each epoch i. Conceptually, we put C<i into the cache. Let m i = m + C<i C i Step 1: (the encoding lemma) If m i γ Y i (γ: small const), then with probability at least 0.9 over the choice of Y i, it holds that {y Y i q END (y) C u i } 0.99 Y i. Local Global U Step 2: (the snake lemma) If Ci u 10/11 Y i and m i γ Y i, then E[ {x U q END (x) Ci } ] Ω(u). C i 15-5

Idea of the proof for the encoding lemma The encoding lemma (subscripts i are omitted) If m γ Y (γ: a small const), then with probability at least 0.9 over the choices of Y, it holds that {y Y q END (y) C u } 0.99 Y. Proof. Z: the set of y Y such that q(y) intersect C u at END. 16-1

Idea of the proof for the encoding lemma The encoding lemma (subscripts i are omitted) If m γ Y (γ: a small const), then with probability at least 0.9 over the choices of Y, it holds that {y Y q END (y) C u } 0.99 Y. Proof. Z: the set of y Y such that q(y) intersect C u at END. Idea: If Z < 0.99 Y, then there is an encoding of Y of small size, contradicting to the fact that Y is chosen from U randomly (thus has a large entropy log ( u Y ) ). 16-2

Idea of the proof for the encoding lemma The encoding lemma (subscripts i are omitted) If m γ Y (γ: a small const), then with probability at least 0.9 over the choices of Y, it holds that {y Y q END (y) C u } 0.99 Y. Proof. Z: the set of y Y such that q(y) intersect C u at END. Idea: If Z < 0.99 Y, then there is an encoding of Y of small size, contradicting to the fact that Y is chosen from U randomly (thus has a large entropy log ( u Y ) ). The encoding: The state of the cache, m bits. The elements Z, log ( u Z ) bits. 16-3

Idea of the proof for the encoding lemma The encoding lemma (subscripts i are omitted) If m γ Y (γ: a small const), then with probability at least 0.9 over the choices of Y, it holds that {y Y q END (y) C u } 0.99 Y. Proof. Z: the set of y Y such that q(y) intersect C u at END. Idea: If Z < 0.99 Y, then there is an encoding of Y of small size, contradicting to the fact that Y is chosen from U randomly (thus has a large entropy log ( u Y ) ). The encoding: But, The state of the cache, m bits. The elements Z, log ( ) m + log ( ) ( u u Z < log u Z bits. A contradiction. Y ) 16-4

Idea of the proof for the snake lemma The snake lemma If C u 10/11 Y and m γ Y, then E[ {x U q END (x) C } ] Ω(u). The intersection graph. Under disk state D and cache state M, the graph G M,D = (U, E), where x, y U are connected by an edge if q M,D (x) q M,D (y) C U Dual G M,D 17-1

Idea of the proof for the snake lemma The snake lemma If C u 10/11 Y and m γ Y, then E[ {x U q END (x) C } ] Ω(u). The intersection graph. Under disk state D and cache state M, the graph G M,D = (U, E), where x, y U are connected by an edge if q M,D (x) q M,D (y) Idea of the proof. Intersection graph must be dense at END if t u 0.9. (next slides) C U Dual G M,D 17-2

Idea of the proof for the snake lemma The snake lemma If C u 10/11 Y and m γ Y, then E[ {x U q END (x) C } ] Ω(u). The intersection graph. Under disk state D and cache state M, the graph G M,D = (U, E), where x, y U are connected by an edge if q M,D (x) q M,D (y) C U Dual Idea of the proof. Intersection graph must be dense at END if t u 0.9. (next slides) For a randomly chosen set Y, the neighborhood of Y must be large. Thus E[ {x U q END (x) C } ] Ω(u) G M,D Y 17-3

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? U Let D, M and D, M be the states of the cache and disk before and after the epoch. C Dual G M,D 18-1

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? Let D, M and D, M be the states of the cache and disk before and after the epoch. If t u 0.9 C u is small and D cannot differ from D by much. G M,D G M,D 18-2

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? Let D, M and D, M be the states of the cache and disk before and after the epoch. If t u 0.9 C u is small and D cannot differ from D by much. + M is small Structure of G will not change by much. G M,D G M,D 18-3

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? Let D, M and D, M be the states of the cache and disk before and after the epoch. If t u 0.9 C u is small and D cannot differ from D by much. + M is small Structure of G will not change by much. G M,D Since Y is random at END, C u such that 0.99 fraction of Y whose query paths intersect a small set C u at END, if G M D is sparse. G M,D 18-4

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? Let D, M and D, M be the states of the cache and disk before and after the epoch. If t u 0.9 C u is small and D cannot differ from D by much. + M is small Structure of G will not change by much. G M,D Since Y is random at END, C u such that 0.99 fraction of Y whose query paths intersect a small set C u at END, if G M D is sparse. G M,D is dense G M,D 18-5

Idea of the proof for the snake lemma (cont.) Why intersection graph must be dense at END if t u 0.9? Let D, M and D, M be the states of the cache and disk before and after the epoch. If t u 0.9 C u is small and D cannot differ from D by much. + M is small Structure of G will not change by much. Since Y is random at END, C u such that 0.99 fraction of Y whose query paths intersect a small set C u at END, if G M D is sparse. G M,D is dense cheat a bit G M,D G M,D 18-6

Futher work We still cannot handle fast updates. e.g. if t u = O(1/B), t q = Ω(n ɛ )? 19-1

Futher work We still cannot handle fast updates. e.g. if t u = O(1/B), t q = Ω(n ɛ )? Lower bounds of other dynamic problems in the external memory. e.g., for union-find, need super-log query time if we want to batch up the updates? Call for new techniques? 19-2

Futher work We still cannot handle fast updates. e.g. if t u = O(1/B), t q = Ω(n ɛ )? Lower bounds of other dynamic problems in the external memory. e.g., for union-find, need super-log query time if we want to batch up the updates? Call for new techniques? And the priority queue. max{delete, deletemin} 1 B log 2 n? 19-3

The End T HAN K YOU Q and A 20-1