SCALABLE GRAPH PROCESSING on RECONFIGURABLE SYSTEMS by ROBERT G. KIRCHGESSNER a DISSERTATION PRESENTED to the GRADUATE SCHOOL OF

Total Page:16

File Type:pdf, Size:1020Kb

SCALABLE GRAPH PROCESSING on RECONFIGURABLE SYSTEMS by ROBERT G. KIRCHGESSNER a DISSERTATION PRESENTED to the GRADUATE SCHOOL OF SCALABLE GRAPH PROCESSING ON RECONFIGURABLE SYSTEMS By ROBERT G. KIRCHGESSNER A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA 2016 © 2016 Robert G. Kirchgessner To my parents, Robert and Janette, and my wife Minjeong ACKNOWLEDGMENTS I would like to express my deepest gratitude to all those who have helped me down this long road towards completing my doctoral studies. I thank my advisor, Dr. Alan George, for his wisdom, guidance, and support both academically and personally throughout my graduate studies; and my co-advisor, Dr. Greg Stitt, whose invaluable academic insights helped shape my research. I thank Vitaliy Gleyzer, for his invaluable feedback, suggestions, and guidance, making me a better researcher, and MIT/LL for their support and resources which made this work possible. I would also like to thank my committee members, Dr. Herman Lam and Dr. Darin Acosta, for their important suggestions, advice, and feedback on my work. Additionally, I thank my friends and colleagues: Kenneth Hill, Bryant Lam, Abhijeet Lawande, Adam Lee, Barath Ramesh, and Gongyu Wang, who have always provided me with support, both in my research and personal life. Furthermore, I would like to thank my loving wife, without whom this would have not been possible, and my parents, who knew I could achieve this well before I knew it myself. Last but certainly not least, this work was supported in part by the I/UCRC Program of the National Science Foundation under Grant Nos. EEC-0642422 and IIP-1161022. I would like to gratefully acknowledge equipment, tools, and source code provided by Altera (now part of Intel), Xilinx, GiDEL, Nallatech and DRC Computing. 4 TABLE OF CONTENTS page ACKNOWLEDGMENTS ................................... 4 LIST OF TABLES ...................................... 7 LIST OF FIGURES ..................................... 8 ABSTRACT ......................................... 10 CHAPTER 1 INTRODUCTION ................................... 12 1.1 Field-Programmable Gate Arrays ........................ 13 1.2 Graph Processing using Linear-Algebra Primitives ................ 15 2 PRODUCTIVITY AND PORTABILITY MIDDLEWARE FOR FPGA APPLICATIONS 17 2.1 Background and Related Research ........................ 19 2.2 Approach ..................................... 22 2.2.1 Hardware Abstraction .......................... 24 2.2.2 Software Abstraction ........................... 27 2.2.3 Metadata and Extensible Core Library .................. 29 2.2.4 RC Middleware Toolchain ........................ 31 2.3 Results and Analysis ............................... 37 2.3.1 Convolution Case Study ......................... 37 2.3.2 Analysis of Performance and Area Overhead ............... 41 2.3.3 Analysis of Productivity ......................... 46 2.3.4 Analysis of Portability .......................... 48 2.4 Summary and Conclusions ............................ 50 3 EFFICIENT STORAGE FORMATS FOR SCALABLE FPGA GRAPH PROCESSING 52 3.1 Background and Related Research ........................ 54 3.1.1 Coordinate Format (COO) ........................ 55 3.1.2 Compressed Sparse-Column/Row Format (CSC/R) ........... 55 3.1.3 Doubly Compressed Sparse-Column/Row (DCSC/R) .......... 56 3.1.4 ELLPACK Format ............................ 56 3.1.5 Jagged Diagonal Format (JDS/TJDS) .................. 57 3.1.6 Minimal Quadtree Format (MQT) .................... 57 3.2 Approach ..................................... 57 3.2.1 Hashed-Index Sparse-Column/Row (HISC/R) .............. 58 3.2.2 Hashed-Indexing Vector ......................... 58 3.2.3 HISC/R Nonzero Storage ........................ 60 3.2.4 Non-zero Lookups and Insertions .................... 61 3.2.5 Storage Analysis ............................. 62 5 3.3 Results and Analysis ............................... 64 3.3.1 Storage comparison ............................ 65 3.3.2 Performance Comparison ......................... 67 3.4 Summary and Conclusions ............................ 69 4 EXTENSIBLE FPGA ARCHITECTURE FOR SCALABLE GRAPH PROCESSING .. 71 4.1 Background and Related Research ........................ 73 4.1.1 Accelerating Sparse-Matrix Operations on FPGAs ............ 73 4.1.2 Standards for Graph Processing using Linear Algebra .......... 76 4.1.3 Linear-Algebra Formulation of Breadth-First Search ........... 76 4.2 Extensible Graph-Processor Architecture .................... 78 4.2.1 Merge-Sorter Architecture ........................ 79 4.2.1.1 Sorting-pipeline architecture .................. 84 4.2.1.2 Merge-sorter controller .................... 85 4.2.1.3 Merge-sorter performance analysis .............. 86 4.2.2 ALU Architecture ............................. 88 4.2.3 HISC/R Storage Controller ........................ 89 4.2.4 FPGA Resource Analysis ......................... 93 4.3 Experimental Setup ............................... 93 4.4 Case Study: Sparse Generalized Matrix-Matrix Multiplication ......... 94 4.5 Case Study: Breadth-First Search ........................ 96 4.6 Graph-Processor Architecture Scalability Analysis ................ 97 4.7 Summary and Conclusions ............................ 99 5 CONCLUSIONS .................................... 101 REFERENCES ........................................ 104 BIOGRAPHICAL SKETCH ................................. 111 6 LIST OF TABLES Table page 2-1 Currently supported RC Middleware platforms. .................... 37 2-2 Comparison of lines of code required when using RC Middleware. .......... 39 2-3 Total map-generation time, estimated area and latency, and actual area and execu- tion time for convolution case study optimizing for performance or area. ....... 39 2-4 Execution time and area for various applications and kernels on each supported RC Middleware platform. ................................. 49 3-1 Definition of variables for sparse-matrix complexity analysis. ............. 54 3-2 Analysis of popular sparse-matrix storage formats. .................. 55 4-1 Merge-sorter PE next-state logic. ........................... 81 4-2 Graph-processor resource analysis. ........................... 93 4-3 Summary of parameters used to simulate SpGEMM scalability. ............ 99 7 LIST OF FIGURES Figure page 1-1 FPGA architecture overview. ............................. 14 2-1 Overview of RC Middleware design flow. ....................... 23 2-2 RC Middleware hardware-abstraction layers enabling application portability between GiDEL PROCStar III and Pico M501. ......................... 24 2-3 Overview of RC Middleware's hardware presentation layer .............. 27 2-4 Overview of RC Middleware's software stack and generated C++ application stub . 28 2-5 Example of application-description XML format. ................... 30 2-6 Overview of RC Middleware toolchain from application specification to vendor- specific project generation. .............................. 32 2-7 Example of RC Middleware mapping two application read interface to a single phys- ical memory ...................................... 35 2-8 Area- and performance-optimized mapping results for mapping convolution applica- tion on PROCStar III/IV. ............................... 38 2-9 Host and FPGA read and write performance to external memory for PROCStar III/IV, M501, and PCIe-385N. ............................. 42 2-10 Host and FPGA read and write overhead to external memory for PROCStar III/IV, and M501 ....................................... 43 2-11 FPGA resource analysis for vendor, application, and RC Middleware components. .. 45 3-1 Comparison of the indexing techniques used by CSC/R, DCSC/R, and HISC/R. .. 58 3-2 Comparison of average hash table probes required for row/column lookups vs. load factor for different hash table types. .......................... 60 3-3 Overview of HISC/R with segmented storage vectors using initial segment size L0 and growth factor k. .................................. 61 3-4 Pseudocode for HISC column lookups. ........................ 62 3-5 Pseudocode for HISC non-zero insertions. ....................... 63 3-6 Average storage ratio normalizing HISC/R and HISC/R (unsegmented) by CSC/R for randomly generated scale-30 Kronecker matrices. ................. 66 3-7 Average storage ratio normalizing HISC/R and HISC/R (unsegmented) by DCSC/R for randomly generated scale-30 Kronecker matrices. ................. 67 8 3-8 Comparison of total reads required to perform sparse matrix/matrix multiplication using HISC/R compared with CSC/R and DCSC/R. ................. 68 4-1 Pseudocode for vertex-centric breadth-first search. .................. 77 4-2 Graph adjacency-matrix representation. ........................ 77 4-3 Overview of graph-processor architecture. ....................... 79 4-4 Architecture diagram of merge-sorter PE. ....................... 81 4-5 Architecture diagram of merge-sorter pipeline. .................... 82 4-6 Pseudocode for systolic-array priority function. .................... 83 4-7 Merge-sorter architecture overview. .......................... 85 4-8 Overview of merge-sorter sorting modes ........................ 86 4-9 Pipelined merge-sorter performance analysis. ..................... 88 4-10 Design of our ALU supporting various semirings. ................... 89 4-11 Comparison of tabulation-hash quality metric for different PRNGs. ......... 91 4-12 Controller architecture for HISC/R storage format. .................. 92 4-13 Comparison of our architecture running SpGEMM with CombBLAS and SuiteSparse
Recommended publications
  • Linear Probing with Constant Independence
    Linear Probing with Constant Independence Anna Pagh∗ Rasmus Pagh∗ Milan Ruˇzic´ ∗ ABSTRACT 1. INTRODUCTION Hashing with linear probing dates back to the 1950s, and Hashing with linear probing is perhaps the simplest algo- is among the most studied algorithms. In recent years it rithm for storing and accessing a set of keys that obtains has become one of the most important hash table organiza- nontrivial performance. Given a hash function h, a key x is tions since it uses the cache of modern computers very well. inserted in an array by searching for the first vacant array Unfortunately, previous analyses rely either on complicated position in the sequence h(x), h(x) + 1, h(x) + 2,... (Here, and space consuming hash functions, or on the unrealistic addition is modulo r, the size of the array.) Retrieval of a assumption of free access to a truly random hash function. key proceeds similarly, until either the key is found, or a Already Carter and Wegman, in their seminal paper on uni- vacant position is encountered, in which case the key is not versal hashing, raised the question of extending their anal- present in the data structure. Deletions can be performed ysis to linear probing. However, we show in this paper that by moving elements back in the probe sequence in a greedy linear probing using a pairwise independent family may have fashion (ensuring that no key x is moved beyond h(x)), until expected logarithmic cost per operation. On the positive a vacant array position is encountered. side, we show that 5-wise independence is enough to ensure Linear probing dates back to 1954, but was first analyzed constant expected time per operation.
    [Show full text]
  • CSC 344 – Algorithms and Complexity Why Search?
    CSC 344 – Algorithms and Complexity Lecture #5 – Searching Why Search? • Everyday life -We are always looking for something – in the yellow pages, universities, hairdressers • Computers can search for us • World wide web provides different searching mechanisms such as yahoo.com, bing.com, google.com • Spreadsheet – list of names – searching mechanism to find a name • Databases – use to search for a record • Searching thousands of records takes time the large number of comparisons slows the system Sequential Search • Best case? • Worst case? • Average case? Sequential Search int linearsearch(int x[], int n, int key) { int i; for (i = 0; i < n; i++) if (x[i] == key) return(i); return(-1); } Improved Sequential Search int linearsearch(int x[], int n, int key) { int i; //This assumes an ordered array for (i = 0; i < n && x[i] <= key; i++) if (x[i] == key) return(i); return(-1); } Binary Search (A Decrease and Conquer Algorithm) • Very efficient algorithm for searching in sorted array: – K vs A[0] . A[m] . A[n-1] • If K = A[m], stop (successful search); otherwise, continue searching by the same method in: – A[0..m-1] if K < A[m] – A[m+1..n-1] if K > A[m] Binary Search (A Decrease and Conquer Algorithm) l ← 0; r ← n-1 while l ≤ r do m ← (l+r)/2 if K = A[m] return m else if K < A[m] r ← m-1 else l ← m+1 return -1 Analysis of Binary Search • Time efficiency • Worst-case recurrence: – Cw (n) = 1 + Cw( n/2 ), Cw (1) = 1 solution: Cw(n) = log 2(n+1) 6 – This is VERY fast: e.g., Cw(10 ) = 20 • Optimal for searching a sorted array • Limitations: must be a sorted array (not linked list) binarySearch int binarySearch(int x[], int n, int key) { int low, high, mid; low = 0; high = n -1; while (low <= high) { mid = (low + high) / 2; if (x[mid] == key) return(mid); if (x[mid] > key) high = mid - 1; else low = mid + 1; } return(-1); } Searching Problem Problem: Given a (multi)set S of keys and a search key K, find an occurrence of K in S, if any.
    [Show full text]
  • Implementing the Map ADT Outline
    Implementing the Map ADT Outline ´ The Map ADT ´ Implementation with Java Generics ´ A Hash Function ´ translation of a string key into an integer ´ Consider a few strategies for implementing a hash table ´ linear probing ´ quadratic probing ´ separate chaining hashing ´ OrderedMap using a binary search tree The Map ADT ´A Map models a searchable collection of key-value mappings ´A key is said to be “mapped” to a value ´Also known as: dictionary, associative array ´Main operations: insert, find, and delete Applications ´ Store large collections with fast operations ´ For a long time, Java only had Vector (think ArrayList), Stack, and Hashmap (now there are about 67) ´ Support certain algorithms ´ for example, probabilistic text generation in 127B ´ Store certain associations in meaningful ways ´ For example, to store connected rooms in Hunt the Wumpus in 335 The Map ADT ´A value is "mapped" to a unique key ´Need a key and a value to insert new mappings ´Only need the key to find mappings ´Only need the key to remove mappings 5 Key and Value ´With Java generics, you need to specify ´ the type of key ´ the type of value ´Here the key type is String and the value type is BankAccount Map<String, BankAccount> accounts = new HashMap<String, BankAccount>(); 6 put(key, value) get(key) ´Add new mappings (a key mapped to a value): Map<String, BankAccount> accounts = new TreeMap<String, BankAccount>(); accounts.put("M",); accounts.put("G", new BankAcnew BankAccount("Michel", 111.11)count("Georgie", 222.22)); accounts.put("R", new BankAccount("Daniel",
    [Show full text]
  • SAHA: a String Adaptive Hash Table for Analytical Databases
    applied sciences Article SAHA: A String Adaptive Hash Table for Analytical Databases Tianqi Zheng 1,2,* , Zhibin Zhang 1 and Xueqi Cheng 1,2 1 CAS Key Laboratory of Network Data Science and Technology, Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China; [email protected] (Z.Z.); [email protected] (X.C.) 2 University of Chinese Academy of Sciences, Beijing 100049, China * Correspondence: [email protected] Received: 3 February 2020; Accepted: 9 March 2020; Published: 11 March 2020 Abstract: Hash tables are the fundamental data structure for analytical database workloads, such as aggregation, joining, set filtering and records deduplication. The performance aspects of hash tables differ drastically with respect to what kind of data are being processed or how many inserts, lookups and deletes are constructed. In this paper, we address some common use cases of hash tables: aggregating and joining over arbitrary string data. We designed a new hash table, SAHA, which is tightly integrated with modern analytical databases and optimized for string data with the following advantages: (1) it inlines short strings and saves hash values for long strings only; (2) it uses special memory loading techniques to do quick dispatching and hashing computations; and (3) it utilizes vectorized processing to batch hashing operations. Our evaluation results reveal that SAHA outperforms state-of-the-art hash tables by one to five times in analytical workloads, including Google’s SwissTable and Facebook’s F14Table. It has been merged into the ClickHouse database and shows promising results in production. Keywords: hash table; analytical database; string data 1.
    [Show full text]
  • Hash Tables & Searching Algorithms
    Search Algorithms and Tables Chapter 11 Tables • A table, or dictionary, is an abstract data type whose data items are stored and retrieved according to a key value. • The items are called records. • Each record can have a number of data fields. • The data is ordered based on one of the fields, named the key field. • The record we are searching for has a key value that is called the target. • The table may be implemented using a variety of data structures: array, tree, heap, etc. Sequential Search public static int search(int[] a, int target) { int i = 0; boolean found = false; while ((i < a.length) && ! found) { if (a[i] == target) found = true; else i++; } if (found) return i; else return –1; } Sequential Search on Tables public static int search(someClass[] a, int target) { int i = 0; boolean found = false; while ((i < a.length) && !found){ if (a[i].getKey() == target) found = true; else i++; } if (found) return i; else return –1; } Sequential Search on N elements • Best Case Number of comparisons: 1 = O(1) • Average Case Number of comparisons: (1 + 2 + ... + N)/N = (N+1)/2 = O(N) • Worst Case Number of comparisons: N = O(N) Binary Search • Can be applied to any random-access data structure where the data elements are sorted. • Additional parameters: first – index of the first element to examine size – number of elements to search starting from the first element above Binary Search • Precondition: If size > 0, then the data structure must have size elements starting with the element denoted as the first element. In addition, these elements are sorted.
    [Show full text]
  • Chapter 5 Hashing
    Introduction hashing performs basic operations, such as insertion, Chapter 5 deletion, and finds in average time Hashing 2 Hashing Hashing Functions a hash table is merely an of some fixed size let be the set of search keys hashing converts into locations in a hash hash functions map into the set of in the table hash table searching on the key becomes something like array lookup ideally, distributes over the slots of the hash table, to minimize collisions hashing is typically a many-to-one map: multiple keys are if we are hashing items, we want the number of items mapped to the same array index hashed to each location to be close to mapping multiple keys to the same position results in a example: Library of Congress Classification System ____________ that must be resolved hash function if we look at the first part of the call numbers two parts to hashing: (e.g., E470, PN1995) a hash function, which transforms keys into array indices collision resolution involves going to the stacks and a collision resolution procedure looking through the books almost all of CS is hashed to QA75 and QA76 (BAD) 3 4 Hashing Functions Hashing Functions suppose we are storing a set of nonnegative integers we can also use the hash function below for floating point given , we can obtain hash values between 0 and 1 with the numbers if we interpret the bits as an ______________ hash function two ways to do this in C, assuming long int and double when is divided by types have the same length fast operation, but we need to be careful when choosing first method uses
    [Show full text]
  • Pseudorandom Data and Universal Hashing∗
    CS369N: Beyond Worst-Case Analysis Lecture #6: Pseudorandom Data and Universal Hashing∗ Tim Roughgardeny April 14, 2014 1 Motivation: Linear Probing and Universal Hashing This lecture discusses a very neat paper of Mitzenmacher and Vadhan [8], which proposes a robust measure of “sufficiently random data" and notes interesting consequences for hashing and some related applications. We consider hash functions from N = f0; 1gn to M = f0; 1gm. Canonically, m is much smaller than n. We abuse notation and use N; M to denote both the sets and the cardinalities of the sets. Since a hash function h : N ! M is effectively compressing a larger set into a smaller one, collisions (distinct elements x; y 2 N with h(x) = h(y)) are inevitable. There are many way of resolving collisions. One that is common in practice is linear probing, where given a data element x, one starts at the slot h(x), and then proceeds to h(x) + 1, h(x) + 2, etc. until a suitable slot is found. (Either an empty slot if the goal is to insert x; or a slot that contains x if the goal is to search for x.) The linear search wraps around the table (from slot M − 1 back to 0), if needed. Linear probing interacts well with caches and prefetching, which can be a big win in some application. Recall that every fixed hash function performs badly on some data set, since by the Pigeonhole Principle there is a large data set of elements with equal hash values. Thus the analysis of hashing always involves some kind of randomization, either in the input or in the hash function.
    [Show full text]
  • Collisions There Is Still a Problem with Our Current Hash Table
    18.1 Hashing 1061 Since our mapping from element value to preferred index now has a bit of com- plexity to it, we might turn it into a method that accepts the element value as a parameter and returns the right index for that value. Such a method is referred to as a hash function , and an array that uses such a function to govern insertion and deletion of its elements is called a hash table . The individual indexes in the hash table are also sometimes informally called buckets . Our hash function so far is the following: private int hashFunction(int value) { return Math.abs(value) % elementData.length; } Hash Function A method for rapidly mapping between element values and preferred array indexes at which to store those values. Hash Table An array that stores its elements in indexes produced by a hash function. Collisions There is still a problem with our current hash table. Because our hash function wraps values to fit in the array bounds, it is now possible that two values could have the same preferred index. For example, if we try to insert 45 into the hash table, it maps to index 5, conflicting with the existing value 5. This is called a collision . Our imple- mentation is incomplete until we have a way of dealing with collisions. If the client tells the set to insert 45 , the value 45 must be added to the set somewhere; it’s up to us to decide where to put it. Collision When two or more element values in a hash table produce the same result from its hash function, indicating that they both prefer to be stored in the same index of the table.
    [Show full text]
  • Cuckoo Hashing
    Cuckoo Hashing Outline for Today ● Towards Perfect Hashing ● Reducing worst-case bounds ● Cuckoo Hashing ● Hashing with worst-case O(1) lookups. ● The Cuckoo Graph ● A framework for analyzing cuckoo hashing. ● Analysis of Cuckoo Hashing ● Just how fast is cuckoo hashing? Perfect Hashing Collision Resolution ● Last time, we mentioned three general strategies for resolving hash collisions: ● Closed addressing: Store all colliding elements in an auxiliary data structure like a linked list or BST. ● Open addressing: Allow elements to overflow out of their target bucket and into other spaces. ● Perfect hashing: Choose a hash function with no collisions. ● We have not spoken on this last topic yet. Why Perfect Hashing is Hard ● The expected cost of a lookup in a chained hash table is O(1 + α) for any load factor α. ● For any fixed load factor α, the expected cost of a lookup in linear probing is O(1), where the constant depends on α. ● However, the expected cost of a lookup in these tables is not the same as the expected worst-case cost of a lookup in these tables. Expected Worst-Case Bounds ● Theorem: Assuming truly random hash functions, the expected worst-case cost of a lookup in a linear probing hash table is Ω(log n). ● Theorem: Assuming truly random hash functions, the expected worst-case cost of a lookup in a chained hash table is Θ(log n / log log n). ● Proofs: Exercise 11-1 and 11-2 from CLRS. ☺ Perfect Hashing ● A perfect hash table is one where lookups take worst-case time O(1). ● There's a pretty sizable gap between the expected worst-case bounds from chaining and linear probing – and that's on expected worst-case, not worst-case.
    [Show full text]
  • Linear Probing with 5-Independent Hashing
    Lecture Notes on Linear Probing with 5-Independent Hashing Mikkel Thorup May 12, 2017 Abstract These lecture notes show that linear probing takes expected constant time if the hash function is 5-independent. This result was first proved by Pagh et al. [STOC’07,SICOMP’09]. The simple proof here is essentially taken from [Pˇatra¸scu and Thorup ICALP’10]. We will also consider a smaller space version of linear probing that may have false positives like Bloom filters. These lecture notes illustrate the use of higher moments in data structures, and could be used in a course on randomized algorithms. 1 k-independence The concept of k-independence was introduced by Wegman and Carter [21] in FOCS’79 and has been the cornerstone of our understanding of hash functions ever since. A hash function is a random function h : [u] [t] mapping keys to hash values. Here [s]= 0,...,s 1 . We can also → { − } think of a h as a random variable distributed over [t][u]. We say that h is k-independent if for any distinct keys x ,...,x [u] and (possibly non-distinct) hash values y ,...,y [t], we have 0 k−1 ∈ 0 k−1 ∈ Pr[h(x )= y h(x )= y ] = 1/tk. Equivalently, we can define k-independence via two 0 0 ∧···∧ k−1 k−1 separate conditions; namely, (a) for any distinct keys x ,...,x [u], the hash values h(x ),...,h(x ) are independent 0 k−1 ∈ 0 k−1 random variables, that is, for any (possibly non-distinct) hash values y ,...,y [t] and 0 k−1 ∈ i [k], Pr[h(x )= y ]=Pr h(x )= y h(x )= y , and ∈ i i i i | j∈[k]\{i} j j arXiv:1509.04549v3 [cs.DS] 11 May 2017 h i (b) for any x [u], h(x) is uniformly distributedV in [t].
    [Show full text]
  • Cuckoo Hashing
    Cuckoo Hashing Rasmus Pagh* BRICSy, Department of Computer Science, Aarhus University Ny Munkegade Bldg. 540, DK{8000 A˚rhus C, Denmark. E-mail: [email protected] and Flemming Friche Rodlerz ON-AIR A/S, Digtervejen 9, 9200 Aalborg SV, Denmark. E-mail: ff[email protected] We present a simple dictionary with worst case constant lookup time, equal- ing the theoretical performance of the classic dynamic perfect hashing scheme of Dietzfelbinger et al. (Dynamic perfect hashing: Upper and lower bounds. SIAM J. Comput., 23(4):738{761, 1994). The space usage is similar to that of binary search trees, i.e., three words per key on average. Besides being conceptually much simpler than previous dynamic dictionaries with worst case constant lookup time, our data structure is interesting in that it does not use perfect hashing, but rather a variant of open addressing where keys can be moved back in their probe sequences. An implementation inspired by our algorithm, but using weaker hash func- tions, is found to be quite practical. It is competitive with the best known dictionaries having an average case (but no nontrivial worst case) guarantee. Key Words: data structures, dictionaries, information retrieval, searching, hash- ing, experiments * Partially supported by the Future and Emerging Technologies programme of the EU under contract number IST-1999-14186 (ALCOM-FT). This work was initiated while visiting Stanford University. y Basic Research in Computer Science (www.brics.dk), funded by the Danish National Research Foundation. z This work was done while at Aarhus University. 1 2 PAGH AND RODLER 1. INTRODUCTION The dictionary data structure is ubiquitous in computer science.
    [Show full text]
  • The Power of Simple Tabulation Hashing
    The Power of Simple Tabulation Hashing Mihai Pˇatra¸scu Mikkel Thorup AT&T Labs AT&T Labs May 10, 2011 Abstract Randomized algorithms are often enjoyed for their simplicity, but the hash functions used to yield the desired theoretical guarantees are often neither simple nor practical. Here we show that the simplest possible tabulation hashing provides unexpectedly strong guarantees. The scheme itself dates back to Carter and Wegman (STOC'77). Keys are viewed as consist- ing of c characters. We initialize c tables T1;:::;Tc mapping characters to random hash codes. A key x = (x1; : : : ; xc) is hashed to T1[x1] ⊕ · · · ⊕ Tc[xc], where ⊕ denotes xor. While this scheme is not even 4-independent, we show that it provides many of the guarantees that are normally obtained via higher independence, e.g., Chernoff-type concentration, min-wise hashing for estimating set intersection, and cuckoo hashing. Contents 1 Introduction 2 2 Concentration Bounds 7 3 Linear Probing and the Concentration in Arbitrary Intervals 13 4 Cuckoo Hashing 19 5 Minwise Independence 27 6 Fourth Moment Bounds 32 arXiv:1011.5200v2 [cs.DS] 7 May 2011 A Experimental Evaluation 39 B Chernoff Bounds with Fixed Means 46 1 1 Introduction An important target of the analysis of algorithms is to determine whether there exist practical schemes, which enjoy mathematical guarantees on performance. Hashing and hash tables are one of the most common inner loops in real-world computation, and are even built-in \unit cost" operations in high level programming languages that offer associative arrays. Often, these inner loops dominate the overall computation time.
    [Show full text]