pub fn min_st_cut_with_progress<F>(
graph: &SqliteGraph,
source: i64,
sink: i64,
progress: &F,
) -> Result<MinCutResult, SqliteGraphError>where
F: ProgressCallback,Expand description
Compute minimum s-t edge cut with progress tracking.
Same algorithm as min_st_cut but reports progress during execution.
Useful for long-running operations on large graphs.
§Arguments
graph- The graph to analyzesource- The source node IDsink- The sink (target) node IDprogress- Progress callback for reporting execution status
§Returns
MinCutResult containing source_side, sink_side, cut_edges, and cut_size.
§Progress Reporting
The callback receives:
current: Current BFS iterationtotal: None (unknown total iterations for Edmonds-Karp)message: “Min cut: iteration {current}, flow so far: {flow}”
Progress is reported after each augmenting path is found.
§Example
ⓘ
use sqlitegraph::{
algo::min_st_cut_with_progress,
progress::ConsoleProgress
};
let progress = ConsoleProgress::new();
let result = min_st_cut_with_progress(&graph, 1, 5, &progress)?;
// Output: Min cut: iteration 1, flow so far: 1...
// Output: Min cut: iteration 2, flow so far: 2...