Fix #289: Add ShortestWeightConstrainedPath model#632
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #632 +/- ##
========================================
Coverage 97.59% 97.60%
========================================
Files 387 389 +2
Lines 48159 48478 +319
========================================
+ Hits 47002 47316 +314
- Misses 1157 1162 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…89-shortest-weight-constrained-path
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds a new graph satisfaction model, ShortestWeightConstrainedPath, to the problemreductions catalog, integrating it into the CLI and documentation pipeline alongside tests and canonical examples.
Changes:
- Introduces
ShortestWeightConstrainedPathmodel with schema registration, variants, evaluation logic, and canonical example-db spec. - Wires the model into public exports (
models,prelude), CLIpred createflag parsing, and CLI test coverage. - Updates example-db fixtures and generated docs JSON (problem schemas + reduction graph) plus paper documentation/references.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/suites/integration.rs | Adds integration coverage ensuring the brute-force solver can find a satisfying config. |
| src/unit_tests/trait_consistency.rs | Extends trait-consistency checks to include the new model. |
| src/unit_tests/models/graph/shortest_weight_constrained_path.rs | Adds unit tests for construction, accessors, evaluation, brute-force enumeration, and serde roundtrip. |
| src/unit_tests/export.rs | Minor formatting adjustment in export-related test. |
| src/unit_tests/example_db.rs | Refactors formatting/labeling in fixture verification assertions. |
| src/models/mod.rs | Re-exports the new graph model at the models module level. |
| src/models/graph/shortest_weight_constrained_path.rs | Implements the model + schema entry + canonical example + variant declaration. |
| src/models/graph/mod.rs | Registers module, re-export, and canonical example spec aggregation. |
| src/lib.rs | Exposes the new model via the prelude. |
| src/example_db/fixtures/examples.json | Adds canonical example fixture entry for the new model. |
| problemreductions-cli/tests/cli_tests.rs | Adds CLI tests for pred create ShortestWeightConstrainedPath and error cases. |
| problemreductions-cli/src/commands/create.rs | Implements pred create construction path and edge-length parsing helper. |
| problemreductions-cli/src/cli.rs | Adds new CLI flags (--edge-lengths, bounds, source/target) and help text. |
| docs/src/reductions/reduction_graph.json | Updates generated reduction graph catalog to include the new node/variant. |
| docs/src/reductions/problem_schemas.json | Updates generated schema catalog to include the new problem’s fields. |
| docs/paper/references.bib | Adds citations relevant to constrained shortest path. |
| docs/paper/reductions.typ | Adds paper section/example/figure for the new model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FieldInfo { name: "length_bound", type_name: "N::Sum", description: "Upper bound K on total path length" }, | ||
| FieldInfo { name: "weight_bound", type_name: "N::Sum", description: "Upper bound W on total path weight" }, |
| FieldInfo { name: "edge_weights", type_name: "Vec<N>", description: "Edge weights w: E -> ZZ_(> 0)" }, | ||
| FieldInfo { name: "source_vertex", type_name: "usize", description: "Source vertex s" }, | ||
| FieldInfo { name: "target_vertex", type_name: "usize", description: "Target vertex t" }, | ||
| FieldInfo { name: "length_bound", type_name: "N::Sum", description: "Upper bound K on total path length" }, | ||
| FieldInfo { name: "weight_bound", type_name: "N::Sum", description: "Upper bound W on total path weight" }, |
…89-shortest-weight-constrained-path
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
…ight-constrained-path # Conflicts: # docs/paper/reductions.typ # docs/paper/references.bib # docs/src/cli.md # docs/src/reductions/problem_schemas.json # docs/src/reductions/reduction_graph.json # problemreductions-cli/src/cli.rs # problemreductions-cli/src/commands/create.rs # src/example_db/fixtures/examples.json # src/lib.rs # src/models/graph/mod.rs # src/models/mod.rs # src/unit_tests/example_db.rs # src/unit_tests/trait_consistency.rs # tests/suites/integration.rs
- Resolve merge conflicts in 11 files (both-sides-added pattern) - Remove generated files deleted in main (problem_schemas.json, reduction_graph.json, examples.json) - Update ModelExampleSpec to use new API (instance/optimal_config/optimal_value instead of build closure) - Fix paper Typst code: use graph.edges instead of graph.inner.edges, use optimal_config instead of samples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add edge_lengths, source_vertex, target_vertex, length_bound, weight_bound to empty_args() - Remove duplicate W::Sum pattern already covered by earlier match arm Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ight-constrained-path # Conflicts: # docs/src/cli.md
Summary
Fixes #289