The LocalKCut algorithm is a deterministic local minimum cut algorithm introduced in the December 2024 paper "Deterministic and Exact Fully-dynamic Minimum Cut of Superpolylogarithmic Size". It provides a derandomized approach to finding minimum cuts near a given vertex.
Previous approaches (SODA 2025) used randomized sampling to find local cuts. The December 2024 paper derandomizes this using:
- Deterministic edge colorings (4 colors)
- Color-constrained BFS enumeration
- Forest packing for witness guarantees
- Graph
G = (V, E)with edge weights - Vertex
v ∈ V(starting point) - Cut size bound
k
- A cut
(S, V\S)withv ∈ Sand cut value ≤k - Or
Noneif no such cut exists nearv
LocalKCut(G, v, k):
1. Assign colors to edges: color(e) = edge_id mod 4
2. Set radius r = ⌈log₄(k)⌉ + 1
3. For depth d = 1 to r:
For each color mask M ⊆ {Red, Blue, Green, Yellow}:
4. Reachable[M] = ColorConstrainedBFS(v, M, d)
5. If Reachable[M] forms a cut of size ≤ k:
Store as candidate
6. Return minimum cut found
ColorConstrainedBFS(start, color_mask, max_depth):
1. visited = {start}
2. queue = [(start, 0)]
3. While queue not empty:
(u, depth) = queue.pop()
If depth >= max_depth: continue
For each neighbor w of u via edge e:
If color(e) ∈ color_mask and w ∉ visited:
visited.add(w)
queue.push((w, depth + 1))
4. Return visited
Theorem 1: If there exists a minimum cut (S, V\S) with v ∈ S and |δ(S)| ≤ k, then LocalKCut(G, v, k) finds it.
Proof sketch:
- The cut can be characterized by a color pattern
- Enumeration tries all 4^r color combinations
- For
r = O(log k), this covers all cuts up to sizek
- Time per vertex:
O(k^{O(1)} · deg(v)) - Space:
O(m)for edge colorings - Deterministic: No randomization
Using forest packing with ⌈λ_max · log(m) / ε²⌉ forests:
Theorem 2: Any cut of value ≤ λ_max is witnessed by all forests with probability 1 (deterministic).
We use a simple deterministic coloring:
color(edge) = edge_id mod 4This ensures:
- Determinism: Same graph → same colors
- Balance: Roughly equal colors across edges
- Simplicity: O(1) per edge
We use a 4-bit mask to represent color subsets:
Bit 0: Red
Bit 1: Blue
Bit 2: Green
Bit 3: Yellow
Example: 0b1010 = {Blue, Yellow}
This allows:
- Fast membership testing:
O(1) - Efficient enumeration: 16 total masks
- Compact storage: 1 byte per mask
The search radius is:
radius = ⌈log₄(k)⌉ + 1 = ⌈log₂(k) / 2⌉ + 1Rationale:
- A cut of size
kcan be described by ≤log₄(k)color choices - Extra +1 provides buffer for edge cases
- Keeps enumeration tractable:
O(4^r) = O(k²)
use ruvector_mincut::prelude::*;
use std::sync::Arc;
// Create graph
let graph = Arc::new(DynamicGraph::new());
graph.insert_edge(1, 2, 1.0).unwrap();
graph.insert_edge(2, 3, 1.0).unwrap();
graph.insert_edge(3, 4, 1.0).unwrap();
// Find local cut from vertex 1 with k=2
let local_kcut = LocalKCut::new(graph, 2);
if let Some(result) = local_kcut.find_cut(1) {
println!("Cut value: {}", result.cut_value);
println!("Cut set: {:?}", result.cut_set);
println!("Iterations: {}", result.iterations);
}// Create forest packing for witness guarantees
let lambda_max = 10; // Upper bound on min cut
let epsilon = 0.1; // Approximation parameter
let packing = ForestPacking::greedy_packing(&*graph, lambda_max, epsilon);
// Find cut
let local_kcut = LocalKCut::new(graph.clone(), lambda_max);
if let Some(result) = local_kcut.find_cut(start_vertex) {
// Check witness property
if packing.witnesses_cut(&result.cut_edges) {
println!("Cut is witnessed by all forests ✓");
}
}// Enumerate all color-constrained reachable sets
let paths = local_kcut.enumerate_paths(vertex, depth);
for path in paths {
println!("Reachable set: {} vertices", path.len());
// Analyze structure
}Find natural clusters by detecting weak cuts:
for vertex in graph.vertices() {
if let Some(cut) = local_kcut.find_cut(vertex) {
if cut.cut_value <= threshold {
// Found a cluster around vertex
process_cluster(cut.cut_set);
}
}
}Find critical edges (bridges):
let local_kcut = LocalKCut::new(graph, 1);
for vertex in graph.vertices() {
if let Some(cut) = local_kcut.find_cut(vertex) {
if cut.cut_value == 1.0 && cut.cut_edges.len() == 1 {
println!("Bridge: {:?}", cut.cut_edges[0]);
}
}
}Identify densely connected components:
let mut communities = Vec::new();
let mut visited = HashSet::new();
for vertex in graph.vertices() {
if visited.contains(&vertex) {
continue;
}
if let Some(cut) = local_kcut.find_cut(vertex) {
if cut.cut_value <= community_threshold {
communities.push(cut.cut_set.clone());
visited.extend(&cut.cut_set);
}
}
}| Algorithm | Time | Space | Deterministic | Global/Local |
|---|---|---|---|---|
| LocalKCut (Dec 2024) | O(k² · deg(v)) | O(m) | ✓ | Local |
| LocalKCut (SODA 2025) | O(k · deg(v)) | O(m) | ✗ | Local |
| Karger-Stein | O(n² log³ n) | O(m) | ✗ | Global |
| Stoer-Wagner | O(nm + n² log n) | O(n²) | ✓ | Global |
| Our Full Algorithm | O(n^{o(1)}) amortized | O(m) | ✓ | Global |
- Deterministic: No randomization → reproducible results
- Local: Faster than global algorithms for sparse graphs
- Exact: Finds exact cuts (not approximate)
- Simple: Easy to implement and understand
- Parallelizable: Different vertices can be processed in parallel
- Local scope: May miss global minimum cut
- Parameter k: Requires knowing approximate cut size
- Small cuts: Best for cuts of size ≤ polylog(n)
- Enumeration: Exponential in log(k), so k must be small
- Adaptive radius: Dynamically adjust based on graph structure
- Smart coloring: Use graph properties for better colorings
- Pruning: Skip color combinations that can't improve result
- Caching: Reuse BFS results across color masks
- Parallel: Run different color masks in parallel
- December 2024: "Deterministic and Exact Fully-dynamic Minimum Cut of Superpolylogarithmic Size"
- SODA 2025: "Subpolynomial-time Dynamic Minimum Cut via Randomized LocalKCut"
- Karger 1996: "Minimum cuts in near-linear time"
- Stoer-Wagner 1997: "A simple min-cut algorithm"
DynamicMinCut- Full dynamic minimum cut algorithmForestPacking- Witness guaranteesExpanderDecomposition- Graph decompositionHierarchicalDecomposition- Tree structure