cache-oblivious dynamic dictionaries with update/query tradeoffs

1
Problem and Results Construction Ideas Dictionary Maintain a set of elements Search(x) – return the largest element x in the set (static and dynamic version) Insert new / delete existing element (dynamic version) Models Static Dictionaries Perform a recursive memory layout of a perfect binary search tree Subtrees of height O(log 2 B) fit into O(1) blocks, i.e. search cost becomes O(log 2 N / log 2 B) = O(log B N) I/Os Dynamic Dictionaries Updates are buffered at the nodes + propagated down in batches updates faster than queries Recursive layout of buffers Keep pointers between levels to provide efficient searches References [1] Bayer, McCreight. Organization and maintenance of large ordered indexes. Acta Informatica 1972 [2] Brodal, Demaine, Iacono, Fineman, Langerrman, Munro. Cache-oblivious dynamic dictionaries with update/query tradeoffs. SODA 2010 [3] Brodal, Fagerberg. Lower bounds for external memory dictionaries. SODA 2003 [4] Brodal, Fagerberg, Jacob. Cache- oblivious search trees via binary trees of small height. SODA 2002 [5] Prokop. Cache-oblivious algorithms. MIT Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoffs MADALGO – Center for Massive Data Algorithmics, a Center of the Danish National Research Foundation Gerth Stølting Brodal Aarhus University Search Updates Bayer, McCreight 1972 O(log B N) O(log B N) I/O Model Brodal, Fagerberg 2003 O( ∙ log B N) O( log B N) Prokop 1999 O(log B N) N/A Cache-oblivious Mo Brodal, Jacob, Fagerberg 2002 O(log B N) O(log B N) Brodal, Demaine, Iacono, Fineman, Langerman, Munro 2010 O( ∙ log B N) O( log B N) Erik D. Demaine MIT 16 5 3 10 19 27 24 4 17 7 28 2 18 13 14 22 I/O Model [Aggarwal, Vitter 1988] Fast internal memory, size M Slow memory, blocks of size B Cost = number of block transfers (I/Os) between the two memories Cache-oblivious Model [Frigo, Leiserson, Prokop, Ramachandran 1999] Algorithms are not parameterized by B and M Analyzed in the ideal-cache model, same as I/O model but using optimal cache replacement strategy Algorithms automatically apply to multi-level hierarchies CPU Fast memory Block M/B Slow memory B B N N N Memory layout N N ... log 2 N log 2 B Recursive memory layout B inary search tree [Prokop 1999] [Brodal, Demaine, Iacono, Fineman, Langerrman, Munro 2010] size-x input buffer size-x 2 output buffer size-x 3/2 middle buffer x-box x-box Upper level: at most x 1/2 /4 subboxes Lower level: at most x/4 subboxes inpu t middle output Subboxes stored contiguously in arbitrary order Unused (currently empty) subboxes are preallocated Search path x-box 1 ε 1 εB ε 1 ε 1 εB ε

Upload: lindley

Post on 24-Feb-2016

33 views

Category:

Documents


1 download

DESCRIPTION

. Erik D. Demaine MIT. Gerth Stølting Brodal Aarhus University. s ize- x input buffer. √ N. …. Upper level: at most x 1/2 /4 subboxes. Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoffs. √ x -box. N. …. s ize- x 3/2 middle buffer. √ N. …. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoffs

Problem and Results Construction Ideas

Dictionary

Maintain a set of elements Search(x) – return the largest element ≤ x in the set (static and dynamic version) Insert new / delete existing element (dynamic version)

Models

Static Dictionaries Perform a recursive memory layout of a perfect binary search tree Subtrees of height O(log2 B) fit into O(1) blocks, i.e. search cost becomes O(log2 N / log2 B) = O(logB N) I/Os

Dynamic Dictionaries

Updates are buffered at the nodes + propagated down in batches updates faster than queries Recursive layout of buffers Keep pointers between levels to provide efficient searches

References[1] Bayer, McCreight. Organization and maintenance

of large ordered indexes. Acta Informatica 1972[2] Brodal, Demaine, Iacono, Fineman, Langerrman,

Munro. Cache-oblivious dynamic dictionaries with update/query tradeoffs. SODA 2010

[3] Brodal, Fagerberg. Lower bounds for external memory dictionaries. SODA 2003

[4] Brodal, Fagerberg, Jacob. Cache-oblivious search trees via binary trees of small height. SODA 2002

[5] Prokop. Cache-oblivious algorithms. MIT Master’s thesis 1999

Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoffs

MADALGO – Center for Massive Data Algorithmics, a Center of the Danish National Research Foundation

Gerth Stølting BrodalAarhus University

Search Updates

Bayer, McCreight 1972 O(logB N) O(logB N)I/O

ModelBrodal, Fagerberg 2003 O( ∙ logB N) O( ∙ logB N)

Prokop 1999 O(logB N) N/A Cach

e-oblivious

Model

Brodal, Jacob, Fagerberg 2002 O(logB N) O(logB N)

Brodal, Demaine, Iacono, Fineman, Langerman, Munro 2010 O( ∙ logB N) O( ∙ logB N)

Erik D. DemaineMIT

16 5

3

10

1927

24

4

17

7

28

218

13

1422

I/O Model[Aggarwal, Vitter 1988]

Fast internal memory, size M Slow memory, blocks of size B Cost = number of block transfers

(I/Os) between the two memories

Cache-oblivious Model[Frigo, Leiserson, Prokop, Ramachandran 1999]

Algorithms are not parameterized by B and M

Analyzed in the ideal-cache model, same as I/O model but using optimal cache replacement strategy

Algorithms automatically apply to multi-level hierarchies

CPUFast

memory Block

M/BSlow memory

BB

…N

√N

√N

Memory layoutN √N

...

log2 Nlog2 B

…Recursive memory layout

Bina

ry se

arch

tree

[Prokop 1999]

[Brodal, Demaine, Iacono, Fineman, Langerrman, Munro 2010]

size-x input buffer

size-x2 output buffer

size-x3/2 middle buffer

√x-box

√x-box

Upper level: at most x1/2/4 subboxes

Lower level: at most x/4 subboxes

input middle… … output

Subboxes stored contiguously in arbitrary order

Unused (currently empty) subboxes are preallocated

Search path

x-box

1εBε

1εBε