pub fn critical_path_with_progress<F>(
graph: &SqliteGraph,
weight_fn: &WeightCallback,
progress: &F,
) -> Result<CriticalPathResult, CriticalPathError>where
F: ProgressCallback,Expand description
Computes the critical path with progress tracking.
Same as critical_path but reports progress during execution.
Suitable for long-running critical path analysis on large graphs.
§Progress Stages
- “Validating DAG structure” - Topological sort
- “Computing critical path” - Longest path DP
- “Reconstructing path” - Building the path from predecessors
§Arguments
graph- The DAG to analyzeweight_fn- Callback to extract edge weightprogress- Progress callback for status updates
§Example
ⓘ
use sqlitegraph::{
SqliteGraph,
algo::critical_path::{critical_path_with_progress, default_weight_fn},
progress::ConsoleProgress
};
let graph = SqliteGraph::open_in_memory()?;
// ... build large DAG ...
let progress = ConsoleProgress::new();
let result = critical_path_with_progress(&graph, &default_weight_fn, &progress)?;