on the power of structural violations in priority queues
play

On the power of structural violations in priority queues Jyrki - PowerPoint PPT Presentation

On the power of structural violations in priority queues Jyrki Katajainen (University of Copenhagen) Joint work with Amr Elmasry (Alexandria University) and Claus Jensen (University of Copenhagen) These slides are available at


  1. On the power of structural violations in priority queues Jyrki Katajainen (University of Copenhagen) Joint work with Amr Elmasry (Alexandria University) and Claus Jensen (University of Copenhagen) These slides are available at http://www.cphstl.dk c � Performance Engineering Laboratory CATS 2007 (1)

  2. Heaps find - min () extract () Examples: 1 Fibonacci heaps insert () 5 Run-relaxed heaps Fat heaps 8 4 7 delete () decrease ( → 6) c � Performance Engineering Laboratory CATS 2007 (2)

  3. Focus • comparison complexity of heap operations • worst-case efficiency • constant factors Our ultimate goal is to develop a library component that guarantees optimal complexity bounds, but unfortunately the data structures de- veloped are not practical. c � Performance Engineering Laboratory CATS 2007 (3)

  4. Research question Q: If find - min , insert , extract , and decrease are required to take O (1) time, can delete be realized in O (lg n ) time including only lg n + O (1) element comparisons . A: If decrease is allowed to take O (lg n ) time, yes . With O (1)-time decrease almost , but we do not know the final answer. n : # elements stored just prior to an operation c � Performance Engineering Laboratory CATS 2007 (4)

  5. Binomial heaps n = 1010two min B 0 ≡ 1 3 B k ≡ x y B k − 1 B k − 1 B 3 B 1 • heap-ordered x ≤ y Read [Cormen et al. 2001] • at most ⌊ lg n ⌋ + 1 binomial trees c � Performance Engineering Laboratory CATS 2007 (5)

  6. Heap-order violations 9 1 ⇒ binomial heaps run-relaxed heaps O (lg n ) violations [Driscoll et al. 1988] c � Performance Engineering Laboratory CATS 2007 (6)

  7. Structural violations phantom node a subtree missing Example: [Fredman & Tarjan 1987] Fibonacci heaps c � Performance Engineering Laboratory CATS 2007 (7)

  8. Pruned heaps τ : # of trees λ : # of phantom nodes phantom node r τ ≤ O (lg n ) λ ≤ O (lg n ) c � Performance Engineering Laboratory CATS 2007 (8)

  9. Results Heap ◗◗◗◗◗◗◗◗◗◗ Run-relaxed Fat heaps Two-tier Two-tier Oper- heaps relaxed heaps pruned heaps ◗ ation [ISAAC 2006] [ISAAC 2006] [this paper] find - min O (1) O (1) O (1) O (1) O (1) O (1) O (1) O (1) insert O (1) – O (1) O (1) extract O (1) O (1) O (1) O (1) decrease lg n + O ( √ lg n ) 3 lg n + O (1) 2 . 73 lg n + O (1) lg n + O (lg lg n ) delete # of element comparisons c � Performance Engineering Laboratory CATS 2007 (9)

  10. Find-min Maintain a pointer to the current minimum min c � Performance Engineering Laboratory CATS 2007 (10)

  11. Insert Imitate ++ for binary numbers 1 1 1 + 1 1 0 0 0 + = c � Performance Engineering Laboratory CATS 2007 (11)

  12. Extract Imitate -- for binary numbers 1 0 0 0 - 1 1 1 1 ⇒ extract extract is our contribution for the mankind! c � Performance Engineering Laboratory CATS 2007 (12)

  13. Problem Use redundant zeroless ⇒ carries/borrows number representation ⇒ 1000two 32redundant-four [ISAAC 2006] c � Performance Engineering Laboratory CATS 2007 (13)

  14. Decrease • cut the subtree T → 6 • put a phantom node instead • make the element replacement • see T as a separate tree 8 • reduce the # of phantom nodes if necessary T c � Performance Engineering Laboratory CATS 2007 (14)

  15. Data-structural transformations Singleton transformation I: Both x and y are the last children of their parents p and q , respectively. Name the nodes such that element [ p ] � > element [ q ]. g g f f p p q ⇒ q y x B k B k +1 B k B k B k B k B k + 4 other transformations, see the proceedings c � Performance Engineering Laboratory CATS 2007 (15)

  16. Delete • cut the subtree T rooted at x extract • replace with a phantom node • remove x delete • extract a node y • join the subtrees of T and y y • make the new tree as a separate x tree • update the minimum pointer if ne- T cessary • reduce the # of phantom nodes if necessary c � Performance Engineering Laboratory CATS 2007 (16)

  17. Analysis Theorem: A node can have at most lg n + O ( √ lg n ) real children For a proof, see the proceedings ⇒ delete performs at most 2 lg n + O ( √ lg n ) element comparisons c � Performance Engineering Laboratory CATS 2007 (17)

  18. Two-tier heaps upper store pointers lazy deletions! elements lower store c � Performance Engineering Laboratory CATS 2007 (18)

  19. Mimicking heap-order violations structural violation heap-order violation r phantom node x main r structure shadow r structure x y c � Performance Engineering Laboratory CATS 2007 (19)

  20. Main contribution Theorem: Relaxed heaps (heap-order violations) and pruned heaps (structural violations) are equal in power up to lg n + O (lg lg n ) element comparisons per delete c � Performance Engineering Laboratory CATS 2007 (20)

  21. Open problems • What is the answer to our original research question, i.e. is lg n + O (1) element comparisons per delete () possible or not? • Are the two types of violations in 1-1 correspondence or not? • What is the lowest number of element comparisons performed by delete for heaps that are efficiently meldable? • How to implement a worst-case efficient heap in an industry- strength program library? c � Performance Engineering Laboratory CATS 2007 (21)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend