Repository navigation
Conversation
Adds the rule DecisionMinimumVertexCover<SimpleGraph, One> -> MinimumCutIntoBoundedSets<SimpleGraph, i64>, with unit tests, a canonical example and a paper entry. Makes MinimumCutIntoBoundedSets::try_new public.
Verification certificateRule: Type resolution
Construction versus the issueThe construction differs from the one in the issue. The issue's weighted s/t construction contains the same term
Rule unit tests (14, all passing, each under a second)
End-to-end round trips (100 instances)Each instance was reduced with
Other gates
|
Agentic Review ReportSubject: rule Re-reviewThe diff since the first review touches exactly the four findings:
I re-ran formatting, clippy with Structural and semantic
Quality
Feature test
Findings of the first review (all resolved)
Outside this change, for a separate issue: Open findingsNone. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1245 +/- ##
========================================
Coverage 97.19% 97.20%
========================================
Files 1146 1148 +2
Lines 151558 152060 +502
========================================
+ Hits 147308 147808 +500
- Misses 4250 4252 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Adds the rule
DecisionMinimumVertexCover<SimpleGraph, One>→MinimumCutIntoBoundedSets<SimpleGraph, i64>, with unit tests (closed loop, exhaustive small graphs, boundary and overflow cases, extraction rejections), a canonical example (the issue's graph, bound 3) and a paper entry with a worked YES and NO example and reproduciblepredcommands.Target size: at most
2·num_vertices + 2vertices andC(n,2) − num_edges + 3·num_verticesedges; the side bound isn + 1.The construction differs from the one in the issue. The issue's weighted s/t construction cannot be used: every s–t cut in it contains the same constant term
n·M, so the optimum does not depend on the graph. This PR uses a different construction on the complement graph. Vertices are0..n, thens,t, then padding vertices attached tot. Edges are the complement pairs,{i,s}with weight 1,{i,t}with weightdeg(i) + 2, and padding edges of weightM = Φ + 1withΦ = 2|E| + 2n. WithT = n − kclamped to0..=n+1, the threshold isΦ − T². For a cut withppadding vertices ons's side and independent-side setI, the cut weight isΦ − 2e(I) − |I| + M·p. BecauseM > Φ, a cut within the threshold hasp = 0. ThenT² ≤ 2e(I) + |I| ≤ |I|²forces|I| ≥ Tande(I) = 0, soIis an independent set of size at leastn − k, and its complement is a vertex cover of size at mostk. The converse direction takes a vertex coverCof size at mostkandI = V \ C. The boundT = n + 1(negativek) is infeasible because|I| ≤ n. The extraction returns the vertices ons's side.Library change outside the rule:
MinimumCutIntoBoundedSets::try_newis madepub(behaviour unchanged), so the rule can build the target without panicking.Outside this change: the paper's parameter-contract renderer prints every
upper_boundformula as "unavailable" (it handlesexactandbound-onlyonly), which also affects existing rules. It is not changed here.Fixes #250