Skip to content

Fix #497: [Model] SequencingToMinimizeWeightedCompletionTime#669

Merged
isPANN merged 12 commits intomainfrom
issue-497-sequencing-to-minimize-weighted-completion-time
Mar 20, 2026
Merged

Fix #497: [Model] SequencingToMinimizeWeightedCompletionTime#669
isPANN merged 12 commits intomainfrom
issue-497-sequencing-to-minimize-weighted-completion-time

Conversation

@GiggleLiu
Copy link
Contributor

@GiggleLiu GiggleLiu commented Mar 16, 2026

Summary

  • add the SequencingToMinimizeWeightedCompletionTime model with Lehmer-code schedules, canonical examples, registry wiring, and paper coverage
  • add the SequencingToMinimizeWeightedCompletionTime -> ILP<i32> reduction with example-db wiring and closed-loop/solver tests
  • extend pred create with --lengths, --weights, and --precedence-pairs, plus a CLI regression test

Verification

  • make test
  • make clippy
  • make paper
  • cargo test -p problemreductions-cli test_create_sequencing_to_minimize_weighted_completion_time
  • cargo clippy --all-targets --all-features -- -D warnings is blocked locally because scip-sys cannot find a SCIP installation in this environment

Fixes #497

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 99.17526% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.52%. Comparing base (2228c61) to head (fa005f4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...sequencing_to_minimize_weighted_completion_time.rs 97.14% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SequencingToMinimizeWeightedCompletionTime model + schema/variants + canonical examples.
  • Add SequencingToMinimizeWeightedCompletionTime -> ILP<i32> reduction with example-db wiring and unit tests.
  • Extend pred create to 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.

Comment on lines +69 to +72
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;
/// 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")
@GiggleLiu
Copy link
Contributor Author

Review Pipeline Report

Check Result
Copilot comments 2 fixed
Issue/human comments 1 checked, 0 fixed
Structural review passed after fixing 2 findings
CI green
Agentic test passed
Needs human decision none
Board Review pool → Under review → Final review

Remaining issues for final review

  • None.

🤖 Generated by review-pipeline

@GiggleLiu
Copy link
Contributor Author

Review Pipeline Update

Check Result
Copilot comments 2 fixed
Issue/human comments 1 checked, 0 fixed
Structural review passed after fixing 4 findings
CI no checks attached to current head 04f4de20
Agentic test passed
Needs human decision none
Board Review pool → Under review

Remaining issues for final review

  • GitHub Actions has not attached any checks to the current PR head 04f4de20 even after a no-op retrigger commit. Local verification is green (make test, make clippy, make paper), but the PR should remain in Under review until CI appears or is manually retriggered.

🤖 Generated by review-pipeline

@isPANN isPANN self-assigned this Mar 20, 2026
isPANN and others added 3 commits March 20, 2026 19:48
- 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>
isPANN and others added 3 commits March 20, 2026 19:59
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>
@isPANN isPANN merged commit 3618171 into main Mar 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Model] SequencingToMinimizeWeightedCompletionTime

3 participants