You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add SchedulingToMinimizeWeightedCompletionTime model + ILP rule (#809)
* feat: add SchedulingToMinimizeWeightedCompletionTime model and ILP rule (#505)
Implement the multiprocessor scheduling optimization problem (SS13 from
Garey & Johnson) that minimizes total weighted completion time with
Smith's rule ordering on each processor, plus its direct ILP reduction.
- Model: Min<u64> value type, dims=[m; n], Smith's rule for per-processor ordering
- ILP rule: binary assignment + completion time + ordering variables with big-M constraints
- 16 model tests + 6 ILP tests, all passing
- CLI: pred create support, schema registration
- Paper: problem-def + reduction-rule entries with bibliography
Closes#505
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix paper definition: replace undefined σ(t) with explicit completion time description
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add C_t <= M upper bounds to ILP reduction per issue #783 spec
Adds completion-time upper bound constraints (C_t <= M where M = Σ l(t))
to tighten the LP relaxation. Updates overhead formula from 2*n to 3*n
bound constraints, matching the 75-constraint canonical example.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Given a finite set $T$ of tasks with processing lengths $ell: T -> ZZ^+$ and weights $w: T -> ZZ^+$, and a number $m in ZZ^+$ of identical processors, find an assignment $p: T -> {1, dots, m}$ that minimizes the total weighted completion time $sum_(t in T) w(t) dot C(t)$, where on each processor tasks are ordered by Smith's rule (non-decreasing $ell(t) "/" w(t)$ ratio) and $C(t)$ is the completion time of task $t$ (i.e., the cumulative processing time up to and including $t$ on its assigned processor).
5761
+
][
5762
+
Scheduling to Minimize Weighted Completion Time is problem A5 SS13 in Garey & Johnson @garey1979. NP-complete for $m = 2$ by reduction from Partition @lenstra1977, and NP-complete in the strong sense for arbitrary $m$. For a fixed assignment of tasks to processors, Smith's rule gives the optimal ordering on each processor, reducing the search space to $m^n$ processor assignments @smith1956. The problem is solvable in polynomial time when all lengths are equal or when all weights are equal @conway1967 @horn1973.
5763
+
5764
+
*Example.* Let $T = {t_1, dots, t_#ntasks}$ with lengths $(#lengths.map(str).join(", "))$, weights $(#weights.map(str).join(", "))$, and $m = #m$ processors. The optimal assignment $(#sigma.map(v => str(v + 1)).join(", "))$ achieves total weighted completion time #x.optimal_value:
caption: [Canonical Scheduling to Minimize Weighted Completion Time instance with #ntasks tasks on #m processors. Tasks are ordered on each processor by Smith's rule.],
This $O(n^2 m)$ reduction constructs an ILP with binary assignment variables $x_(t,p)$, integer completion-time variables $C_t$, and binary ordering variables $y_(i,j)$ for task pairs. Big-M disjunctive constraints enforce non-overlapping execution on shared processors.
5833
+
][
5834
+
_Construction._ Let $n = |T|$ and $m$ be the number of processors. Create $n m$ binary assignment variables $x_(t,p) in {0, 1}$ (task $t$ on processor $p$), $n$ integer completion-time variables $C_t$, and $n(n-1)/2$ binary ordering variables $y_(i,j)$ for $i < j$. The constraints are:
5835
+
(1) Assignment: $sum_p x_(t,p) = 1$ for each $t$.
5836
+
(2) Completion bounds: $C_t >= ell(t)$ for each $t$.
5837
+
(3) Disjunctive: for each pair $(i,j)$ with $i < j$ and each processor $p$, big-M constraints ensure that if both tasks are on processor $p$, one must complete before the other starts.
5838
+
The objective minimizes $sum_t w(t) dot C_t$.
5839
+
5840
+
_Correctness._ ($arrow.r.double$) Any valid schedule gives a feasible ILP solution with the same objective. ($arrow.l.double$) Any ILP solution encodes a valid assignment and non-overlapping schedule.
5841
+
5842
+
_Solution extraction._ For each task $t$, find the processor $p$ with $x_(t,p) = 1$.
5843
+
]
5844
+
5746
5845
#{
5747
5846
let x = load-model-example("SequencingWithinIntervals")
pred create BiconnectivityAugmentation --graph 0-1,1-2,2-3 --potential-edges 0-2:3,0-3:4,1-3:2 --budget 5
@@ -668,7 +670,7 @@ pub struct CreateArgs {
668
670
/// Deadline for FlowShopScheduling, MultiprocessorScheduling, or ResourceConstrainedScheduling
669
671
#[arg(long)]
670
672
pubdeadline:Option<u64>,
671
-
/// Number of processors/machines for FlowShopScheduling, JobShopScheduling, MultiprocessorScheduling, ResourceConstrainedScheduling, or SchedulingWithIndividualDeadlines
673
+
/// Number of processors/machines for FlowShopScheduling, JobShopScheduling, MultiprocessorScheduling, ResourceConstrainedScheduling, SchedulingToMinimizeWeightedCompletionTime, or SchedulingWithIndividualDeadlines
672
674
#[arg(long)]
673
675
pubnum_processors:Option<usize>,
674
676
/// Binary schedule patterns for StaffScheduling (semicolon-separated rows, e.g., "1,1,0;0,1,1")
@@ -919,7 +921,7 @@ mod tests {
919
921
));
920
922
assert!(
921
923
help.contains(
922
-
"Number of processors/machines for FlowShopScheduling, JobShopScheduling, MultiprocessorScheduling, ResourceConstrainedScheduling, or SchedulingWithIndividualDeadlines"
924
+
"Number of processors/machines for FlowShopScheduling, JobShopScheduling, MultiprocessorScheduling, ResourceConstrainedScheduling, SchedulingToMinimizeWeightedCompletionTime, or SchedulingWithIndividualDeadlines"
923
925
),
924
926
"create help should describe --num-processors for both scheduling models"
0 commit comments