Skip to content

[Model] SequencingToMinimizeTardyTaskWeight #496

@isPANN

Description

@isPANN

Important

Build as optimization, not decision. Value = Min<u64>.
Objective: Minimize total weight of tardy tasks Σ wᵢ·Uᵢ.
Do not add a bound/threshold field — let the solver find the optimum directly. See #765.

Motivation

SEQUENCING TO MINIMIZE TARDY TASK WEIGHT (P187) from Garey & Johnson, A5 SS3. A single-machine scheduling problem: given n tasks with processing times, weights, and deadlines, find a schedule that minimizes the total weight of tardy tasks (those finishing after their deadline). This is the weighted generalization of Moore's tardy-tasks problem and is NP-hard by reduction from PARTITION (Karp, 1972). When all tasks share a common deadline, the problem reduces to the KNAPSACK problem. It admits a pseudo-polynomial-time algorithm (Lawler & Moore, 1969) and is thus only weakly NP-hard. No precedence constraints appear in this formulation.

Associated rules:

  • R133: Partition → SequencingToMinimizeTardyTaskWeight (as target)
  • Direct ILP: SequencingToMinimizeTardyTaskWeight → ILP

Definition

Name: SequencingToMinimizeTardyTaskWeight
Reference: Garey & Johnson, Computers and Intractability, A5 SS3

Mathematical definition:

INSTANCE: Set T of n tasks, for each task t ∈ T a processing time l(t) ∈ Z⁺, a weight w(t) ∈ Z⁺, and a deadline d(t) ∈ Z⁺.

OBJECTIVE: Find a one-processor schedule σ (a permutation of T) that minimizes

Σ_{t ∈ T : σ(t) + l(t) > d(t)} w(t)

where σ(t) is the start time of task t. A task t is tardy if it finishes after its deadline: σ(t) + l(t) > d(t).

The corresponding decision problem (GJ SS3) asks whether a schedule exists with total tardy weight ≤ K for a given bound K ∈ Z⁺.

Variables

  • Count: n = |T|. The configuration is a permutation of the n tasks (a scheduling order).
  • Per-variable domain: n (each position in the schedule selects a task index 0..n−1)
  • Meaning: config[i] = j means task j is scheduled in position i. The schedule is processed left-to-right: the start time of the task in position i equals the sum of processing times of tasks in positions 0..i−1. A configuration is valid if it is a permutation (each task appears exactly once). The evaluate function computes the total weight of tardy tasks.

dims() returns [n; n] (permutation encoding).

Note: Not all configurations in the search space are valid permutations. The evaluate() function returns Min(u64::MAX) for invalid (non-permutation) configurations. The brute-force solver searches all n^n configurations but only n! are valid permutations.

Schema (data type)

Type name: SequencingToMinimizeTardyTaskWeight
Variants: none (no type parameters)

Field Type Description Getter
lengths Vec<u64> Processing time l(t) for each task t num_tasks()self.lengths.len()
weights Vec<u64> Weight w(t) for each task t
deadlines Vec<u64> Deadline d(t) for each task t

Problem type: Optimization (minimization)
Value type: Min<u64>

