1 / 14

Engineering a Sorted List Data Structure for 32 Bit Keys

Engineering a Sorted List Data Structure for 32 Bit Keys. Roman Dementiev Lutz Kettner Jens Mehnert Peter Sanders MPI f ür Informatik, Saarbrücken. Introduction. The power of integer keys helps in Sorting (radix MSB,LSB) Priority queues (radix heaps) Static search trees

Download Presentation

Engineering a Sorted List Data Structure for 32 Bit Keys

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. Engineering a Sorted List Data Structure for 32 Bit Keys Roman Dementiev Lutz Kettner Jens Mehnert Peter Sanders MPI für Informatik, Saarbrücken

  2. Introduction • The power of integer keys helps in • Sorting (radix MSB,LSB) • Priority queues (radix heaps) • Static search trees • Dictionaries (hash tables) • Faster both in theory and practice • What about dynamic search data structures? R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  3. Motivation • van Emde Boas (vEB) search trees [van Emde Boas77,MehlhornNaeher90]: • Small K, large n→ vEB are faster ? • NO, their direct implementations are 2-8 times slower than comp. based trees [Wenzel92,here] • Here: a tuned vEB data structure that outperforms comp. based implementations n – number of elements K – bit width of keys c – size of the output R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  4. Direct vEB Implementation • vEB tree maintains set • Recursive definition: • |M|=1 or K=1: store directly, • otherwise let K’ = K/2: store minM,maxM, • top: store (top recursion) • boti: store (bottom recursion) use hash table K’ bit vEB top hash table K’ bit vEB boti R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  5. 0 63 … 31 32 63 0 4095 … … … …       31 32 0 63 65535 … … … … Improvement 1 • Replace top data structure with a bit pattern hierarchy K’ bit vEB top hash table K’ bit vEB boti R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  6. 0 63 … 31 32 63 0 4095 … … … … 31 32 0 63 65535 … … … … Level 1 – root Bits 31-16             Level 2 Bits 15-8 K’ bit vEB boti … … … single elements Level 2 Bits 15-8 … … … … … … … … … hash table hash table hash table Level 3 Bits 7-0 Improvement 2 • Break recursion when K=8 3 levels max. hash table R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  7. Level 1 – root Bits 31-16 0 65535             array hash table … 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Level 2 Bits 15-8 … … … single elements Level 2 Bits 15-8 … … … … … … … … … hash table hash table hash table Level 3 Bits 7-0 Improvement 3 0 63 … • Replace root hash table with an array 31 32 63 0 4095 … … … … 31 32 0 63 65535 … … … … R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  8. 0 65535             array … 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … … … … … … … … … … … … hash table hash table hash table Range Query Support 0 63 … • Link elements 31 32 63 0 4095 … … … … 31 32 0 63 65535 … … … … Level 1 – root Bits 31-16 Level 2 Bits 15-8 Level 2 Bits 15-8 Level 3 Bits 7-0 R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  9. Example: Locate Operation • return handle of • Function locate(y:N):ElementHandle ify > maxMthenreturn // no larger element i := y[16..31] // index into root table top iftop[i]=nullory>maxMithenreturnminMtop.locate(i) // look in the next L2 table ifMi={x} thenreturnx // single element case j := y[8..15] // key for L2 table at Mi ifri[j]=nullory > maxMijthenreturnminMi,top(i).locate(j) // look in the next L3 table ifMij={x} thenreturn x // single element case returnrij[topij.locate(y[0..7])] // L3 table access • At most 9 comparisons for any input sizes R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  10. Locate Performance R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  11. Construction R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  12. Deletion R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  13. Hard Inputs R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

  14. Conclusions and Future Work • Integer search trees can outperform comp. based search data struct. • Future work: • Support multi-set functionality • Other key lengths (up to 38 bits) • Reduce space consumption • Find real inputs • Port it to the LEDA library R. Dementiev et al.: A Sorted List Data Structure for 32 Bit Keys (ALENEX'04)

More Related