Skip to content

Commit 0289a9e

Browse files
isPANNclaude
andcommitted
Add canonical example for ThreeDimensionalMatching -> ThreeMatroidIntersection (#857 review)
Surfaced during structural review: rule was missing canonical_rule_example_specs() and was not extended into the rule example aggregator in mod.rs. Adds the q=3 5-triple feasible instance from the closed-loop test as the canonical example. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent f601a38 commit 0289a9e

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/rules/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ pub(crate) fn canonical_rule_example_specs() -> Vec<crate::example_db::specs::Ru
492492
specs.extend(exactcoverby3sets_maximumsetpacking::canonical_rule_example_specs());
493493
specs.extend(maxcut_minimumcutintoboundedsets::canonical_rule_example_specs());
494494
specs.extend(partition_binpacking::canonical_rule_example_specs());
495+
specs.extend(threedimensionalmatching_threematroidintersection::canonical_rule_example_specs());
495496
specs.extend(threedimensionalmatching_threepartition::canonical_rule_example_specs());
496497
specs.extend(threepartition_resourceconstrainedscheduling::canonical_rule_example_specs());
497498
specs.extend(

src/rules/threedimensionalmatching_threematroidintersection.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,27 @@ impl ReduceTo<ThreeMatroidIntersection> for ThreeDimensionalMatching {
5454
}
5555
}
5656

57+
#[cfg(feature = "example-db")]
58+
pub(crate) fn canonical_rule_example_specs() -> Vec<crate::example_db::specs::RuleExampleSpec> {
59+
use crate::export::SolutionPair;
60+
61+
vec![crate::example_db::specs::RuleExampleSpec {
62+
id: "threedimensionalmatching_to_threematroidintersection",
63+
build: || {
64+
crate::example_db::specs::rule_example_with_witness::<_, ThreeMatroidIntersection>(
65+
ThreeDimensionalMatching::new(
66+
3,
67+
vec![(0, 0, 0), (1, 1, 1), (2, 2, 2), (0, 1, 2), (1, 2, 0)],
68+
),
69+
SolutionPair {
70+
source_config: vec![1, 1, 1, 0, 0],
71+
target_config: vec![1, 1, 1, 0, 0],
72+
},
73+
)
74+
},
75+
}]
76+
}
77+
5778
#[cfg(test)]
5879
#[path = "../unit_tests/rules/threedimensionalmatching_threematroidintersection.rs"]
5980
mod tests;

0 commit comments

Comments
 (0)