| Crates.io | icentral-alg |
| lib.rs | icentral-alg |
| version | 0.1.0 |
| created_at | 2025-04-04 23:06:21.069676+00 |
| updated_at | 2025-04-04 23:06:21.069676+00 |
| description | A Rust crate for incremental and parallel betweenness centrality algorithms. |
| homepage | |
| repository | https://github.com/your-repo/icentral-alg |
| max_upload_size | |
| id | 1620962 |
| size | 119,639 |
icentral-algicentral-alg is a Rust crate designed to perform experiments on various graph algorithms, with a primary focus on Betweenness Centrality. This crate provides an implementation for incremental and parallelized algorithms for computing betweenness centrality, including Brandes' algorithm, QUBE, and other experimental techniques for incremental centrality calculation.
The crate also supports distributed computing through MPI, enabling the scaling of experiments across multiple processes.
To include icentral-alg in your project, add the following to your Cargo.toml:
[dependencies]
icentral-alg = "0.1"
use icentral_alg::do_paper_exp;
use std::time::Duration;
fn main() -> Result<(), icentral_alg::BetweennessCentralityError> {
let num_edges = 100;
let num_iter = Some(10);
let max_time = Duration::from_secs(3600);
let rand_seed = 42;
let graph_paths = vec![
String::from("/path/to/graph1.net"),
String::from("/path/to/graph2.net"),
];
do_paper_exp::<MyGraphHash>(
num_edges,
num_iter,
max_time,
rand_seed,
graph_paths,
true, // do_inc_brandes
true, // do_qube
false, // do_inc_qube
false // do_fuad
)?;
Ok(())
}
To use your own graph structures with icentral-alg, they must implement the following traits:
BccGraphHashInterfaceFindConnectedComponentsFindSingleSourceShortestPathsInsertNode, InsertEdgeUpdateMucMappedNodesExtendWithResetWithDebug, DebugIterationStepdo_paper_expThe do_paper_exp function is the central experiment execution function. It allows running different algorithms with incremental updates on graphs and benchmarking their performance under different conditions.
pub fn do_paper_exp<GH>(
num_edges: usize,
num_iter: Option<usize>,
max_time: Duration,
rand_seed: i32,
path_vec: Vec<String>,
do_inc_brandes: bool,
do_qube: bool,
do_inc_qube: bool,
do_fuad: bool
) -> Result<(), BetweennessCentralityError>
where
GH: BccGraphHashInterface + GraphOperations,
Graph<GH>: GraphStructure,
{
// Experiment logic here
}
For distributed computing, the crate supports MPI-based parallelization via icentral_parallel. This feature allows running betweenness centrality computations across multiple processes in a distributed manner.
maybe_do_paper_exp_inc_brandes: Executes incremental Brandes algorithm.maybe_do_paper_exp_inc_qube: Executes incremental QUBE algorithm.icentral: Handles incremental betweenness centrality computations with serial and parallel options.This project is licensed under the MIT License.
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.