You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add MaximumClique<SimpleGraph, One> variant with weight cast and reductions (#1055)
* Add MaximumClique<SimpleGraph, One> variant with weight cast and reductions
Register the One (unit weight) variant for MaximumClique so reduction paths
from MIS/SimpleGraph/One no longer require unnecessary weight promotion to
i32 before reaching MaxClique. Consolidate complement_edges into graph_helpers
to eliminate 3 duplicate copies (DRY).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Drop dominated MaxClique cast; add <One> closed-loop tests
The `MaximumClique<SG,One> → MaximumClique<SG,i32>` direct cast is
dominated by the existing `MC<SG,One> → MIS<SG,One> → MIS<SG,i32>
→ MC<SG,i32>` path, which the redundancy-sanity test flags in
`rules::analysis::tests::test_find_dominated_rules_returns_known_set`.
Remove the cast entirely (and its now-empty `maximumclique_casts.rs`);
the cast-less `<One> → <i32>` path is still reachable via MIS, so
`pred path MaximumIndependentSet MaximumClique` stays on `One` without
the `i32` detour.
Also:
- add `<One>` closed-loop tests for both MC↔MIS reduction directions
and a `MaximumClique<SG,One>` model-level evaluate/solve test,
- drop the redundant `Clone + Default` bounds on
`reduce_clique_to_is`/`reduce_is_to_clique` (already implied by
`WeightElement`),
- move the stray `use super::graph_helpers::complement_edges;` in
`kcoloring_partitionintocliques.rs` up with the other imports.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add canonical rule examples for <One> MC↔MIS reductions
The test `canonical_rule_examples_cover_exactly_authored_direct_reductions`
requires every registered `#[reduction]` edge to have a matching
canonical `RuleExampleSpec`. The new `<SimpleGraph, One>` edges for
`MaximumClique ↔ MaximumIndependentSet` had no corresponding example
entries, so the test failed in CI (Code Coverage + Test jobs).
Add parallel `_one` variants of the existing i32 examples, reusing the
same P4/P5 graph shapes and solutions (the target configs are identical
because the reduction is vertex-identity).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Pin MC↔MIS paper examples to i32 weight variant
`canonical_rule_examples_cover_exactly_authored_direct_reductions`
requires one `RuleExampleSpec` per `#[reduction]` edge, so we now have
i32 and One examples for both MC↔MIS directions. But the paper's
`load-example("MaximumIndependentSet", "MaximumClique")` and
`load-example("MaximumClique", "MaximumIndependentSet")` calls with no
variant filter become ambiguous and the paper build panics in CI's
Build paper step.
Pin both direct `load-example` calls and the matching `reduction-rule`
`example-*-variant` kwargs to `(graph: "SimpleGraph", weight: "i32")`
to preserve the pre-PR behavior (i32 was the only example before).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments