Skip to main content

partition_kway_with_progress

Function partition_kway_with_progress 

Source
pub fn partition_kway_with_progress<F>(
    graph: &SqliteGraph,
    config: &PartitionConfig,
    progress: &F,
) -> Result<PartitionResult, SqliteGraphError>
Expand description

Partition graph into k balanced partitions with progress tracking.

Same algorithm as partition_kway but reports progress during execution. Useful for long-running operations on large graphs.

§Arguments

  • graph - The graph to partition
  • config - Partitioning configuration
  • progress - Progress callback for reporting execution status

§Returns

PartitionResult containing k balanced partitions.

§Progress Reporting

The callback receives:

  • current: Current number of nodes assigned
  • total: Total number of nodes in graph
  • message: “K-way partition: assigned {current}/{total} nodes”

Progress is reported during BFS growth phase as nodes are assigned.

§Example

let progress = ConsoleProgress::new();
let config = PartitionConfig::default();
let result = partition_kway_with_progress(&graph, &config, &progress)?;
// Output: K-way partition: assigned 10/100 nodes...