{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/combined-search-and-encoding-for-seeds-with","title":"Combined Search and Encoding for Seeds, with an Application to Minimal Perfect Hashing","arxiv_id":"2502.05613","date":"2025-02-08","proceeding":null,"authors":["Hans-Peter Lehmann","Peter Sanders","Stefan Walzer","Jonatan Ziegler"],"abstract":"Randomised algorithms often employ methods that can fail and that are retried with independent randomness until they succeed. Randomised data structures therefore often store indices of successful attempts, called seeds. If $n$ such seeds are required (e.g., for independent substructures) the standard approach is to compute for each $i \\in [n]$ the smallest successful seed $S_i$ and store $\\vec{S} = (S_1, \\ldots, S_n)$. The central observation of this paper is that this is not space-optimal. We present a different algorithm that computes a sequence $\\vec{S}' = (S_1', \\ldots, S_n')$ of successful seeds such that the entropy of $\\vec{S'}$ undercuts the entropy of $\\vec{S}$ by $\\Omega(n)$ bits in most cases. To achieve a memory consumption of $\\mathrm{OPT}+\\varepsilon n$, the expected number of inspected seeds increases by a factor of $O(1/\\varepsilon)$. We demonstrate the usefulness of our findings with a novel construction for minimal perfect hash functions that, for $n$ keys and any $\\varepsilon \\in [n^{-3/7}, 1]$, has space requirement $(1+\\varepsilon)\\mathrm{OPT}$ and construction time $O(n/\\varepsilon)$. All previous approaches only support $\\varepsilon = \\omega(1 / \\log n)$ or have construction times that increase exponentially with $1/\\varepsilon$. Our implementation beats the construction throughput of the state of the art by more than two orders of magnitude for $\\varepsilon \\leq 3\\%$.","url_abs":"https://arxiv.org/abs/2502.05613v1","url_pdf":"https://arxiv.org/pdf/2502.05613v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"combined-search-and-encoding-for-seeds-with","repo_url":"https://github.com/ByteHamster/ConsensusRecSplit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null},{"paper_slug":"combined-search-and-encoding-for-seeds-with","repo_url":"https://github.com/bytehamster/mphf-experiments","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}