Skip to content

fix(mincut): report sampled cuts on the original graph - #1097

Open
rudycelekli wants to merge 1 commit into
ruvnet:mainfrom
rudycelekli:fix/mincut-valid-approx-cut-1085
Open

rudycelekli wants to merge 1 commit into
ruvnet:mainfrom
rudycelekli:fix/mincut-valid-approx-cut-1085

Conversation

@rudycelekli

Copy link
Copy Markdown

Summary

Fix #1085. ApproxMinCut used to return the numerical minimum cut of a sampled, rescaled graph, then attach an unrelated BFS partition of the original graph. The returned value could be below the exact minimum cut and did not equal the reported partition's crossing weight.

This change solves each sampled graph for a candidate partition with the crate's existing exact kernel, evaluates that partition on all original edges, and selects the lightest valid candidate. The reported value, upper_bound, and partition now refer to the same original-graph cut. A conservative 0.0 lower bound replaces the uncertified value / (1+ε) expression for nonnegative weights. The requested ε remains a sampling parameter; this PR does not claim a (1+ε) approximation guarantee. Cached queries retain the matching partition, and updates invalidate both value and partition.

For small or disconnected graphs the same exact kernel runs on the original edges. Finite nonnegative weights are enforced at insertion, matching the premise of the cut bound. The old duplicate dense Stoer–Wagner implementation and unrelated BFS partition builder are removed.

Reproduction and validation

  • Before the fix, a 60-vertex weighted ring with chords failed reported value >= exact minimum.
  • After the fix, the regression verifies the returned partition's original-edge weight, the exact minimum's inclusion in [lower_bound, upper_bound], and cached-query consistency. A second regression verifies insert/delete cache invalidation.
  • Reduced standalone crate harness: 505 unit tests passed, 1 ignored, 13 long subpolynomial:: tests filtered; 26 doctests passed, 20 ignored.
  • rustfmt --check and git diff --check: passed.

The full workspace CI and long subpolynomial tests were not run locally. The reduced harness resolves dependencies from crates.io rather than the workspace lockfile. No performance benchmark or all-graph approximation ratio is claimed. This is independent of #1092's DynamicMinCut result-label fix, though both PRs edit nearby documentation in this module.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ruvector-mincut: ApproxMinCut returns values below the exact min cut (0.20–0.33×)

1 participant