(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty.

Slides:



Advertisements
Similar presentations
Gerth Stølting Brodal University of Aarhus Monday June 9, 2008, IT University of Copenhagen, Denmark International PhD School in Algorithms for Advanced.
Advertisements

COL 106 Shweta Agrawal and Amit Kumar
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.
Dynamic Matchings in Convex Bipartite Graphs
CHAPTER 5 PRIORITY QUEUES (HEAPS) §1 ADT Model Objects: A finite ordered list with zero or more elements. Operations:  PriorityQueue Initialize( int.
1 Self-Adjusting Data Structures. 2 Lists [D.D. Sleator, R.E. Tarjan, Amortized Efficiency of List Update Rules, Proc. 16 th Annual ACM Symposium on Theory.
Hierarchy-conscious Data Structures for String Analysis Carlo Fantozzi PhD Student (XVI ciclo) Bioinformatics Course - June 25, 2002.
F00 pq 1 Priority Queues Review the abstract data type Priority Queues Review different implementation options.
O(log n) bits or atomic elements
Purely Functional Worst Case Constant Time Catenable Sorted Lists Gerth Stølting Brodal University of Aarhus Joint work with Christos Makris Kostas Tsichlas.
CS 315 March 24 Goals: Heap (Chapter 6) priority queue definition of a heap Algorithms for Insert DeleteMin percolate-down Build-heap.
Heaps & Priority Queues Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Nick Harvey & Kevin Zatloukal
CSE 373 Data Structures Lecture 12
Comparison Based Dictionaries: Fault Tolerance versus I/O Efficiency Gerth Stølting Brodal Allan Grønlund Jørgensen Thomas Mølhave University of Aarhus.
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.
Source: Muangsin / Weiss1 Priority Queue (Heap) A kind of queue Dequeue gets element with the highest priority Priority is based on a comparable value.
Cache Oblivious Search Trees via Binary Trees of Small Height
5.9 Heaps of optimal complexity
Melding Priority Queues Ran Mendelson Robert E. Tarjan Mikkel Thorup Uri Zwick SWAT 2004.
Binomial Heaps Jyh-Shing Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University.
CSE 326: Data Structures Binomial Queues Ben Lerner Summer 2007.
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Binary and Binomial Heaps These lecture slides are adapted from CLRS, Chapters.
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.
Strict Fibonacci Heaps Gerth Stølting Brodal Aarhus University George Lagogiannis Robert Endre Tarjan Agricultural University of Athens Princeton University.
The Binary Heap. Binary Heap Looks similar to a binary search tree BUT all the values stored in the subtree rooted at a node are greater than or equal.
An Optimal Cache-Oblivious Priority Queue and Its Applications in Graph Algorithms By Arge, Bender, Demaine, Holland-Minkley, Munro Presented by Adam Sheffer.
A Worst Case, Constant Time Priority Queue: Beating a Lower Bound Ian Munro University of Waterloo Joint work with Andrej Brodnik (Ljubljana & Luleå) Svante.
Cpt S 223 – Advanced Data Structures Priority Queues
Λίστα Εργασιών External Memory Data Structures Vitter, J. S. and Shriver, E. 1994a. Algorithms for parallel memory I: Two-level memories. Algorithmica.
Implicit Dictionaries with O(1) Modifications per Update and Fast Search Gianni Franceschini and Ian Munro  Elements kept in 1 st n positions of an array.
Heaps Chapter 21. What is a heap used for? Sorting –HeapSort sorts an N-element array on O(N log N) time and uses very little extra memory Priority Queues.
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.
CHAPTER 5 PRIORITY QUEUES (HEAPS) §1 ADT Model Objects: A finite ordered list with zero or more elements. Operations:  PriorityQueue Initialize( int.
1 Binomial Tree Binomial tree. n Recursive definition: B k-1 B0B0 BkBk B0B0 B1B1 B2B2 B3B3 B4B4.
Four different data structures, each one best in a different setting. Simple Heap Balanced Heap Fibonacci Heap Incremental Heap Our results.
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.
HEAPS Amihood Amir Bar Ilan University Sorting Bubblesort: Until no exchanges: For i=1 to n-1 if A[i]>A[i+1] then exchange their values end Time.
S. Raskhodnikova and A. Smith. Based on slides by C. Leiserson and E. Demaine. 1 Adam Smith L ECTURES Priority Queues and Binary Heaps Algorithms.
Gerth stølting Brodal 1 Closing a Classical Data Structure Problem Gerth Stølting Brodal : Strict Fibonacci Heaps joint work with George Lagogiannis Robert.
Data StructuresData Structures Priority Queue. Recall Queues FIFO:First-In, First-Out Some contexts where this seems right? Some contexts where some things.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
Heaps & Priority Queues
Heaps and basic data structures David Kauchak cs161 Summer 2009.
Equivalence Between Priority Queues and Sorting in External Memory
Mergeable Heaps David Kauchak cs302 Spring Admin Homework 7?
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
CS6045: Advanced Algorithms Sorting Algorithms. Heap Data Structure A heap (nearly complete binary tree) can be stored as an array A –Root of tree is.
Dynamic Dictionaries Primary Operations:  get(key) => search  put(key, element) => insert  remove(key) => delete Additional operations:  ascend()
1 Chapter 6 Heapsort. 2 About this lecture Introduce Heap – Shape Property and Heap Property – Heap Operations Heapsort: Use Heap to Sort Fixing heap.
MotivationLocating the k largest subsequences: Main ideasResults Problem definitions Problem instance ( k=5 ) Bibliography
The Implicit ModelA Moveable DictionaryA Working Set Dictionary The implicit model is the RAM model but with some restrictions: you are only allowed to.
Nov 2, 2001CSE 373, Autumn Hash Table example marking deleted items + choice of table size.
arxiv.org/abs/ y 3-sided x1 x2 x1 x2 top-k
Self-Adjusting Data Structures
Priority Queue A Priority Queue Set S is made up of n elements: x0 x1 x2 x3 … xn-1 Functions: createEmptySet() returns a newly created empty priority.
A Worst Case, Constant Time Priority Queue
Experimental evaluation of Navigation piles
Topics covered (since exam 1):
Source: Muangsin / Weiss
Fundamentals of Python: From First Programs Through Data Structures
Topics covered (since exam 1):
STACS arxiv.org/abs/ y 3-sided x1 x2 x1 x2 top-k
Heap Sort CSE 2011 Winter January 2019.
Closing a Classical Data Structure Problem Gerth Stølting Brodal
Strict Fibonacci Heaps
8th Workshop on Massive Data Algorithms, August 23, 2016
Binary and Binomial Heaps
Fundamentals of Python: From First Programs Through Data Structures
Priority Queues Supports the following operations. Insert element x.
Presentation transcript:

(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty

2 Program Ian Munro : A Constant Time Priority Queue Gerth Brodal : A Constant Time Priority Queue

Priority Queue InsertExtractMin FindMin Delete DecreaseKey Meld ExtractMax (double-ended priority queue) 3

4 Communications of the ACM (1962) ,4,5,6,7,5,7 7,5 13,742,47,566,613, 

5 Communications of the ACM (1964)

Heap Simple Implicit – single array of size n Insert and ExtractMin O(log n) Willliams (1964) Construction O(n) Floyd(1964) Insert  (loglog n) comparisons Gonnet, Munro (1986) Select k smallest in O(k) time Frederickson (1993)

Comparison Lower Bound n x Insert + n x ExtractMin  Sorting 7  Insert or ExtractMin  (log n) comparisons Comparisons InsertExtractMin HeapO(log n) Binary searchO(log n)0 Carlsson, Munro, Poblette (1988)O(1)O(log n)

Priority Queues  Directions of Research 8 Comparisons vs Bit-tricks Single processor vs Parallel RAM vs Hierarchical memory Implicit vs Space wasting Insert- ExtractMin vs DecreaseKey, Meld,… Weak vs Strong O vs Constants Simplicity vs Let’s-do-something- complicated Worst-case vs Amortized Theory vs Implementation Aware vs Oblivious

Open Problem 9 Strongly implicit priority queue worst-case O(1) Insert and O(log n) ExtractMin supporting identical elements O(1) swaps per operation and cache oblivious optimal ? Can only store n + array between operations

Insert ExtractMin Implicit Swaps Identical elements Cache oblivious Heapslog n Stronglog nYes Carlsson, Munro, Poblette (1988) 1log nWeaklog nYes Arge, Bender, Demaine, Holland- Minkley, Munro (2002)  log n Yes Munro, Franceschini (2006)  log n Strong 11 Harvey, Zatloukal (2004) 11  log n Stronglog nYes Brodal, Nielsen, Truelsen (2013) 1log nStronglog n Open1xx1xx log n x Strong1x1x Yes x (Some Random) Results 10  amortized bounds Implicit dictionary O(  n) Munro, Suwanda (1980) O(log 2 n) Munro (1986) O(log 2 n/loglog n) Franceschini, Grossi, Munro, Pagli (2004)

Some Observations Bit = 1 Bit = 0 66 ??? Pair encoding: Munro (1986)  2log n elements can encode a pointer  O(log n) time allows pointer manipulations Strict implicit + O(1) insertions  Insertions ”close to oblivious”

Strict Implicit Priority Queue O(1) Insert and O(log n) ExtractMin 12 Forest, trees powers-of-2 Looser trees Pair-encode bits at nodes Insertions balance using LSB(n) …work in progress Brodal, Nielsen, Truelsen (2013)

Insert ExtractMin Implicit Swaps Identical elements Cache oblivious Heapslog n Stronglog nYes Carlsson, Munro, Poblette (1988) 1log nWeaklog nYes Arge, Bender, Demaine, Holland- Minkley, Munro (2002)  log n Yes Munro, Franceschini (2006)  log n Strong 11 Harvey, Zatloukal (2004) 11  log n Stronglog nYes Brodal, Nielsen, Truelsen (2013) 1log nStronglog n Open1xx1xx log n x Strong1x1x Yes x (Some Random) Results 13  amortized bounds Implicit dictionary O(  n) Munro, Suwanda (1980) O(log 2 n) Munro (1986) O(log 2 n/loglog n) Franceschini, Grossi, Munro, Pagli(2004)