The Implicit ModelA Moveable DictionaryA Working Set Dictionary The implicit model is the RAM model but with some restrictions: you are only allowed to.

Slides:



Advertisements
Similar presentations
The Dictionary ADT Definition A dictionary is an ordered or unordered list of key-element pairs, where keys are used to locate elements in the list. Example:
Advertisements

Chapter 4: Trees Part II - AVL Tree
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Casper Kejlberg-Rasmussen 1/16 Cache-Oblivious Implicit Predecessor Dictionaries with the Working-Set Property Casper Kejlberg-Rasmussen Joint work with.
B+-Trees (PART 1) What is a B+ tree? Why B+ trees? Searching a B+ tree
November 5, Algorithms and Data Structures Lecture VIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Multiversion Access Methods - Temporal Indexing. Basics A data structure is called : Ephemeral: updates create a new version and the old version cannot.
O(log n) bits or atomic elements
B-Trees. Motivation for B-Trees Index structures for large datasets cannot be stored in main memory Storing it on disk requires different approach to.
Hashing CS 3358 Data Structures.
Data Structures & Algorithms
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
Tirgul 5 AVL trees.
Memory Management Memory Areas and their use Memory Manager Tasks:
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
Trees and Red-Black Trees Gordon College Prof. Brinton.
Tirgul 7. Find an efficient implementation of a dynamic collection of elements with unique keys Supported Operations: Insert, Search and Delete. The keys.
COMP 171 Data Structures and Algorithms Tutorial 10 Hash Tables.
B + -Trees (Part 1). Motivation AVL tree with N nodes is an excellent data structure for searching, indexing, etc. –The Big-Oh analysis shows most operations.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
B + -Trees (Part 1) COMP171. Slide 2 Main and secondary memories  Secondary storage device is much, much slower than the main RAM  Pages and blocks.
CSE 326: Data Structures B-Trees Ben Lerner Summer 2007.
Tirgul 7 Heaps & Priority Queues Reminder Examples Hash Tables Reminder Examples.
B-Trees. CSM B-Trees 2 Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so.
Hashing General idea: Get a large array
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
Advanced Topics in Algorithms and Data Structures 1 Two parallel list ranking algorithms An O (log n ) time and O ( n log n ) work list ranking algorithm.
Maps A map is an object that maps keys to values Each key can map to at most one value, and a map cannot contain duplicate keys KeyValue Map Examples Dictionaries:
Heapsort Based off slides by: David Matuszek
ICS 220 – Data Structures and Algorithms Week 7 Dr. Ken Cosh.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
Memory organization - storing variables efficiently in the RAM memory.
Problems and MotivationsOur ResultsTechnical Contributions Membership: Maintain a set S in the universe U with |S| ≤ n. Given an x in U, answer whether.
(C) 2010 Pearson Education, Inc. All rights reserved. Java How to Program, 8/e.
10.4 How to Find a Perfect Matching We have a condition for the existence of a perfect matching in a graph that is necessary and sufficient. Does this.
B-Trees. CSM B-Trees 2 Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Sorting Fun1 Chapter 4: Sorting     29  9.
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.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
Hashing Sections 10.2 – 10.3 CS 302 Dr. George Bebis.
B-Trees. Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so much data that it.
CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
B-Trees. CSM B-Trees 2 Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so.
Symbol Tables and Search Trees CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
CS 61B Data Structures and Programming Methodology July 21, 2008 David Sun.
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.
3.3 Complexity of Algorithms
Skip Lists 二○一七年四月二十五日
Tirgul 11 Notes Hash tables –reminder –examples –some new material.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
3.1. Binary Search Trees   . Ordered Dictionaries Keys are assumed to come from a total order. Old operations: insert, delete, find, …
Hashing COMP171. Hashing 2 Hashing … * Again, a (dynamic) set of elements in which we do ‘search’, ‘insert’, and ‘delete’ n Linear ones: lists, stacks,
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
HeapSort 25 March HeapSort Heaps or priority queues provide a means of sorting: 1.Construct a heap, 2.Add each item to it (maintaining the heap.
Bushy Binary Search Tree from Ordered List. Behavior of the Algorithm Binary Search Tree Recall that tree_search is based closely on binary search. If.
Internal Memory Pointer MachineRandom Access MachineStatic Setting Data resides in records (nodes) that can be accessed via pointers (links). The priority.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
(A Survey on) Priority Queues IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013 Gerth Stølting Brodal Aarhus Universty.
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
Database Applications (15-415) DBMS Internals- Part III Lecture 13, March 06, 2016 Mohammad Hammoud.
The Range Mode ProblemCell Probe Lower Bounds for the Range Mode ProblemThe Range k-frequency Problem Preprocess an array A of n elements into a space.
Multiway Search Trees Data may not fit into main memory
B-Trees B-Trees.
Red Black Trees
Algorithms and Data Structures Lecture VIII
B-Trees.
Hash Maps Introduction
Heaps & Multi-way Search Trees
Presentation transcript:

The Implicit ModelA Moveable DictionaryA Working Set Dictionary The implicit model is the RAM model but with some restrictions: you are only allowed to store exactly the n elements that you are to build the data structure over, nothing more. That means that the n elements are laid out in an array of n elements. So we cannot e.g. leave some of the entries empty, as they would still occupy space. While performing operations you are allowed to store O(1) words of memory, i.e. O(log n) bits of memory. When an operation finishes we forget the O(1) words of memory we could use during the operation. To make the working set dictionary we will need a moveable version of the dictionary (a FG dict) from [FG 2003], i.e. insertions and deletions can happen at both ends of the array. We obtain it using at most 4 instances of the FG dict. In its basic form the moveable dictionary consists of FG dicts L, C and R, growing to the left, left/right and right, respectively. C can be growing in either way depending which time we look at it. It is easy to move this dictionary one element to the left by taking an element from R and putting it into L, likewise it is simple to move it right. The trouble comes if L or R becomes empty or too large compared to C, hence we trigger a job to either grow or shrink L or R. A job simply performs its task by executing a constant number of steps during each insert, delete, search or predecessor/successor operation. To grow L when it becomes to small we use the simple trick of address- mapping to split one of the FG dicts into two parts – see L in grow-left and L’ in shrink-left – that way we can take elements from C and put into L’ while we shrink L further, and when L’ grows enough it takes over the role of L. We do simlar for shrink-left, see the right of the above figure. The working set dictionary is now constructed from moveable dictionaries of double exponentially increasing size. The working set dictionary is divided into blocks where the i’th block is of size Θ(2 2 i ). The i’th block further consists of a set of elements D i, and three moveable dictionaries L i, C i and R i. Here elements in R i are ready to move to D i+1 or L i+1 in block B i+1 and elements in C i are waiting to be promoted to be in R i. It is now easy to make a search in O(log l) time: for an element, we first search in B 0 then B 1 and so until we find the element we are searching for or nothing. In each block B i we search in D i by a scan and in L i, C i and R i using the search function of the moveable dictionary. We then remove the found element e of block B j, where j = log l, and insert it into block B 0 and move a element from R i to L i+1 for i = 0,…,j-1. If R i runs out of elements we rename C i to R i, L i to C i and make a new empty L i. This way we spend time The Fundamental Trick The fundamental trick to do anything in this models is to encode bits using permutations of elements. That is say we want to encode k bits, then we can encode them into 2k elements where we for the first two elements x and y encode a 0 iff x = min(x,y) and a 1 iff x = max(x,y). We encode the remaining k-1 bits the same way using the other k-1 pairs of elements. The Working Set Property The working set distance l of a key x is the number of keys we have accessed since we last searched for x. A dictionary has the working set property if the search time for a key x is expressesed in terms of l, in our result the search cost is O(log l). Future / Current Work We are currently working on doing the predecessor and successor search in the working set time also, that is we get search and predecessor/ successor in O(log l) time and insert and delete in O(log n) time, using no space. This will still be cache-oblivious because we again use the moveable dictionary that again uses the FG dict. Previous Work Our result is the first implicit dictionary with the working set property, and it is in fact also cache-oblivious, which is a property we inherent from the dictionary of [FG 2003] which we use as a black box. References [I 2001] Iacono - Alternatives to splay trees with O(log(n)) worst-case access times. SODA [FG 2003] Franceschini, Grossi - Optimal worst-case operations for implicit cache-oblivious search trees. WADS [BHM 2009] Bose, Howat, Morin - A distribution-sensitive dictionary with low space overhead. WADS [BKT 2010] Brodal, Kejlberg-Rasmussen, Truelsen - A Cache-Oblivious Implicit Dictionary with the Working Set Property. ISAAC A Cache-Oblivious Implicit Dictionary with the Working Set Property MADALGO – Center for Massive Data Algorithmics, a Center of the Danish National Research Foundation Casper Kejlberg-Rasmussen Aarhus University n Jakob Truelsen Aarhus University ReferenceInsert / DeleteSearch Predecessor / Successor Additional space (words) [I 2001]O(log n)O(log l) O(n)O(n) [FG 2003]O(log n) None [BHM 2009]O(log n)O(log l) exp.O(log n)O(loglog n) [BHM 2009]O(log n)O(log l) exp. O(√n) [BKT 2010]O(log n)O(log l)O(log n)None 2k2k x y 0 iff x = min(x,y) 1 iff x = max(x,y)