Perfect hash function

Perfect hash function

A perfect hash function for a set S is a hash function that maps distinct elements in S to a set of integers, with no collisions. A perfect hash function has many of the same applications as other hash functions, but with the advantage that no collision resolution has to be implemented.

Contents

Properties and uses

A perfect hash function for a specific set S that can be evaluated in constant time, and with values in a small range, can be found by a randomized algorithm in a number of operations that is proportional to the size of S[citation needed]. The minimal size of the description of a perfect hash function depends on the range of its function values: The smaller the range, the more space is required[citation needed]. Any perfect hash functions suitable for use with a hash table require at least a number of bits that is proportional to the size of S.

A perfect hash function with values in a limited range can be used for efficient lookup operations, by placing keys from S (or other associated values) in a table indexed by the output of the function. Using a perfect hash function is best in situations where there is a frequently queried large set, S, which is seldom updated. Efficient solutions to performing updates are known as dynamic perfect hashing, but these methods are relatively complicated to implement. A simple alternative to perfect hashing, which also allows dynamic updates, is cuckoo hashing.

Minimal perfect hash function

A minimal perfect hash function is a perfect hash function that maps n keys to n consecutive integers—usually [0..n−1] or [1..n]. A more formal way of expressing this is: Let j and k be elements of some finite set K. F is a minimal perfect hash function iff F(j) =F(k) implies j=k and there exists an integer a such that the range of F is a..a+|K|−1. It has been proved that a general purpose minimal perfect hash scheme requires at least 1.44 bits/key.[1] However the smallest currently use around 2.5 bits/key.

A minimal perfect hash function F is order preserving if keys are given in some order a1, a2, ..., and for any keys aj and ak, j<k implies F(aj)<F(ak). Order-preserving minimal perfect hash functions require necessarily Ω(n log n) bits to be represented.

A minimal perfect hash function F is monotone if it preserves the lexicographical order of the keys. Monotone minimal perfect hash functions can be represented in very little space.

See also

References

  1. ^ Djamal Belazzougui, Fabiano C. Botelho, Martin Dietzfelbinger (2009) (PDF). Hash, displace, and compress. Springer Berlin / Heidelberg. http://cmph.sourceforge.net/papers/esa09.pdf. Retrieved 2011-08-11. 

Further reading

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Hash function — A hash function is any well defined procedure or mathematical function for turning some kind of data into a relatively small integer, that may serve as an index into an array. The values returned by a hash function are called hash values, hash… …   Wikipedia

  • Hash table — Not to be confused with Hash list or Hash tree. Unordered map redirects here. For the proposed C++ class, see unordered map (C++). Hash Table Type unsorted dictionary Invented 1953 Time complexity in big O notation Average Worst case Space …   Wikipedia

  • Hash collision — In computer science, a hash collision or hash clash is a situation that occurs when two distinct inputs into a hash function produce identical outputs.All hash functions have potential collisions, though with a well designed hash function,… …   Wikipedia

  • Dynamic perfect hashing — In computer science, dynamic perfect hashing is a programming technique for resolving collisions in a hash table data structure.[1][2][3] This technique is useful for situations where fast queries, insertions, and deletions must be made on a… …   Wikipedia

  • Bent function — The 2 ary bent functions with Hamming weight 1 Their nonlinearity is …   Wikipedia

  • Bloom filter — The Bloom filter, conceived by Burton H. Bloom in 1970, is a space efficient probabilistic data structure that is used to test whether an element is a member of a set. False positives are possible, but false negatives are not. Elements can be… …   Wikipedia

  • Lamport signature — In cryptography, a Lamport signature or Lamport one time signature scheme is a method for constructing a digital signature. Lamport signatures can be built from any cryptographically secure one way function; usually a cryptographic hash function… …   Wikipedia

  • List of mathematics articles (P) — NOTOC P P = NP problem P adic analysis P adic number P adic order P compact group P group P² irreducible P Laplacian P matrix P rep P value P vector P y method Pacific Journal of Mathematics Package merge algorithm Packed storage matrix Packing… …   Wikipedia

  • List of combinatorics topics — This is a list of combinatorics topics.A few decades ago it might have been said that combinatorics is little more than a way to classify poorly understood problems, and some standard remedies. Great progress has been made since 1960.This page is …   Wikipedia

  • Pearson hashing — Fast Hashing of Variable Length Text Strings . Peter K. Pearson, Communications of the ACM 33(6), 677 (1990) mdash; [http://portal.acm.org/citation.cfm?id=78978 ACM full text (requires subscription)] ] is a hash function designed for fast… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”