Fix #296: [Model] UndirectedTwoCommodityIntegralFlow#658
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #658 +/- ##
==========================================
+ Coverage 96.96% 96.97% +0.01%
==========================================
Files 275 277 +2
Lines 36843 37161 +318
==========================================
+ Hits 35724 36038 +314
- Misses 1119 1123 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds the UndirectedTwoCommodityIntegralFlow graph satisfaction model (Fixes #296) and wires it through the library registry, example DB, CLI, and docs/paper so it shows up as a first-class problem type across the project.
Changes:
- Introduces
UndirectedTwoCommodityIntegralFlowmodel implementation (schema registration, evaluation logic, variant declaration, canonical example spec). - Adds unit tests + example-db fixture entry for the model and updates trait-consistency checks.
- Extends the CLI (
list,show,create) and regenerates docs JSON / paper references + section for the new model.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/models/graph/undirected_two_commodity_integral_flow.rs | New model implementation, schema registration, variant declaration, example-db spec, tests module hook-up |
| src/models/graph/mod.rs | Registers the new graph submodule, re-export, and adds example-db spec aggregation |
| src/models/mod.rs | Re-exports the new model from the top-level models module |
| src/lib.rs | Re-exports the model in the public prelude |
| src/unit_tests/models/graph/undirected_two_commodity_integral_flow.rs | New unit tests for creation/evaluation/serialization and overflow edge cases |
| src/unit_tests/trait_consistency.rs | Adds trait-consistency coverage for the new model |
| src/example_db/fixtures/examples.json | Adds canonical example fixture entry for the new model |
| src/example_db/model_builders.rs | Clarifies model-example sourcing (graph registry) |
| src/unit_tests/example_db.rs | Formatting tweak in fixture verification output/labeling |
| src/unit_tests/export.rs | Formatting tweak for JSON line assertion |
| problemreductions-cli/src/cli.rs | Adds --capacities and terminal/requirement flags + help text/examples for pred create |
| problemreductions-cli/src/commands/create.rs | Implements pred create UndirectedTwoCommodityIntegralFlow ... parsing/validation and adds type hints/example string |
| problemreductions-cli/src/problem_name.rs | Adds alias-resolution test coverage for the new canonical name |
| problemreductions-cli/tests/cli_tests.rs | Adds CLI tests for list, show, and create for the new model |
| docs/src/reductions/problem_schemas.json | Regenerated schema JSON including the new model entry |
| docs/src/reductions/reduction_graph.json | Regenerated reduction graph JSON including the new variant node |
| docs/paper/references.bib | Adds Even–Itai–Shamir (1976) reference |
| docs/paper/reductions.typ | Adds paper section + figure/example narrative for the new model |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "HamiltonianPath" => "--graph 0-1,1-2,2-3", | ||
| "UndirectedTwoCommodityIntegralFlow" => { | ||
| "--graph 0-2,1-2,2-3 --capacities 1,1,2 --source-1 0 --sink-1 3 --source-2 1 --sink-2 3 --requirement-1 1 --requirement-2 1" | ||
| } |
| fn even_capacity_instance() -> UndirectedTwoCommodityIntegralFlow { | ||
| UndirectedTwoCommodityIntegralFlow::new( | ||
| SimpleGraph::new(4, vec![(0, 2), (1, 2), (2, 3)]), | ||
| vec![1, 1, 2], | ||
| 0, |
…96-undirected-two-commodity-integral-flow # Conflicts: # src/example_db/fixtures/examples.json # src/models/graph/mod.rs # src/models/mod.rs
- Rename capacity_two_bottleneck_instance to canonical_instance - Add #[should_panic] tests for constructor validation (capacity count mismatch, vertex out of bounds) - Add flow conservation violation test and shared capacity exceeded test - Replace platform-dependent large-capacity tests with portable versions - Revert unrelated README.md change - Remove stale test report file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zazabap
left a comment
There was a problem hiding this comment.
Final review passed — all CI green, coverage fixed, quality ~82%.
Merge origin/main into issue-296 branch, resolving conflicts in source code (models/mod.rs, cli.rs, create.rs, trait_consistency.rs, reductions.typ, cli.md) by keeping both sides (UndirectedTwoCommodityIntegralFlow from this branch + SteinerTree, SetBasis, LengthBoundedDisjointPaths from main). Regenerated reduction_graph.json, problem_schemas.json, and examples.json. Reverted README.md to main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zazabap
left a comment
There was a problem hiding this comment.
Final review passed — conflicts resolved, all weaknesses fixed, quality ~82%.
Summary
Fixes #296