English

m-Bonsai: a Practical Compact Dynamic Trie

Data Structures and Algorithms 2017-04-20 v1

Abstract

We consider the problem of implementing a space-efficient dynamic trie, with an emphasis on good practical performance. For a trie with nn nodes with an alphabet of size σ\sigma, the information-theoretic lower bound is nlogσ+O(n)n \log \sigma + O(n) bits. The Bonsai data structure is a compact trie proposed by Darragh et al. (Softw., Pract. Exper. 23(3), 1993, p. 277-291). Its disadvantages include the user having to specify an upper bound MM on the trie size in advance (which cannot be changed easily after initalization), a space usage of Mlogσ+O(MloglogM)M \log \sigma + O(M \log \log M) (which is asymptotically non-optimal for smaller σ\sigma or if nMn \ll M) and a lack of support for deletions. It supports traversal and update operations in O(1/ϵ)O(1/\epsilon) expected time (based on assumptions about the behaviour of hash functions), where ϵ=(Mn)/M\epsilon = (M-n)/M and has excellent speed performance in practice. We propose an alternative, m-Bonsai, that addresses the above problems, obtaining a trie that uses (1+β)n(logσ+O(1))(1+\beta) n (\log \sigma + O(1)) bits in expectation, and supports traversal and update operations in O(1/β)O(1/\beta) expected time and O(1/β2)O(1/\beta^2) amortized expected time, for any user-specified parameter β>0\beta > 0 (again based on assumptions about the behaviour of hash functions). We give an implementation of m-Bonsai which uses considerably less memory and is slightly faster than the original Bonsai.

Keywords

Cite

@article{arxiv.1704.05682,
  title  = {m-Bonsai: a Practical Compact Dynamic Trie},
  author = {Andreas Poyias and Simon J. Puglisi and Rajeev Raman},
  journal= {arXiv preprint arXiv:1704.05682},
  year   = {2017}
}

Comments

Journal version of SPIRE 2015 paper by Poyias and Raman

R2 v1 2026-06-22T19:21:16.201Z