pub fn transitive_closure_with_progress<F>(
graph: &SqliteGraph,
bounds: Option<TransitiveClosureBounds>,
progress: &F,
) -> Result<AHashMap<(i64, i64), bool>, SqliteGraphError>where
F: ProgressCallback,Expand description
Computes transitive closure with progress callback reporting.
This is the progress-reporting variant of transitive_closure. See that function
for full algorithm documentation.
§Arguments
graph- The graph to analyzebounds- Optional bounds to limit computationprogress- Callback for progress updates
§Progress Reporting
- Reports progress for each source node processed: “Transitive closure: source X/Y”
- Total is the number of source nodes being processed
- Calls
on_complete()when finished - Calls
on_error()if an error occurs
§Example
ⓘ
use sqlitegraph::{SqliteGraph, algo::transitive_closure_with_progress};
use sqlitegraph::progress::ConsoleProgress;
let graph = SqliteGraph::open_in_memory()?;
// ... add nodes and edges ...
let progress = ConsoleProgress::new();
let closure = transitive_closure_with_progress(&graph, None, &progress)?;
// Output:
// Transitive closure: source 1/100 [1/100]
// Transitive closure: source 2/100 [2/100]
// ...