An algorithm that includes a collection of several subalgorithms has been devised as a means of synthesizing still other algorithms (which could include computer code) that utilize hashing to determine whether an element (typically, a number or other datum) is a member of a set (typically, a list of numbers). Each subalgorithm synthesizes an algorithm (e.g., a block of code) that maps a static set of key hashes to a somewhat linear monotonically increasing sequence of integers. The goal in formulating this mapping is to cause the length of the sequence thus generated to be as close as practicable to the original length of the set and thus to minimize gaps between the elements.
The advantage of the approach embodied in this algorithm is that it completely avoids the traditional approach of hash-key look-ups that involve either secondary hash generation and look-up or further searching of a hash table for a desired key in the event of collisions.
This algorithm guarantees that it will never be necessary to perform a search or to generate a secondary key in order to determine whether an element is a member of a set. This algorithm further guarantees that any algorithm that it synthesizes can be executed in constant
time. To enforce these guarantees, the subalgorithms are formulated to employ a set of techniques, each of which works very effectively covering a certain class of hash-key values. These subalgorithms are of two types, summarized as follows:
- Given a list of numbers, try to find one or more solutions in which, if each number is shifted to the right by a constant number of bits and then masked with a rotating mask that isolates a set of bits, a unique number is thereby generated. In a variant of the foregoing procedure, omit the masking. Try various combinations of shifting, masking, and/or offsets until the solutions are found. From the set of solutions, select the one that provides the greatest compression for the representation and is executable in the minimum amount of time.
- Given a list of numbers, try to find one or more solutions in which, if each number is compressed by use of the modulo function by some value, then a unique value is generated.
This work was done by Mark James for Caltech for NASA’s Jet Propulsion Laboratory. For more information, download the Technical Support Package (free white paper) at www.techbriefs.com/tsp under the Information Sciences category. NPO-45175
This Brief includes a Technical Support Package (TSP).

Algorithm That Synthesizes Other Algorithms for Hashing
(reference NPO-45175) is currently available for download from the TSP library.
Don't have an account?
Overview
The document titled "Algorithm That Synthesizes Other Algorithms for Hashing" (NPO-45175) from NASA's Jet Propulsion Laboratory presents a novel hashing algorithm designed to execute in constant time for fixed sets of data. This algorithm addresses the common challenges associated with traditional hashing methods, particularly the issues of hash key lookups, secondary hash generation, and collision handling.
The primary innovation of this algorithm lies in its ability to determine membership in a set without the need for searching or generating secondary keys, which are typical in conventional hashing approaches. Instead, it generates unique hashing values through a process that involves shifting numbers by a constant number of bits and applying a rotating mask to isolate specific bits. This method ensures that the algorithm can synthesize solutions that provide optimal compression and execution speed.
The document outlines the significance of hashing in data management, particularly in enabling fast lookups of data records based on keys. It discusses the ideal characteristics of hash functions, which should ideally map keys to unique indexes to guarantee immediate access to data records. However, achieving perfect hashing is often impractical, leading to the necessity of minimizing collision rates and optimizing performance based on application needs.
The algorithm described synthesizes code that guarantees constant time execution for determining if an object is part of a set. It explores various combinations of shifting, masking, and offsets to generate unique values, ultimately selecting the most efficient solution from the generated options. This approach not only enhances the speed of data retrieval but also reduces the likelihood of collisions, which can hinder performance.
The document serves as a technical support package, providing insights into the algorithm's development and potential applications in aerospace and other fields. It emphasizes the broader implications of this research for technological advancements and commercial applications, highlighting NASA's commitment to sharing innovative solutions with wider audiences.
In summary, the document presents a groundbreaking hashing algorithm that improves upon traditional methods by ensuring constant time execution and minimizing the need for complex lookups, thereby enhancing data retrieval efficiency in various applications.

