Skip to main content

betweenness_centrality_with_progress

Function betweenness_centrality_with_progress 

Source
pub fn betweenness_centrality_with_progress<F>(
    graph: &SqliteGraph,
    progress: &F,
) -> Result<Vec<(i64, f64)>, SqliteGraphError>
Expand description

Computes betweenness centrality with progress callback reporting.

This is the progress-reporting variant of betweenness_centrality. See that function for full algorithm documentation.

§Arguments

  • graph - The graph to analyze
  • progress - Callback for progress updates

§Progress Reporting

  • Reports progress for each source node: “Betweenness: processing source X/Y”
  • Total is the number of nodes in the graph
  • Calls on_complete() when finished
  • Calls on_error() if an error occurs

§Example

use sqlitegraph::{SqliteGraph, algo::betweenness_centrality_with_progress};
use sqlitegraph::progress::NoProgress;

let graph = SqliteGraph::open_in_memory()?;
// ... add nodes and edges ...
let progress = NoProgress;
let centrality = betweenness_centrality_with_progress(&graph, &progress)?;