1 / 18

Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoff

Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoff. Gerth Stølting Brodal Erik D. Demaine Jeremy T. Fineman John Iacono Stefan Langerman J. Ian Munro. Result p resented at SODA 2010. Dynamic Dictionary. Search(k) Insert(e) Delete(k). I/O Model [ Aggarwal , Vitter 88].

juliet
Download Presentation

Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoff

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cache-Oblivious Dynamic Dictionaries with Update/Query Tradeoff GerthStøltingBrodal Erik D. Demaine Jeremy T. Fineman John Iacono Stefan Langerman J. Ian Munro Resultpresentedat SODA 2010

  2. Dynamic Dictionary Search(k) Insert(e) Delete(k)

  3. I/O Model[Aggarwal, Vitter 88] B Slow Memory Fast Memory CPU block M/B B • Cost:the number of block transfers (I/Os)

  4. Cache-Oblivious Algorithms[Frigo, Leiserson, Prokop, Ramachandran 99] • Algorithms not parameterized by M or B • Analyze in ideal-cache model — I/O model, except optimal replacement policy is assumed B Slow Memory Fast Memory CPU block M/B B

  5. Cache-Oblivious Dynamic Dictionaries * amortized † assumes M = Ω(B2)

  6. Building an xDict ( = 1/2) … 221-box 222-box 22lglgN-box lglgNx-boxesof squaring capacities Insert: insert into smallest box • When a box reaches capacity, Flush it and Batch-Insertinto the next box • O((1/√B) logBx) cost is dominated by largest box O((1/√B) logBN) Search: search in each x-box • O(logBx) cost is dominated by largest box O(logBN)

  7. x-Box = dictionary with capacity x2 Batch-Insert(D,A): insert Θ(x) presorted objects — cost O((1/√B)logBx) per element Search(D,κ): — cost is O(logBx) Flush(D): produce a size-x2 sorted array A containing all the elements in the x-box D — cost is O(1/B) per element

  8. Recursive x-Box size-x input buffer Upper level: at most x1/2/4 subboxes … √x-box size-x3/2 middle buffer … Lower level: at most x/4 subboxes √x-box size-x2 output buffer … … input middle output subboxes stored contiguously in arbitrary order Unused (currently empty) subboxes are preallocated

  9. x-Box Space Usage size-x input buffer Theorem: An x-Box uses at most cx2space (within constant factor of capacity/output buffer) Upper level: at most x1/2/4 subboxes … √x-box size-x3/2 middle buffer … Lower level: at most x/4 subboxes √x-box size-x2 output buffer

  10. Fractional Cascading within x-Box size-x input buffer Propagate samples upwards + Lookahead pointers Upper level: at most x1/2/4 subboxes √x-box size-x3/2 middle buffer Lower level: at most x/4 subboxes √x-box size-x2 output buffer

  11. Searching in an x-Box size-x input buffer Describe searches by the recurrence S(x) = 2S(√x) + O(1) with base case S(<√B) = 0 Solves to O(logBN) Upper level: at most x1/2/4 subboxes √x-box size-x3/2 middle buffer Lower level: at most x/4 subboxes √x-box size-x2 output buffer

  12. Flush size-x input buffer • Moves all real elements to the output buffer in sorted order. Upper level: at most x1/2/4 subboxes √x-box size-x3/2 middle buffer Lower level: at most x/4 subboxes √x-box size-x2 output buffer • Lookahead pointers are rebuilt to facilitate searches. Most subboxes remain empty.

  13. Batch-Insert + input buffer • Merge sorted input into input buffer. middle buffer output buffer

  14. Batch-Insert • Merge sorted input into input buffer. • If input buffer is “full enough,” Batch-Insert into upper-level subboxes (in chunks of Θ(√x)) middle buffer output buffer

  15. Batch-Insert input buffer • Merge sorted input into input buffer. • If input buffer is “full enough,” Batch-Insert into upper-level subboxes (in chunks of Θ(√x)) • Whenever a subbox is near capacity, Flush it, then split it into two subboxes middle buffer output buffer

  16. Batch-Insert input buffer • Merge sorted input into input buffer. • If input buffer is “full enough,” Batch-Insert into upper-level subboxes (in chunks of Θ(√x)) • Whenever a subbox is near capacity, Flush it, then split it into two subboxes • If no empty subboxes remain, Flush all of them and merge output buffers into middle buffer. middle buffer output buffer

  17. Generalizing to O((1/εB 1-ε)logBN) size-x input buffer Parameterize by 0 < α ≤ 1, where α=ε/(1-ε) Upper level: at most x1/2/4 subboxes √x-box size-x1+α/2 middle buffer Lower level: at most x1/2+α/2/4 subboxes √x-box size-x1+α output buffer 2(1+α)1 2(1+α)2-box 2(1+α)i-box • 1/ε overhead comes from geometric sum in xDict

  18. Results Summary * amortized † assumes M = Ω(B2)

More Related