Fix #141: Add MinimumFeedbackVertexSet to ILP reduction#624
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
==========================================
+ Coverage 97.11% 97.12% +0.01%
==========================================
Files 294 296 +2
Lines 39220 39392 +172
==========================================
+ Hits 38088 38259 +171
- Misses 1132 1133 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add MTZ-style topological ordering reduction from MinimumFeedbackVertexSet to ILP<i32>. Uses 2n variables (n binary + n integer ordering) and m + 2n constraints. Includes unit tests, example program, and paper documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds a new reduction rule from MinimumFeedbackVertexSet (directed) to ILP<i32> using an MTZ-style topological-ordering formulation, plus supporting docs/examples/tests. This expands the reduction graph so MFVS instances can be solved exactly via ILP backends.
Changes:
- Implement
MinimumFeedbackVertexSet → ILP<i32>reduction with2nvariables andm + 2nconstraints. - Add unit tests + example suite coverage for the new reduction and solution extraction.
- Regenerate/update documentation artifacts (reduction graph + paper section) to include the new rule.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/rules/minimumfeedbackvertexset_ilp.rs |
Implements the MFVS→ILP reduction (variable layout, constraints, objective, extraction). |
src/rules/mod.rs |
Registers the new reduction module behind the ilp-solver feature. |
src/unit_tests/rules/minimumfeedbackvertexset_ilp.rs |
Adds correctness/structure tests comparing ILP solutions vs brute force on small instances. |
examples/reduction_minimumfeedbackvertexset_to_ilp.rs |
Adds a runnable/exportable example demonstrating the reduction and verification. |
tests/suites/examples.rs |
Hooks the new example into the example test suite. |
docs/src/reductions/reduction_graph.json |
Updates the generated reduction graph to include the new reduction edge. |
docs/paper/reductions.typ |
Adds a paper-form description of the MFVS→ILP formulation and correctness sketch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n_graph.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove old-style example binary and add canonical_rule_example_specs() to the MFVS-to-ILP rule, matching the current project convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The solve_ilp function only downcasted to ILP<bool>, causing `pred solve` to fail for problems that reduce to ILP<i32> (e.g., MinimumFeedbackVertexSet). Now tries both ILP<bool> and ILP<i32>. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Pipeline Report
Fixes applied during review
Remaining issues for final review
🤖 Generated by review-pipeline |
# Conflicts: # docs/src/reductions/reduction_graph.json
- examples.json now includes MFVS-to-ILP canonical example - create.rs: remove extra blank line (rustfmt) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Adds a reduction from MinimumFeedbackVertexSet to ILP using the MTZ-style topological ordering formulation. The reduction uses 2n variables (n binary for vertex removal + n integer for topological order) and m + 2n constraints (one per arc + bounds).
Fixes #141