single-clustering
A Rust library for community detection and graph clustering algorithms.
Features
- Network Analysis: Efficient graph representation and manipulation for clustering tasks
- Community Detection: Implementation of state-of-the-art algorithms
- Louvain method for community detection
- Leiden algorithm (enhanced version of Louvain)
- Flexible Grouping: Abstract trait system for creating and managing node clusters
- Performance: Parallel computation support via Rayon
- K-NN Graph Creation: Build networks from high-dimensional data points
Usage
use Network;
use VectorGrouping;
use Leiden;
// Create a network from your data
let network = new_from_graph;
// Initialize clustering (each node in its own cluster)
let mut clustering = create_isolated;
// Run Leiden algorithm (resolution parameter, randomness parameter, optional seed)
let mut leiden = new;
leiden.iterate;
// Access clustering results
for node in 0..network.nodes
Installation
Add this to your Cargo.toml
:
[]
= "0.1.0"
Performance Considerations
The library offers multiple implementations optimized for different scenarios:
StandardLocalMoving
: Basic implementation of the moving algorithmFastLocalMoving
: Optimized version with better memory usage- Parallel implementations of various operations for large networks
License
This crate is licensed under the MIT License.