pub fn pagerank_with_progress<F>(
graph: &SqliteGraph,
damping: f64,
iterations: usize,
progress: &F,
) -> Result<Vec<(i64, f64)>, SqliteGraphError>where
F: ProgressCallback,Expand description
Computes PageRank scores with progress callback reporting.
This is the progress-reporting variant of pagerank. See that function
for full algorithm documentation.
§Arguments
graph- The graph to analyzedamping- Damping factor (typically 0.85)iterations- Number of power iteration iterationsprogress- Callback for progress updates
§Progress Reporting
- Reports progress at each iteration: “PageRank iteration X/Y”
- Calls
on_complete()when finished - Calls
on_error()if an error occurs
§Example
use sqlitegraph::{SqliteGraph, algo::pagerank_with_progress};
use sqlitegraph::progress::NoProgress;
let graph = SqliteGraph::open_in_memory()?;
// ... add nodes and edges ...
let progress = NoProgress;
let scores = pagerank_with_progress(&graph, 0.85, 20, &progress)?;