Fix #497: [Model] SequencingToMinimizeWeightedCompletionTime#669
Fix #497: [Model] SequencingToMinimizeWeightedCompletionTime#669
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #669 +/- ##
==========================================
+ Coverage 97.50% 97.52% +0.01%
==========================================
Files 363 367 +4
Lines 45954 46439 +485
==========================================
+ Hits 44806 45288 +482
- Misses 1148 1151 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds the SequencingToMinimizeWeightedCompletionTime scheduling model (Lehmer-code schedule representation) and integrates it across the library, docs, example DB, and CLI; also introduces a reduction from this model to ILP<i32> with solver/closed-loop tests.
Changes:
- Introduce the
SequencingToMinimizeWeightedCompletionTimemodel + schema/variants + canonical examples. - Add
SequencingToMinimizeWeightedCompletionTime -> ILP<i32>reduction with example-db wiring and unit tests. - Extend
pred createto construct this model via--lengths,--weights, and optional--precedence-pairs, plus a CLI regression test.
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 |
|---|---|
| src/models/misc/sequencing_to_minimize_weighted_completion_time.rs | New model implementation (Lehmer code configs, metric evaluation, schema + variants + examples). |
| src/unit_tests/models/misc/sequencing_to_minimize_weighted_completion_time.rs | Model unit tests (evaluation correctness, invalid configs, serialization, brute force optimum). |
| src/rules/sequencingtominimizeweightedcompletiontime_ilp.rs | New ILP reduction (big-M disjunction with pairwise order vars) + example-db hook + tests module. |
| src/unit_tests/rules/sequencingtominimizeweightedcompletiontime_ilp.rs | Reduction shape, solution extraction, closed-loop, infeasibility, and brute-force agreement tests. |
| src/rules/mod.rs | Registers the new ILP rule module + canonical rule examples wiring. |
| src/models/misc/mod.rs | Registers the new misc model module and exports it + example-db specs wiring. |
| src/models/mod.rs | Re-exports the new model at the crate models root. |
| src/lib.rs | Exposes the new model in the public prelude. |
| src/unit_tests/trait_consistency.rs | Adds trait consistency + direction tests for the new model. |
| src/example_db/fixtures/examples.json | Adds canonical example instance + rule example; regenerates fixtures (also updates some existing solution samples). |
| docs/src/reductions/problem_schemas.json | Adds generated schema entry for the new model. |
| docs/src/reductions/reduction_graph.json | Adds generated node/edge for the new model and its ILP reduction. |
| docs/paper/references.bib | Adds Lawler (1978) + Smith (1956) references for paper coverage. |
| docs/paper/reductions.typ | Adds paper definition + example figure + ILP reduction writeup. |
| problemreductions-cli/src/cli.rs | Adds --lengths flag and updates “Flags by problem type” for the new model. |
| problemreductions-cli/src/commands/create.rs | Implements pred create SequencingToMinimizeWeightedCompletionTime ... parsing and instance construction. |
| problemreductions-cli/tests/cli_tests.rs | Adds CLI regression test for pred create of the new model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let num_tasks = self.num_tasks(); | ||
| let total_processing_time = self.total_processing_time() as f64; | ||
| let num_order_vars = num_tasks * (num_tasks.saturating_sub(1)) / 2; | ||
| let num_vars = num_tasks + num_order_vars; |
problemreductions-cli/src/cli.rs
Outdated
| /// Task lengths for SequencingToMinimizeWeightedCompletionTime (comma-separated, e.g., "2,1,3,1,2") | ||
| #[arg(long)] | ||
| pub lengths: Option<String>, | ||
| /// Precedence pairs for MinimumTardinessSequencing (e.g., "0>3,1>3,1>4,2>4") |
…letion-time and fix review feedback
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
Review Pipeline Update
Remaining issues for final review
🤖 Generated by review-pipeline |
- Remove duplicate `lengths` field in CLI args - Update ModelExampleSpec to use new struct fields (instance, optimal_config, optimal_value) instead of removed `build` closure - Replace removed `direct_ilp_example` helper with `rule_example_with_witness` pattern Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the pred-path variant suggestion code and its test, as they are outside the scope of this model/rule PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The help string was generalized to "scheduling problems" but the test expected specific problem names. List all three explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
SequencingToMinimizeWeightedCompletionTimemodel with Lehmer-code schedules, canonical examples, registry wiring, and paper coverageSequencingToMinimizeWeightedCompletionTime -> ILP<i32>reduction with example-db wiring and closed-loop/solver testspred createwith--lengths,--weights, and--precedence-pairs, plus a CLI regression testVerification
make testmake clippymake papercargo test -p problemreductions-cli test_create_sequencing_to_minimize_weighted_completion_timecargo clippy --all-targets --all-features -- -D warningsis blocked locally becausescip-syscannot find a SCIP installation in this environmentFixes #497