Complexity

  • Decision complexity: NP-complete (Karp, 1972; transformation from PARTITION). Weakly NP-hard.
  • Best known exact algorithm: Pseudo-polynomial dynamic programming by Lawler & Moore (1969) in O(n · P) time, where n = |T| and P = Σ l(t) is the total processing time. For the unweighted case (all w(t) = 1), Moore's algorithm gives an O(n log n) greedy solution. For the weighted case with "agreeable" weights (w(t) < w(t') implies l(t) ≥ l(t')), Lawler (1976) gives a polynomial algorithm.
  • Complexity string for declare_variants!: "factorial(num_tasks)" (brute-force over all permutations; the pseudo-polynomial DP depends on numeric values, not combinatorial size)
  • Parameterized complexity: W[1]-hard parameterized by the number of tardy tasks (Heeger & Hermelin, 2024, ESA 2024), ruling out FPT algorithms under standard assumptions.
  • References:
    • [Karp, 1972] R. M. Karp, "Reducibility among combinatorial problems", 1972.
    • [Lawler & Moore, 1969] E. L. Lawler and J. M. Moore, "A functional equation and its application to resource allocation and sequencing problems", Management Science, 16(1), 1969.
    • [Lawler, 1976] E. L. Lawler, "Sequencing to minimize the weighted number of tardy jobs", RAIRO, 1976.
    • [Heeger & Hermelin, 2024] K. Heeger and D. Hermelin, "Minimizing tardy processing time on a single machine in near-linear time", ESA 2024. arXiv:2401.01740.

Extra Remark

Full book text:

INSTANCE: Set T of tasks, for each task t in T a length l(t) in Z+, a weight w(t) in Z+, and a deadline d(t) in Z+, and a positive integer K.
QUESTION: Is there a one-processor schedule sigma for T such that the sum of w(t), taken over all t in T for which sigma(t) + l(t) > d(t), does not exceed K?

Reference: [Karp, 1972]. Transformation from PARTITION.

Comment: Can be solved in pseudo-polynomial time (time polynomial in |T| and sum l(t)) [Lawler and Moore, 1969]. Can be solved in polynomial time if weights are "agreeable" (i.e., w(t) < w(t') implies l(t) >= l(t')) [Lawler, 1976c].

Note: The original GJ formulation is a decision problem with bound K. This issue reformulates it as an optimization problem (minimize total tardy weight). The decision version is recovered by checking whether the optimal value ≤ K.

How to solve

  • It can be solved by (existing) bruteforce. Enumerate all n! permutations; for each compute start times and total tardy weight; return the minimum.
  • It can be solved by reducing to integer programming. Binary ILP with ordering variables x_{ij} (task i in position j), start time variables, tardiness indicators U_t, minimize Σ w_t · U_t.
  • Other: Lawler-Moore pseudo-polynomial DP in O(n · Σ l(t)) time.

Example Instance

Input:
T = {t₁, t₂, t₃, t₄, t₅} (n = 5 tasks)
Lengths: l(t₁) = 3, l(t₂) = 2, l(t₃) = 4, l(t₄) = 1, l(t₅) = 2
Weights: w(t₁) = 5, w(t₂) = 3, w(t₃) = 7, w(t₄) = 2, w(t₅) = 4
Deadlines: d(t₁) = 6, d(t₂) = 4, d(t₃) = 10, d(t₄) = 2, d(t₅) = 8

Total processing time = 3 + 2 + 4 + 1 + 2 = 12.

Optimal schedule:
σ: t₄, t₁, t₅, t₃, t₂

Task Start Finish Deadline Tardy? Weight
t₄ 0 1 2 No
t₁ 1 4 6 No
t₅ 4 6 8 No
t₃ 6 10 10 No
t₂ 10 12 4 Yes 3

Total tardy weight = 3. Only t₂ (weight 3) is tardy.

Suboptimal feasible solutions (confirming optimality):

  1. σ = (t₄, t₂, t₁, t₃, t₅): t₅ tardy (finish 12 > deadline 8), tardy weight = 4
  2. σ = (t₁, t₄, t₅, t₃, t₂): t₂ tardy (weight 3) + t₄ tardy (finish 4 > deadline 2, weight 2), tardy weight = 5
  3. σ = (t₄, t₂, t₁, t₅, t₃): t₃ tardy (finish 12 > deadline 10), tardy weight = 7
  4. σ = (t₁, t₂, t₃, t₄, t₅): t₄ tardy + t₅ tardy, tardy weight = 9

Expected outcome: Min(3)

Reduction Rule Crossref

  • R133: Partition → SequencingToMinimizeTardyTaskWeight
  • Direct ILP: SequencingToMinimizeTardyTaskWeight → ILP (binary ordering + tardiness indicator formulation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.modelA model problem to be implemented.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions