| Crates.io | icentral-fast-brandes |
| lib.rs | icentral-fast-brandes |
| version | 0.1.0 |
| created_at | 2025-04-04 23:16:58.332839+00 |
| updated_at | 2025-04-04 23:16:58.332839+00 |
| description | Efficient Rust implementation of Brandes algorithm for computing betweenness centrality on graphs with support for complex structures. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1620984 |
| size | 65,216 |
The icentral-fast-brandes crate offers an efficient Rust implementation of computing betweenness centrality using the renowned Brandes algorithm. This metric is pivotal in network analysis, particularly in relation to determining the influence or importance of particular nodes within a graph structure.
Betweenness centrality is computed by assessing the frequency at which a node acts as a bridge along the shortest path between other nodes in the graph. This crate streamlines the process, enabling scalable calculations suitable for large graphs and complex structures.
CreateScoresVector and NumNodes.ICentralWorkspace to dynamically allocate resources during computation.To calculate betweenness centrality with icentral-fast-brandes, ensure your graph type fulfills the necessary trait bounds including, but not limited to, CreateScoresVector, Debug, NumNodes, MappedNodes, GetNodeIdRange, GetNeighborsForNode, and GetEdges.
Here's an example of how to use the core function:
use icentral_fast_brandes::fast_brandes_bc;
fn main() -> Result<(), BetweennessCentralityError> {
let graph = /* initialize your graph data structure here */;
let scores = fast_brandes_bc(&graph)?;
println!("Betweenness Centrality Scores: {:?}", scores);
Ok(())
}
The Brandes algorithm efficiently computes the shortest paths and subsequently derives the betweenness centrality by an incremental summation of dependencies. Due to its heavy reliance on Dijkstra's or BFS depending upon the graph's nature (weighted or unweighted), it demonstrates significant advantages in computational efficiency over simpler methods.
To include icentral-fast-brandes in your project, add the following to your Cargo.toml:
[dependencies]
icentral-fast-brandes = "0.1.0"
Contributions are welcome. Please open issues and create pull requests as needed. Let's build a decisive tool for network analysis together.
Note: This README was generated by an AI model and may not be 100% accurate. However, it should provide a comprehensive and useful introduction to the crate.
This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.
For progress updates, see the workspacer rust project.