Fix #165: Add MaximumIndependentSet to MaximumClique reduction#606
Fix #165: Add MaximumIndependentSet to MaximumClique reduction#606
Conversation
Implement Karp's classical complement graph reduction: an independent set in G is a clique in the complement graph Ḡ. Includes unit tests, example, and paper documentation. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #606 +/- ##
==========================================
+ Coverage 96.57% 96.59% +0.01%
==========================================
Files 214 216 +2
Lines 29155 29229 +74
==========================================
+ Hits 28157 28233 +76
+ Misses 998 996 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Implements the classical Karp complement-graph reduction from MaximumIndependentSet to MaximumClique: an independent set in G is a clique in the complement graph Ḡ.
Changes:
- New reduction module with complement graph construction and identity solution extraction
- Unit tests covering closed-loop verification, weighted instances, empty and complete graphs
- Example program with JSON export and paper documentation with proof
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/rules/maximumindependentset_maximumclique.rs | Core reduction implementation |
| src/rules/mod.rs | Register new reduction module |
| src/unit_tests/rules/maximumindependentset_maximumclique.rs | Unit tests for the reduction |
| examples/reduction_maximumindependentset_to_maximumclique.rs | Example with JSON export |
| tests/suites/examples.rs | Register example test |
| docs/paper/reductions.typ | Paper documentation |
| docs/paper/examples/*.json | Generated example data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #[reduction( | ||
| overhead = { | ||
| num_vertices = "num_vertices", | ||
| num_edges = "num_vertices * (num_vertices - 1) / 2 - num_edges", | ||
| } | ||
| )] |
There was a problem hiding this comment.
The docs/src/reductions/reduction_graph.json file needs to be regenerated to include the new MaximumIndependentSet → MaximumClique reduction edge. Run cargo run --example export_graph to update it.
Adding the MIS→MaxClique reduction created a shorter path through the reduction graph, changing MIS→ILP from [MIS, MaxSetPacking, ILP] to [MIS, MaxClique, ILP]. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…lique # Conflicts: # docs/src/reductions/reduction_graph.json
- Merge latest main to pick up new models/rules - Regenerate reduction_graph.json with MIS→MaxClique edge - Fix rustfmt formatting in detect_isolated_problems.rs Co-Authored-By: Claude Opus 4.6 <[email protected]>
Both are valid 2-step paths with the same cost. The tie-breaking depends on hash map iteration order which differs across platforms. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
Fixes #165