single-clustering
⚠️ Development Status: This library is currently under heavy development and should not be considered production ready. APIs may change significantly between versions.
A Rust library for community detection and graph clustering algorithms with a focus on performance and flexibility.
Features
- Efficient Network Representation: CSR (Compressed Sparse Row) format for optimal memory usage and performance
- Community Detection Algorithms:
- Leiden Algorithm: State-of-the-art method with guaranteed well-connected communities
- Louvain Method: Classic modularity optimization (work-in-progress)
- Quality Functions: Multiple partition quality metrics
- Modularity optimization
- Reichardt-Bornholdt (RB) configuration model with tunable resolution
- Flexible Architecture: Generic trait-based design supporting different network types and grouping strategies
- Performance Optimized: Caching strategies and efficient data structures for large networks
Usage
use CSRNetwork;
use ;
use ModularityPartition;
// Create a CSR network from your data
let network = new;
// Configure the Leiden algorithm
let config = LeidenConfig ;
// Initialize the optimizer
let mut optimizer = new;
// Find communities using modularity optimization
let partition: = optimizer.find_partition?;
// Access results
for node in 0..partition.node_count
println!;
Installation
Add this to your Cargo.toml
:
[]
= "0.6.0"
Current Status
- ✅ Leiden Algorithm: Core implementation with modularity and RB quality functions
- ✅ CSR Network Representation: Efficient storage for large graphs
- ✅ Quality Functions: Modularity and Reichardt-Bornholdt implementations
- 🚧 Louvain Algorithm: Basic implementation (work-in-progress)
- 🚧 Documentation: API documentation and examples (ongoing)
- ❌ Benchmarks: Performance testing suite (planned)
- ❌ Python Bindings: PyO3 integration (planned)
Contributing
This project is in active development. Contributions, bug reports, and feature requests are welcome!
License
This crate is licensed under the BSD 3-Clause License.