Predecessor problem

Source: Wikipedia, the free encyclopedia.

In

balanced binary search trees, van Emde Boas trees, and fusion trees. In the static predecessor problem, the set of elements does not change, but in the dynamic predecessor problem, insertions into and deletions from the set are allowed.[1]

The predecessor problem is a simple case of the nearest neighbor problem, and data structures that solve it have applications in problems like integer sorting.

Definition

The problem consists of maintaining a set S, which contains a subset of U integers. Each of these

word size
of w, implying that . Data structures that solve the problem support these operations:[2]

  • predecessor(x), which returns the largest element in S less than or equal to x
  • successor(x), which returns the smallest element in S greater than or equal to x

In addition, data structures which solve the dynamic version of the problem also support these operations:

  • insert(x), which adds x to the set S
  • delete(x), which removes x from the set S

The problem is typically analyzed in a transdichotomous model of computation such as word RAM.

Data structures

A binary tree with 4 levels. The nodes on each level are: 3: (), 2: (0) and (1), 1: (00) and (10), 0: (001), (100) and (101). The unlabeled node is the root. There are directed edges between the folllowing nodes: ()->(0), ()->(1), (0)->(00), (0)->(001) in blue, (1)->(10), (1)->(101) in blue, (00)->(001) twice, once in blue, (10)->(100), (10)->(101), (001)<->(100), (100)<->(101). The nodes on each level are contained in a box, labeled with LSS(<level>).
An x-fast trie containing the integers 1 (0012), 4 (1002) and 5 (1012), which can be used to efficiently solve the predecessor problem.

One simple solution to this problem is to use a

running time
of for predecessor queries. The Van Emde Boas tree achieves a query time of , but requires space.[1] Dan Willard proposed an improvement on this space usage with the x-fast trie, which requires space and the same query time, and the more complicated y-fast trie, which only requires space.[3] Fusion trees, introduced by Michael Fredman and Willard, achieve query time and for predecessor queries for the static problem.[4] The dynamic problem has been solved using exponential trees with query time,
expected time
using hashing.[6]

Mathematical properties

There have been a number of papers proving

Big Theta notation
) , and similarly, for all values of n, there exists a value of n such that the query time is .[1] Other proofs of lower bounds include the notion of communication complexity.

For the static predecessor problem, Mihai Pătrașcu and Mikkel Thorup showed the following lower bound for the optimal search time, in the cell-probe model:[7]

where the RAM has word length , the set contains integers of bits each and is represented in the RAM using words of space, and defining .

In the case where for and , the optimal search time is and the van Emde Boas tree achieves this bound.[7]

See also

References

  1. ^
    S2CID 1991980
    .
  2. ^ Rahman, Naila; Cole, Richard; Raman, Rajeev (17 August 2001). Optimized Predecessor Data Structures for Internal Memory (PDF). International Workshop on Algorithm Engineering. pp. 67–78.
  3. .
  4. ^ Fredman, Michael; Willard, Dan (1990). "Blasting through the information theoretic barrier with fusion trees". Symposium on Theory of Computing: 1–7.
  5. S2CID 8175703
    .
  6. .
  7. ^ .