Skip to main content

transitive_closure_with_progress

Function transitive_closure_with_progress 

Source
pub fn transitive_closure_with_progress<F>(
    graph: &SqliteGraph,
    bounds: Option<TransitiveClosureBounds>,
    progress: &F,
) -> Result<AHashMap<(i64, i64), bool>, SqliteGraphError>
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 analyze
  • bounds - Optional bounds to limit computation
  • progress - 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]
// ...