Skip to content

Commit 10906f6

Browse files
author
Ian
committed
Init repository added readme and license file
1 parent f3ccbcf commit 10906f6

File tree

5 files changed

+97
-2
lines changed

5 files changed

+97
-2
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: stable
18+
override: true
19+
- uses: katyo/publish-crates@v2
20+
with:
21+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
name = "single-clustering"
33
version = "0.1.0"
44
edition = "2024"
5+
authors = ["Ian F. Diks"]
6+
homepage = "https://singlerust.com"
7+
repository = "https://github.com/SingleRust/single-clustering"
8+
license-file = "LICENSE.md"
9+
readme = "README.md"
10+
description = "A high-performance network clustering library implementing community detection algorithms like Louvain and Leiden. Features efficient graph representation, abstract grouping systems, and K-NN graph creation from high-dimensional data. Provides parallel computation support via Rayon for handling large networks."
11+
512

613
[dependencies]
714
anyhow = "1.0.98"
815
kiddo = "5.0.3"
9-
nalgebra = "0.33.2"
1016
nalgebra-sparse = "0.10.0"
1117
ndarray = {version = "0.16.1" , features = ["rayon"]}
1218
num-traits = "0.2.19"

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2025 Ian F. Diks All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6+
7+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8+
9+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10+
11+
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# single-clustering
2+
3+
A Rust library for community detection and graph clustering algorithms.
4+
5+
## Features
6+
7+
- **Network Analysis**: Efficient graph representation and manipulation for clustering tasks
8+
- **Community Detection**: Implementation of state-of-the-art algorithms
9+
- Louvain method for community detection
10+
- Leiden algorithm (enhanced version of Louvain)
11+
- **Flexible Grouping**: Abstract trait system for creating and managing node clusters
12+
- **Performance**: Parallel computation support via Rayon
13+
- **K-NN Graph Creation**: Build networks from high-dimensional data points
14+
15+
## Usage
16+
17+
```rust
18+
use single_clustering::network::Network;
19+
use single_clustering::network::grouping::VectorGrouping;
20+
use single_clustering::community_search::leiden::Leiden;
21+
22+
// Create a network from your data
23+
let network = Network::new_from_graph(graph);
24+
25+
// Initialize clustering (each node in its own cluster)
26+
let mut clustering = VectorGrouping::create_isolated(network.nodes());
27+
28+
// Run Leiden algorithm (resolution parameter, randomness parameter, optional seed)
29+
let mut leiden = Leiden::new(1.0, 0.01, Some(42));
30+
leiden.iterate(&network, &mut clustering);
31+
32+
// Access clustering results
33+
for node in 0..network.nodes() {
34+
println!("Node {} belongs to cluster {}", node, clustering.get_group(node));
35+
}
36+
```
37+
38+
## Installation
39+
40+
Add this to your `Cargo.toml`:
41+
42+
```toml
43+
[dependencies]
44+
single-clustering = "0.1.0"
45+
```
46+
47+
## Performance Considerations
48+
49+
The library offers multiple implementations optimized for different scenarios:
50+
- `StandardLocalMoving`: Basic implementation of the moving algorithm
51+
- `FastLocalMoving`: Optimized version with better memory usage
52+
- Parallel implementations of various operations for large networks
53+
54+
## License
55+
56+
This crate is licensed under the MIT License.

0 commit comments

Comments
 (0)