9 stable releases
| new 1.1.2 | Mar 5, 2026 |
|---|---|
| 1.1.1 | Feb 26, 2026 |
| 1.0.5 | Feb 5, 2026 |
| 1.0.4 | Feb 4, 2026 |
| 1.0.0 | Feb 3, 2026 |
#1731 in Algorithms
Used in 2 crates
105KB
2.5K
SLoC
rustpix-algorithms
Clustering algorithms with spatial indexing for neutron event detection.
Algorithms
ABS (Adjacency-Based Search)
Fast 8-connectivity clustering optimized for pixel detectors.
use rustpix_algorithms::abs::AbsClustering;
let clustering = AbsClustering::new(5.0, 75.0); // spatial, temporal epsilon
let clusters = clustering.cluster(&hits);
DBSCAN
Density-based clustering with KD-tree spatial indexing.
use rustpix_algorithms::dbscan::DbscanClustering;
let clustering = DbscanClustering::new(5.0, 75.0, 1); // eps, time_eps, min_pts
let clusters = clustering.cluster(&hits);
Graph
Union-find based connected component detection.
use rustpix_algorithms::graph::GraphClustering;
let clustering = GraphClustering::new(5.0, 75.0);
let clusters = clustering.cluster(&hits);
Grid
Parallel grid-based clustering with spatial hashing.
use rustpix_algorithms::grid::GridClustering;
let clustering = GridClustering::new(5.0, 75.0);
let clusters = clustering.cluster(&hits);
Performance
| Algorithm | Speed | Memory | Best For |
|---|---|---|---|
| ABS | Fastest | Low | Dense clusters |
| DBSCAN | Moderate | Moderate | Variable density |
| Graph | Fast | Low | General purpose |
| Grid | Very Fast | Moderate | Large datasets, parallelism |
License
MIT License - see LICENSE for details.
Dependencies
~1.2–1.9MB
~38K SLoC