A Worst Case, Constant Time Priority Queue: Beating a Lower Bound Ian Munro University of Waterloo Joint work with Andrej Brodnik (Ljubljana & Luleå) Svante.

Slides:



Advertisements
Similar presentations
David Luebke 1 6/1/2014 CS 332: Algorithms Medians and Order Statistics Structures for Dynamic Sets.
Advertisements

Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
AVL Trees COL 106 Amit Kumar Shweta Agrawal Slide Courtesy : Douglas Wilhelm Harder, MMath, UWaterloo
Msb(x) in O(1) steps using 5 multiplications Word size n = g∙g, g a power of 2 [M.L. Fredman, D.E. Willard, Surpassing the information-theoretic bound.
CS 332: Algorithms Binary Search Trees. Review: Dynamic Sets ● Next few lectures will focus on data structures rather than straight algorithms ● In particular,
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
CPSC 231 B-Trees (D.H.)1 LEARNING OBJECTIVES Problems with simple indexing. Multilevel indexing: B-Tree. –B-Tree creation: insertion and deletion of nodes.
Universal Hashing When attempting to foil an malicious adversary, randomize the algorithm Universal hashing: pick a hash function randomly when the algorithm.
1 Succinct Priority Indexing Structures for the Management of Large Priority Queues Hao Wang and Bill Lin University of California, San Diego IEEE IWQoS.
2 -1 Analysis of algorithms Best case: easiest Worst case Average case: hardest.
BST Data Structure A BST node contains: A BST contains
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Cache Oblivious Search Trees via Binary Trees of Small Height
Tirgul 4 Order Statistics Heaps minimum/maximum Selection Overview
David Luebke 1 7/2/2015 ITCS 6114 Binary Search Trees.
David Luebke 1 7/2/2015 Medians and Order Statistics Structures for Dynamic Sets.
B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node.
Index Structures Parin Shah Id:-207. Topics Introduction Structure of B-tree Features of B-tree Applications of B-trees Insertion into B-tree Deletion.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Mike 66 Sept Succinct Data Structures: Techniques and Lower Bounds Ian Munro University of Waterloo Joint work with/ work of Arash Farzan, Alex Golynski,
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Data structures for Bandwidth Reservations and Quality of Service on the Internet Andreas Nilsson Division of Computer Science and Networking Department.
Wolfgang Mulzer Institut f ür Informatik Data Structures on Event Graphs Bernard ChazelleWolfgang Mulzer FU Berlin Princeton University.
Trevor Brown – University of Toronto B-slack trees: Space efficient B-trees.
Chapter 11 Heap. Overview ● The heap is a special type of binary tree. ● It may be used either as a priority queue or as a tool for sorting.
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
An experimental study of priority queues By Claus Jensen University of Copenhagen.
A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree Anthony Kim, 2005 Computer Systems Research.
1 Searching Searching in a sorted linked list takes linear time in the worst and average case. Searching in a sorted array takes logarithmic time in the.
Data Structures: Advanced Damian Gordon. Advanced Data Structure We’ll look at: – Linked Lists – Trees – Stacks – Queues.
B-Tree – Delete Delete 3. Delete 8. Delete
Lecture 11COMPSCI.220.FS.T Balancing an AVLTree Two mirror-symmetric pairs of cases to rebalance the tree if after the insertion of a new key to.
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.
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.
Trees Chapter 23 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Heaps and basic data structures David Kauchak cs161 Summer 2009.
Red-Black Trees. Review: Binary Search Trees ● Binary Search Trees (BSTs) are an important data structure for dynamic sets ● In addition to satellite.
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
B-Trees Katherine Gurdziel 252a-ba. Outline What are b-trees? How does the algorithm work? –Insertion –Deletion Complexity What are b-trees used for?
Sorting Lower Bounds n Beating Them. Recap Divide and Conquer –Know how to break a problem into smaller problems, such that –Given a solution to the smaller.
CS6045: Advanced Algorithms Sorting Algorithms. Sorting So Far Insertion sort: –Easy to code –Fast on small inputs (less than ~50 elements) –Fast on nearly-sorted.
(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty.
Final Exam Review COP4530.
lsb(x) = Least Significant Bit ?
A Worst Case, Constant Time Priority Queue
Experimental evaluation of Navigation piles
Topics covered (since exam 1):
O(lg n) Search Tree Tree T is a search tree made up of n elements: x0 x1 x2 x3 … xn-1 No function (except transverse) takes more than O(lg n) in the.
Fast Trie Data Structures
Topics covered (since exam 1):
B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node.
Keys into Buckets: Lower bounds, Linear-time sort, & Hashing
Topics covered (since exam 1):
Final Exam Review COP4530.
(2,4) Trees 2/15/2019 (2,4) Trees (2,4) Trees.
CPS216: Advanced Database Systems
Balanced binary search trees
Binary and Binomial Heaps
Topic 5: Heap data structure heap sort Priority queue
Melding Priority Queues
Chapter 8: Overview Comparison sorts: algorithms that sort sequences by comparing the value of elements Prove that the number of comparison required to.
Priority Queues Supports the following operations. Insert element x.
Succinct Data Structures
Sorting We have actually seen already two efficient ways to sort:
Invitation to Computer Science 5th Edition
Presentation transcript:

A Worst Case, Constant Time Priority Queue: Beating a Lower Bound Ian Munro University of Waterloo Joint work with Andrej Brodnik (Ljubljana & Luleå) Svante Carlsson (Blekinge Inst. Tech.) Johan Karlsson (Luleå)

Lower Bounds: What do they mean? If upper and lower bounds match, the problem is solved. If lower bound exceeds the time you can take … give up

Lower Bounds: What do they mean? If upper and lower bounds match, the problem is solved. If lower bound exceeds the time you can take … give up Lower bounds, and upper bounds, are proven under a model. So if you have to “get under” a lower bound -focus on the operations the model does not permit It’s time to become imaginative in terms of permitted operations

Beating Lower Bounds: Examples Searching: lg n lower bound on comparisons, so hash lg n time becomes constant Sorting: n lg n lower bound on comparisons, so use variants of bucketing n lg n time easily linear on average n lg n time becomes n lg lg n even in worst case

Beating the Lower Bound … Another Case Self organizing linear search… Move to front heuristic (  rheuistic ) is within a constant factor of offline optimal for linear search, amortized cost of searching is ~ 1/p i under “exchange adjacent” model But … n/2 n/2+1 … n costs  (n 2 ) Under “exchange any two” model offline cost is ~lg(1/p i ) … comparable to splay trees

The Problem at hand: Extended Priority Queue van Emde Boas (SWAT i.e. FOCS 1975) Universe integers [1,..m] {n of which are present} Operations:insert / delete find least value  x (or greatest  ) Bound: O(lg lg m) time Space: Improved to O(m) bits Model: Standard RAM, with bit twiddling

Some Subsequent Work Kurt Mehlhorn, Stephan Näher and Helmut Alt (SiComp ‘88): vEB is optimal - Lower bound  (lg lg m) on pointer machine Peter Miltersen (STOC ‘94): Lower bound  (  lg lg m) on a RAM Paul Beame and Faith Fich (STOC ‘99): parameterization by number of values present matching upper & lower bounds-  (  lg n/ lg lg n) Ram model is rather powerful, how can we extend it for our problem?

Another Model: Rambo Random Access Machine with Byte Overlap Mike Fredman and Dan Willard Several words can share bits:

Can we do better under this model? Elements are at leaves; an internal node is flagged if it has a descendant lg n bit RAMBO word at leaf takes bit pattern of flags on path to root Can find lowest ancestor in O(1) time

The vEB Stratified Tree Internal node keeps track of “outside” bottom elements

A Problem Any individual leaf may be referred to by many ancestors So one insertion/deletion can require up to 2lg n reference changes Modify the approach

Split Tagged Tree Keep track of left / right inside leaf … if different from parent’s Each leaf can be referred to by at most two ancestors

So what do we have? Constant time “extended priority queue” … two memory accesses for search, three for update on our model How much space do we need? 2m + O(lg m) bits of ordinary RAM m bits of RAMBO memory in a particular configuration we call Yggdrasil and it has been implemented in hardware