https://github.com/feldroop/sais-drum
The SAIS suffix array construction algorithm in Rust
https://github.com/feldroop/sais-drum
algortihm suffix-array
Last synced: 10 months ago
JSON representation
The SAIS suffix array construction algorithm in Rust
- Host: GitHub
- URL: https://github.com/feldroop/sais-drum
- Owner: feldroop
- Created: 2025-01-08T20:39:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-08-08T14:10:57.000Z (10 months ago)
- Last Synced: 2025-08-08T16:09:16.085Z (10 months ago)
- Topics: algortihm, suffix-array
- Language: Rust
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🥁 SAIS-drum 🥁
A Rust implementation of the Suffix Array Induced Sort (SAIS) algorithm for [suffix array](https://en.wikipedia.org/wiki/Suffix_array) construction. Inspired by Ilya Grebnov's [`libsais`](https://github.com/IlyaGrebnov/libsais) and based on the following paper:
> G. Nong, S. Zhang and W. H. Chan: _Two Efficient Algorithms for Linear Time Suffix Array Construction_ (2011) DOI: [10.1109/TC.2010.188](https://www.doi.org/10.1109/TC.2010.188)
## State of the implementation
The algorithm is implemented and tested using [`proptest`](https://github.com/proptest-rs/proptest), but not yet fully optimized. I highly recommend using (bindings to) `libsais` instead. Other Rust solutions include Amos Wenger's port of [`divsufsort`](https://github.com/fasterthanlime/stringsearch/tree/master/crates/divsufsort) and Andrew Gallant's [`suffix`](https://github.com/BurntSushi/suffix) crate.
In the future, the following optimizations could be added:
- Algorithmic improvements laid out in this paper:
> N. Timoshevskaya and W. -c. Feng: _SAIS-OPT: On the characterization and optimization of the SA-IS algorithm for suffix array construction_ (2014) DOI: [10.1109/ICCABS.2014.6863917](https://www.doi.org/10.1109/ICCABS.2014.6863917)
- Multithreading, based on this paper:
> Lao, B., Nong, G., Chan, W.H. et al. : _Fast induced sorting suffixes on a multicore machine_ (2018) DOI: [10.1007/s11227-018-2395-5](https://doi.org/10.1007/s11227-018-2395-5)
- Implementation techniques laid out by Ilya Grebnov in the README of libsais
- General optimizations such as writing vectorization-friendly code
- Some of my own ideas that leverage Rust-specific features such as the easy creation of generic code compared to C
## Why drum?
Who doesn't like drums? Also, it's a pretty funny wordplay in German.