Skip to main content
QUICK REVIEW

[Paper Review] Small Uncolored and Colored Choice Dictionaries

Torben Hagerup|arXiv (Cornell University)|Sep 20, 2018
Algorithms and Data CompressionComputer Science8 references5 citations
TL;DR

This paper presents a new atomic choice dictionary that supports all operations—including initialization—in constant time and uses only $n+1$ bits of space, which is optimal for $w=o(n)$. It further introduces a colored choice dictionary for $c$ colors that uses $n\log_2 c + 1$ bits when $c$ is a power of two, enabling efficient space-efficient breadth-first search (BFS) with $O(n\log n + m\log\log n)$ time and $n\log_2 3 + O((\log n)^2)$ bits of memory.

ABSTRACT

A choice dictionary can be initialized with a parameter $n\in\mathbb{N}$ and subsequently maintains an initially empty subset $S$ of $\{1,\ldots,n\}$ under insertion, deletion, membership queries and an operation $ extit{choice}$ that returns an arbitrary element of $S$. The choice dictionary is fundamental in space-efficient computing and has numerous applications. The best previous choice dictionary can be initialized with $n$ and $t\in\mathbb{N}$ and subsequently executes all operations in $O(t)$ time and occupies $n+O(n({t/w})^t+\log n)$ bits on a word RAM with a word length of $w=Ω(\log n)$ bits. We describe a new choice dictionary that executes all operations in constant time and, in addition to the space needed to store the integer $n$, occupies only $n+1$ bits, which is shown to be optimal if $w=o(n)$. A generalization of the choice dictionary called a colored choice dictionary is initialized with $c\in\mathbb{N}$ in addition to $n$ and subsequently maintains a semipartition $(S_0,\ldots,S_{c-1})$ of $\{1,\ldots,n\}$ under the operations $ extit{setcolor}(j,\ell)$, which moves $\ell$ from its current subset to $S_j$, $ extit{color}(\ell)$, which returns the unique $j\in\{0,\ldots,c-1\}$ with $\ell\in S_j$, and $ extit{choice}(j)$, which returns an arbitrary element of $S_j$. We describe new colored choice dictionaries that, if initialized with constant $c$, execute $ extit{setcolor}$, $ extit{color}$ and $ extit{choice}$ in constant time and occupy $n\log_2\!c+1$ bits plus the space needed to store $n$ if $c$ is a power of 2, and at most $n\log_2\!c+n^ε$ bits in general, for arbitrary fixed $ε>0$. We also study the possibility of iterating over the set $S$ or over $S_j$ for given $j\in\{0,\ldots,c-1\}$ and an application of this to breadth-first search.

Motivation & Objective

  • To design a choice dictionary that supports all operations, including initialization, in constant time with minimal space usage.
  • To generalize the choice dictionary to a colored variant that maintains $c$ disjoint subsets and supports color-specific operations.
  • To apply the new data structures to space-efficient breadth-first search (BFS) on graphs with $n$ vertices and $m$ edges.
  • To achieve improved space bounds for BFS while maintaining near-linear time complexity.
  • To prove optimality of the space usage under the word RAM model with $w = \Omega(\log n)$.

Proposed method

  • Design a choice dictionary using a bit vector of size $n$ and a single additional bit to track non-emptiness, enabling constant-time choice and operations.
  • Use a two-component structure with two choice dictionaries per color to support efficient iteration and dynamic updates during setcolor operations.
  • Leverage the word RAM model’s constant-time operations, including bitwise operations and integer arithmetic, to implement atomic operations.
  • Apply the colored choice dictionary to BFS by maintaining gray vertices in a 3-color choice dictionary, enabling efficient enumeration of neighbors during traversal.
  • Use a loose representation for containers during iteration, converting them to a standard form in $O(\log \log n)$ time to support fast enumeration.
  • Introduce a dual-structure technique where two dictionaries alternate roles during iteration to maintain efficiency and correctness.

Experimental results

Research questions

  • RQ1Can a choice dictionary be designed to support constant-time initialization and all operations with only $n+1$ bits of space?
  • RQ2What is the optimal space bound for a choice dictionary when the word length $w$ satisfies $w=o(n)$?
  • RQ3Can the choice dictionary be generalized to support $c$ colors with efficient operations and space usage proportional to $n\log_2 c$?
  • RQ4How can the colored choice dictionary be used to improve space efficiency in graph algorithms like BFS?
  • RQ5What is the trade-off between time complexity and space usage in BFS when using the new colored choice dictionary?

Key findings

  • The proposed choice dictionary uses only $n+1$ bits of space, which is optimal when $w=o(n)$, and supports all operations—including initialization—in constant time.
  • For $c$ colors, the colored choice dictionary uses $n\log_2 c + 1$ bits when $c$ is a power of two, and at most $n\log_2 c + n^\epsilon$ bits in general for any fixed $\epsilon > 0$.
  • The new data structure enables a BFS algorithm to run in $O(n\log n + m\log\log n)$ time using $n\log_2 3 + O((\log n)^2)$ bits of memory.
  • An alternative BFS variant runs in $O(n\log n + mt)$ time with $n\log_2 3 + O(n^{1/t} + (\log n)^2)$ bits for any fixed $t \in \mathbb{N}$.
  • The time bounds for iteration over gray vertices in BFS are $O(\log \log n)$ or $O(t)$ per operation, depending on the implementation variant.
  • The results improve upon prior space bounds for BFS, reducing memory usage from $n\log_2 3 + O(n/(\log n)^t)$ to $O((\log n)^2)$ bits when $t$ is fixed.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.