Skip to content

Fix #207: [Rule] MinimumVertexCover to MinimumFeedbackVertexSet#713

Merged
GiggleLiu merged 4 commits intomainfrom
issue-207
Mar 21, 2026
Merged

Fix #207: [Rule] MinimumVertexCover to MinimumFeedbackVertexSet#713
GiggleLiu merged 4 commits intomainfrom
issue-207

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

Summary

Add the plan and implementation for the MinimumVertexCover -> MinimumFeedbackVertexSet reduction.

Fixes #207

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.59%. Comparing base (ca2110e) to head (5895c4b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #713      +/-   ##
==========================================
+ Coverage   97.57%   97.59%   +0.02%     
==========================================
  Files         381      385       +4     
  Lines       47649    47886     +237     
==========================================
+ Hits        46494    46736     +242     
+ Misses       1155     1150       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Implementation Summary

Changes

  • Added src/rules/minimumvertexcover_minimumfeedbackvertexset.rs implementing the MinimumVertexCover -> MinimumFeedbackVertexSet reduction with identity solution extraction and overhead num_vertices = num_vertices, num_arcs = 2 * num_edges.
  • Registered the new rule and its canonical example in src/rules/mod.rs.
  • Added src/unit_tests/rules/minimumvertexcover_minimumfeedbackvertexset.rs covering round-trip correctness on a cyclic source graph, target structure, weight preservation, identity extraction, and example-db witness validation.
  • Added the corresponding paper reduction entry in docs/paper/reductions.typ using the exported canonical example data.

Deviations from Plan

  • The repo no longer has make regenerate-fixtures; I used cargo run --features "example-db" --example export_examples, which is the current fixture export path wired into make paper.
  • docs/paper/reductions.typ already had an uncommitted one-line local fix in another section of the file when I reached the paper step. I preserved it while adding the new MVC -> MinimumFeedbackVertexSet entry rather than trying to rewrite around existing worktree state.

Open Questions

  • None.

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Agentic Review Report

Structural Check

Structural Review: rule minimumvertexcover_minimumfeedbackvertexset

Structural Completeness

# Check Status
1 Rule file exists PASS
2 #[reduction(...)] macro present PASS
3 ReductionResult impl present PASS
4 ReduceTo impl present PASS
5 #[cfg(test)] + #[path = "..."] test link PASS
6 Test file exists PASS
7 Closed-loop test present PASS
8 Registered in src/rules/mod.rs PASS
9 Canonical rule example registered PASS
10 Example-db lookup tests exist PASS
11 Paper reduction-rule entry exists PASS
12 Blacklisted autogenerated files committed PASS — none in diff

Build Status

  • make test: PASS
  • make clippy: PASS
  • make paper: PASS

Semantic Review

  • extract_solution: OK — identity mapping is correct because the reduction preserves the vertex set and selection semantics.
  • Overhead accuracy: OK — reduce_to() duplicates each undirected edge into exactly two directed arcs, matching num_vertices = num_vertices and num_arcs = 2 * num_edges.
  • Mathematical correctness: OK — every target 2-cycle corresponds to a source edge, so any FVS is a vertex cover; conversely any vertex cover hits every directed cycle because each cycle is composed of source edges.
  • Example quality: OK — the canonical 7-vertex example matches the linked issue and the exported witness is feasible and optimal on both source and target.
  • Paper quality: OK — the new theorem statement and proof sketch are sound, and the paper build succeeds.

Issue Compliance

# Check Status
1 Source/target match issue OK
2 Reduction algorithm matches OK
3 Solution extraction matches OK
4 Correctness preserved OK
5 Overhead expressions match OK
6 Example matches OK

Summary

  • 12/12 structural checks passed
  • 6/6 issue compliance checks passed
  • No structural correctness issues found

Quality Check

Quality Review

Design Principles

  • DRY: OK — the rule follows the existing small-reduction pattern without introducing duplicate helpers.
  • KISS: OK — reduce_to() is a direct edge-to-bidirected-edge transformation with no unnecessary abstraction.
  • HC/LC: OK — rule logic, tests, and paper text remain separated along existing repo boundaries.

Test Quality

  • Naive test detection: OK
    • The suite includes a closed-loop optimality check, explicit arc-structure verification, weight preservation, identity extraction, and canonical example-db validation.
    • The closed-loop test uses a source graph with both 2-cycles and a longer directed cycle after reduction, so it exercises the nontrivial part of the proof rather than only a degenerate path instance.

Issues

Critical (Must Fix)

  • None.

Important (Should Fix)

  • None.

Minor (Nice to Have)

Summary

  • No code-quality or test-quality defects found in the MVC -> MinimumFeedbackVertexSet implementation.
  • One minor scope note: unrelated paper cleanup is bundled in the same PR.

Agentic Feature Tests

Feature Test Report: problemreductions CLI

Feature tested: MinimumVertexCover -> MinimumFeedbackVertexSet
Profile: ephemeral
Use Case: downstream CLI user discovers the new reduction, materializes the canonical example, reduces it, and solves both sides with brute force
Expected Outcome: the new rule is discoverable in the catalog and works end-to-end through pred
Verdict: pass
Critical Issues: 0

Summary

Feature Discoverable Setup Works Expected Outcome Met Doc Quality
MVC -> FVS rule yes yes yes yes good

Per-Feature Details

MinimumVertexCover -> MinimumFeedbackVertexSet

  • What I tried:
    • cargo run -q -p problemreductions-cli --bin pred -- list --rules
    • cargo run -q -p problemreductions-cli --bin pred -- show MVC
    • cargo run -q -p problemreductions-cli --bin pred -- show FVS
    • cargo run -q -p problemreductions-cli --bin pred -- path MVC FVS
    • cargo run -q -p problemreductions-cli --bin pred -- create --example MVC --to FVS -o /tmp/mvc_to_fvs_alias_source.json
    • cargo run -q -p problemreductions-cli --bin pred -- solve /tmp/mvc_to_fvs_source.json --solver brute-force
    • cargo run -q -p problemreductions-cli --bin pred -- reduce /tmp/mvc_to_fvs_source.json --to MinimumFeedbackVertexSet/i32 -o /tmp/mvc_to_fvs_bundle.json
    • cargo run -q -p problemreductions-cli --bin pred -- solve /tmp/mvc_to_fvs_bundle.json --solver brute-force
  • Discoverability: Good. The rule appears in pred list --rules, pred show MVC exposes it as an outgoing reduction, pred show FVS shows it as an incoming reduction, and pred path MVC FVS resolves a one-step path.
  • Setup: Worked as documented using the in-repo CLI.
  • Functionality: Worked. Canonical rule example creation succeeded, reduction produced a target bundle with MinimumFeedbackVertexSet, and solving the bundle mapped the solution back to MinimumVertexCover with the same objective Valid(4).
  • Expected vs Actual Outcome: Matched expected outcome.
  • Blocked steps: None.
  • Friction points: None found.
  • Doc suggestions: None required for this feature based on the exercised flow.

Issues Found

  • None.

Suggestions

  • None.

Generated by review-pipeline

@GiggleLiu GiggleLiu merged commit 1d7128b into main Mar 21, 2026
5 checks passed
@GiggleLiu GiggleLiu deleted the issue-207 branch April 12, 2026 00:51
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.

[Rule] MinimumVertexCover to MinimumFeedbackVertexSet

1 participant