Searcharxiv⌕ Search

arXiv · 2610.17833

PHastR: Faster Minimal Perfect Hashing with Rotated Layouts

Abstract

We present PHastR, a minimal perfect hash function of the PHast family. Like PHast+, the fast-to-build variant of PHast, PHastR finds feasible seeds with bit-parallel operations: its seeds move keys along rings of slots, and to evaluate the seeds of a bucket it cyclically shifts, for each key, a word recording which slots of its ring are used. Unlike PHast+, however, it is almost immune to self-collisions, which make two keys of a bucket collide for (almost) all its seeds: more than a third of the buckets bumped by PHast+ with wrapping and multiplier 3 contain one. With 8-bit seeds, PHastR uses $1.94$ bits per key, essentially the same space as the best variant of PHast+ with wrapping, but it is built in $37\%$ of the time, and its queries are $28\%$ faster on $10^9$ keys, as it bumps $0.5\%$ of the keys instead of $3.9\%$; they are faster also than those of PHast, which takes twelve times as long to build, and about as fast as those of PtrHash, which uses more than one bit per key more. With a larger expected bucket size PHastR comes within $0.02$ bits per key of the space of PHast, using $1.90$ bits per key, and still has faster queries. Its construction also scales better with the number of threads: with all the threads of a 48-core machine it is almost three times faster than that of PHast+. Finally, we argue that when each key can be placed only within a range of $W$ slots, every placement of $n$ random keys on $n$ slots, however found, must bump on large key sets a constant fraction of the keys: we derive a lower bound of about $0.1/W$ on this fraction, and we estimate that the best placement bumps about $1/2W$ of the keys, which is about one tenth of the keys bumped by PHastR.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Sebastiano Vigna. 2026-10-14. PHastR: Faster Minimal Perfect Hashing with Rotated Layouts. https://arxiv.org/abs/2610.17833

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

O(1) Expected Insertion for Random Walk d-ary Cuckoo Hashing up to the Load Threshold

The random walk $d$-ary cuckoo hashing algorithm was defined by Fotakis, Pagh, Sanders, and Spirakis to generalize and improve upon the standard cuckoo hashing algorithm of Pagh and Rodler. Random walk $d$-ary cuckoo hashing has low space overhead, guaranteed fast access, and fast in practice insertion time. In this paper, we give a theoretical insertion time bound for this algorithm. More precisely, for every $d\ge 3$ random hashes, let $c_d^*$ be the sharp threshold for the load factor at which a valid assignment of $cm$ objects to a hash table of size $m$ exists with high probability. We show that for any $d\ge 3$ hashes and load factor $c<c_d^*$, the expectation of the random walk insertion time is $O(1)$, that is, a constant depending only on $d$ and $c$ but not $m$.

cs.DS↗

Approximating Unsplittable Capacitated Vehicle Routing: Analysis via Factor-Revealing LPs

The capacitated vehicle routing problem (CVRP) is one of the most extensively studied problems in combinatorial optimization. Given a depot and a set of customers with demands in a metric space, the objective is to find a set of tours, each starting and ending at the depot, operated by a capacitated vehicle located at the depot, such that all customers are served and the total travel cost is minimized. We consider the unsplittable variant, where the demand of each customer must be served entirely by a single tour. The previous best approximation ratio was about $α+1.694$, where $α$ is the approximation ratio for the traveling salesman problem. We propose improved approximation algorithms. First, we introduce a unified algorithmic framework that generalizes and integrates known linear programming (LP) rounding and matching-based approaches. We show that these techniques are complementary and can be combined to yield improved approximation ratios. Second, we develop a novel analytical framework based on customer demand discretization, which yields new structural bounds and, through factor-revealing LPs, achieves expected approximation ratios of about $α+1.647$ for the general-capacity case and $α+1.548$ for the fixed-capacity case. Finally, we derandomize our algorithms using a priori 2-tour sets and the method of conditional expectations while maintaining nearly the same approximation ratios.

cs.DS↗

Entrywise Low-Rank Approximation and Matrix $p \rightarrow q$ Norms via Global Correlation Rounding

Given a matrix $A$, the goal of the entrywise low-rank approximation problem is to find $\operatorname{argmin} \|A-B\|_p$ over all rank-$k$ matrices $B$, where $\| \cdot \|_p$ is the entrywise $\ell_p$ norm. When $p = 2$ this well-studied problem is solved by the singular value decomposition, but for $p \neq 2$ the problem becomes computationally challenging. For every even $p > 2$ and every fixed $k$, we give the first polynomial-time approximation scheme for this problem, improving on the $(3 + \varepsilon)$ approximation of Ban, Bhattiprolu, Bringmann, Kolev, Lee, and Woodruff, the bi-criteria approximation of Woodruff and Yasuda, and the additive approximation scheme of Anderson, Bakshi, and Hopkins. Prior algorithmic approaches based on sketching and column selection, which yielded a polynomial-time approximation scheme in the $p < 2$ setting, face concrete barriers when $p > 2$. Instead, we use the Sherali-Adams hierarchy of convex programs, and in so doing suggest a methodology for how to use convex hierarchies to design polynomial-time approximation schemes for continuous optimization problems. We use the same algorithmic strategy to give a new family of additive approximation algorithms for matrix $p \rightarrow q$ norms, which are intimately related to small-set expansion and quantum information. In particular, we give the first nontrivial additive approximation algorithms in the regime $p < 2 < q$.

cs.DS↗