#hash #queue #minimizer #monotone

minimizer-queue

Fast computation of minimizers using a monotone queue

6 stable releases

1.2.3 Jun 25, 2024
1.2.2 Jun 7, 2024
1.2.0 Jun 4, 2024
1.1.0 Jun 4, 2024
1.0.0 May 29, 2024

#2736 in Data structures

Download history 45/week @ 2025-11-13 12/week @ 2025-11-20 6/week @ 2025-11-27 1/week @ 2025-12-04 28/week @ 2025-12-11 31/week @ 2025-12-18 17/week @ 2025-12-25 10/week @ 2026-01-15 7/week @ 2026-01-22 40/week @ 2026-01-29 73/week @ 2026-02-05 3/week @ 2026-02-12 12/week @ 2026-02-19 13/week @ 2026-02-26

111 downloads per month
Used in 3 crates (via minimizer-iter)

MIT license

16KB
287 lines

minimizer-queue

crates.io docs

Fast computation of minimizers using a monotone queue.

Features

  • insertion in amortized constant time
  • lookup in constant time
  • keeps track of the relative position of the minimizers
  • supports custom hasher, using wyhash by default
  • can be seeded to produce a different ordering
  • optimized modulo computation with strength_reduce

Example usage

use minimizer_queue::MinimizerQueue;

let mut queue = MinimizerQueue::new(3); // width 3
queue.insert(1);
queue.insert(2);
queue.insert(3);
queue.get_min(); // element with the smallest hash among 1, 2 and 3

queue.insert(4);
queue.get_min(); // element with the smallest hash among 2, 3 and 4

Dependencies

~85KB