Melding Priority Queues Ran Mendelson Robert E. Tarjan Mikkel Thorup Uri Zwick SWAT 2004.

Slides:



Advertisements
Similar presentations
Priority Queues  MakeQueuecreate new empty queue  Insert(Q,k,p)insert key k with priority p  Delete(Q,k)delete key k (given a pointer)  DeleteMin(Q)delete.
Advertisements

Advanced Data structure
Rank-Pairing Heaps Robert Tarjan, Princeton University & HP Labs Joint work with Bernhard Haeupler and Siddhartha Sen, ESA
Number Systems and Data structures Amr Elmasry A. Elmasry, C. Jensen and J. Katajainen, The strictly-regular number system and worst-case.
CS 315 March 24 Goals: Heap (Chapter 6) priority queue definition of a heap Algorithms for Insert DeleteMin percolate-down Build-heap.
Rank-Pairing Heaps Bernhard Haeupler, Siddhartha Sen, and Robert Tarjan, ESA
Nick Harvey & Kevin Zatloukal
CSE 373 Data Structures Lecture 12
Dijkstra/Prim 1 make-heap |V| insert |V| delete-min |E| decrease-key Priority Queues make-heap Operation insert find-min delete-min union decrease-key.
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Source: Muangsin / Weiss1 Priority Queue (Heap) A kind of queue Dequeue gets element with the highest priority Priority is based on a comparable value.
Course: Data Structures Lecturer: Uri Zwick March 2008
5.9 Heaps of optimal complexity
Binomial Heaps Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
Course: Data Structures Lecturers: Haim Kaplan and Uri Zwick June 2010
ANALYSIS OF SOFT HEAP Varun Mishra April 16,2009.
MA/CSSE 473 Day 36 Kruskal proof recap Prim Data Structures and detailed algorithm.
Leftist Trees Linked binary tree. Can do everything a heap can do and in the same asymptotic complexity.  insert  remove min (or max)  initialize Can.
PRIORITY QUEUES (HEAPS). Queues are a standard mechanism for ordering tasks on a first-come, first-served basis However, some tasks may be more important.
Chapter 6: Union-Find and Related Structures CS6310 ADVANCED DATA STRUCTURE SHADHA MUHI & HASNAA IMAD.
Strict Fibonacci Heaps Gerth Stølting Brodal Aarhus University George Lagogiannis Robert Endre Tarjan Agricultural University of Athens Princeton University.
2IL05 Data Structures Fall 2007 Lecture 13: Minimum Spanning Trees.
Spring 2015 Lecture 11: Minimum Spanning Trees
§8 Binomial Queues Haven’t we had enough about queues? What is a binomial queue for? Well, what is the average time for insertions with leftist or skew.
Computer Algorithms Submitted by: Rishi Jethwa Suvarna Angal.
Balanced Search Trees Problem: Efficiency of BST is related to tree’s height.  search, insert and remove follow a path from root to desired location 
Λίστα Εργασιών Data Structures for Tree Manipulation D. Harel and R.E. Tarjan. Fast Algorithms for finding nearest common ancestors. SIAM J. Computing,
Union Find ADT Data type for disjoint sets: makeSet(x): Given an element x create a singleton set that contains only this element. Return a locator/handle.
A priority queue for small integers. 1st Step: Prove this Priority queue capacity: n (w / logn loglogn)-bit keys insert, find-min, delete-min: constant.
Change Keys in heaps Fibonacci heap Zhao Xiaobin.
1 Binomial Tree Binomial tree. n Recursive definition: B k-1 B0B0 BkBk B0B0 B1B1 B2B2 B3B3 B4B4.
Union-Find A data structure for maintaining a collection of disjoint sets Course: Data Structures Lecturers: Haim Kaplan and Uri Zwick January 2014.
Four different data structures, each one best in a different setting. Simple Heap Balanced Heap Fibonacci Heap Incremental Heap Our results.
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue. Nov 4,
Data Structure II So Pak Yeung Outline Review  Array  Sorted Array  Linked List Binary Search Tree Heap Hash Table.
Review for Exam 2 Topics covered (since exam 1): –Splay Tree –K-D Trees –RB Tree –Priority Queue and Binary Heap –B-Tree For each of these data structures.
MA/CSSE 473 Days Answers to student questions Prim's Algorithm details and data structures Kruskal details.
CSS446 Spring 2014 Nan Wang.  to study trees and binary trees  to understand how binary search trees can implement sets  to learn how red-black trees.
Data StructuresData Structures Priority Queue. Recall Queues FIFO:First-In, First-Out Some contexts where this seems right? Some contexts where some things.
Two-tier relaxed heaps Presented by Claus Jensen Joint work with Amr Elmasry and Jyrki Katajainen Slides available at
Initializing A Max Heap input array = [-, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
Dynamic Dictionaries Primary Operations:  get(key) => search  put(key, element) => insert  remove(key) => delete Additional operations:  ascend()
1 Fibonacci heaps: idea List of multiway trees which are all heap-ordered. Definition: A tree is called heap-ordered if the key of each node is greater.
(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty.
MA/CSSE 473 Day 37 Student Questions Kruskal Data Structures and detailed algorithm Disjoint Set ADT 6,8:15.
Self-Adjusting Data Structures
Data Structures Binomial Heaps Fibonacci Heaps Haim Kaplan & Uri Zwick
Topics covered (since exam 1):
Splay Trees Binary search trees.
Source: Muangsin / Weiss
Splay Trees Binary search trees.
Selection in heaps and row-sorted matrices
Topics covered (since exam 1):
Disjoint Set Neil Tang 02/23/2010
Disjoint Set Neil Tang 02/26/2008
A simpler implementation and analysis of Chazelle’s
ערמות בינומיות ופיבונצ'י
Closing a Classical Data Structure Problem Gerth Stølting Brodal
Strict Fibonacci Heaps
Course: Data Structures Lecturer: Uri Zwick March 2008
Binary and Binomial Heaps
Melding Priority Queues
Union-Find with Constant Time Deletions
Priority Queues Supports the following operations. Insert element x.
Topics covered (since exam 1):
Chapter 12 Heap ADT © 2011 Pearson Addison-Wesley. All rights reserved.
CS 6310 Advanced Data Structure Wei-Shian Wang
Fibonacci Heaps & Doubled-Ended Heap Structures
A Heap Is Efficiently Represented As An Array
Presentation transcript:

Melding Priority Queues Ran Mendelson Robert E. Tarjan Mikkel Thorup Uri Zwick SWAT 2004

2 Non-meldable Priority Queue Meldable Priority Queue pq(n) time per operation pq(n)+α(n) time per operation pq(n)α(n,n/pq(n)) time per operation or Improved analysis of transformation

3 Second transformation Meldable Priority Queue pq(n) time per operation pq(N) time per operation n – number of elements in priority queue Keys are is {1,2,…,N}

4 Priority Queues Insert Delete Find-Min Dec-Key Meld Meldable O(1) O(log n) O(1) Amortized [Fredman-Tarjan ’87] Worst case [Brodal ’96] Best possible comparison based results 2 O(1)

5 RAM Priority Queues Insert Delete Find-Min Dec-Key O(1) O(log log n) O(1) [Thorup ’03] Keys are integers that fit into a single machine word. Standard arithmetical and logical operations take constant time MeldO(1)NO using our transformation

6 Atomic heaps Insert Delete Find-Min O(1) [Fredman-Willard ’94] MeldNO At most O(log 2 n) elements!

7 Union Find makeset union find delete a c b de O(1) O(α(m,n)) O(1) [Tarjan ’75, Tarjan & van Leeuven ’84 ] Amortized

8 Ackermann’s function A 0 (j) = j+1 A i (j) = A i-1 (j+1) (j) Grows extremely FAST α(n) = min{ k : A k (1) ≥ n } α(m,n) = min{ k : A k (m/n) ≥ n } Grows extremely slow

9 Union Find Represent each set as a rooted tree Union by rankPath compression

10 Union by rank 0 r1r1 r2r2 r r r+1

11 Path Compression

12 Non-meldable priority queue + Union Find Meldable priority queue

13 Place a non-meldable priority queue at each node of a union-find tree holding the minimal element in each one of its subtrees Use the union-find data stricture to maintain the sets

14 Handling deletions using path compression The amortized delete cost is O(pq(n)α(n)) [MTZ’04] [van Emde Boaz, Kaas, Zijlstra ’77 ]

15 Flavor of improved analysis rank ≥ k rank < k size ≥ 2 k size < 2 k At most n/2 k nodes Choose k=2loglog n.If f>n/log n, we are done.

16 More flavor of improved analysis rank ≥ k size ≥ 2 k rank < k size ≥ 2 k rank < k size < 2 k

17 Conclusion Sorting Worst-case non-meldable priority queues Amortized meldable priority queues