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
Today's problem comes from the Scheduling category. Previous topics: Graph Coloring, Bin Packing, Nurse Rostering, TSP.
Problem Statement
You have njobs and mmachines. Each job consists of a sequence of operations that must be processed in a fixed order, each on a specific machine. No two operations can run on the same machine at the same time, and a job's operations must execute one after another (no overlap within a job).
Goal: Find a start time for every operation to minimize the makespan β the time at which the last operation finishes.
Small concrete instance (3 jobs Γ 3 machines)
Job
Op 1 (machine, duration)
Op 2
Op 3
J1
M1, 3
M2, 2
M3, 2
J2
M1, 2
M3, 1
M2, 4
J3
M2, 4
M1, 1
M3, 3
Input: For each job j and operation index k: the machine ΞΌ(j,k) and processing time p(j,k). Output: Start times s(j,k) β₯ 0 minimising Cmax = max_{j,k} (s(j,k) + p(j,k)).
Why It Matters
Manufacturing floors: Sequencing parts through CNC machines, welders, and paint booths is a daily job-shop problem at scale.
Cloud computing: Allocating CPU-bound tasks across heterogeneous cores with data-locality constraints maps directly to flexible job-shop variants.
Semiconductor fabrication: Wafer processing involves hundreds of steps across specialised tools β even small makespan improvements translate to significant yield gains.
Modeling Approaches
Approach 1 β Constraint Programming (CP)
Decision variables s(j,k) β [0, UB] β start time of operation (j,k), where UB is a loose upper bound (e.g., sum of all durations).
Constraints
// Precedence within each job
β j, k < last: s(j,k) + p(j,k) β€ s(j,k+1)
// Non-overlap on each machine (disjunctive resource)
β machine M, β (j,k) β (j',k') with ΞΌ(j,k)=ΞΌ(j',k')=M:
s(j,k) + p(j,k) β€ s(j',k') OR s(j',k') + p(j',k') β€ s(j,k)
// Makespan definition
Cmax β₯ s(j,k) + p(j,k) β j, k
```
The non-overlap constraints are best expressed as a **`no_overlap`** global constraint (or `cumulative` with capacity 1), enabling powerful **Edge-Finding** and **Not-First/Not-Last** propagation.
**Trade-offs**: Extremely expressive; global constraints make propagation very strong; excellent on tight instances. Search can be expensive on large, loosely-constrained problems.
---
#### Approach 2 β Mixed Integer Programming (MIP)
Introduce binary variable `y(j,k,j',k') β {0,1}` β equals 1 if `(j,k)` is scheduled before `(j',k')` on the same machine.
**Key constraints**
```
// Precedence within jobs (same as CP)
s(j,k+1) β₯ s(j,k) + p(j,k)
// Disjunctive sequencing (big-M formulation)
s(j,k) + p(j,k) β€ s(j',k') + MΒ·(1 - y(j,k,j',k'))
s(j',k') + p(j',k') β€ s(j,k) + MΒ·y(j,k,j',k')
// Makespan
Cmax β₯ s(j,k) + p(j,k)
with M = UB (a sufficiently large constant).
Trade-offs: Standard MIP solvers (Gurobi, CPLEX) apply LP relaxations and branch-and-bound automatically. The big-M weakens LP bounds; tightening with time-indexed or positional formulations improves this at the cost of more variables.
Given a set of tasks on a machine, Edge-Finding deduces that if a task t cannot fit between any subset S of other tasks and the end of the schedule, then t must be scheduled after all of S. This tightens lower bounds on start times far beyond simple pairwise reasoning.
2. Symmetry Breaking & Dominance Rules
When two operations on the same machine have no ordering constraint between them, we can fix their relative order without loss of generality (e.g., shorter first when durations are equal). More generally, active schedules β where no operation can be started earlier without delaying another β always contain an optimal solution, reducing the search space dramatically.
3. Branch-and-Bound with Shifting Bottleneck Decomposition
The Shifting Bottleneck heuristic solves a single-machine subproblem (1|r_j|L_max) for each machine in turn, treating already-scheduled machines as release-time constraints. This produces very good primal solutions quickly and is used as an upper-bound oracle inside B&B.
Challenge Corner
Think about this: The classic job-shop assumes each job visits each machine at most once. In the Flexible Job-Shop variant, each operation can be processed on any machine from a given set (with possibly different durations). How would you extend the CP model above to handle this? What new global constraints or symmetry-breaking strategies become available?
Bonus: For the 3-job Γ 3-machine instance above, what is the optimal makespan? Can you prove it via a lower-bounding argument without running a solver?
References
Pinedo, M. L. β Scheduling: Theory, Algorithms, and Systems (5th ed., Springer, 2016). The definitive textbook for scheduling problems.
Applegate, D. & Cook, W. β "A Computational Study of the Job-Shop Scheduling Problem", INFORMS Journal on Computing, 1991. Classic B&B baseline with benchmark instances.
VilΓm, P. β "Edge Finding Filtering Algorithm for Discrete Cumulative Resources in O(kn log n)", CP 2009. The paper behind modern CP propagation for scheduling.
Google OR-Tools CP-SAT documentation β [developers.google.com/optimization/scheduling/job_shop]((developers.google.com/redacted) Hands-on solver tutorial for this exact problem.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Today's problem comes from the Scheduling category. Previous topics: Graph Coloring, Bin Packing, Nurse Rostering, TSP.
Problem Statement
You have
njobs andmmachines. Each job consists of a sequence of operations that must be processed in a fixed order, each on a specific machine. No two operations can run on the same machine at the same time, and a job's operations must execute one after another (no overlap within a job).Goal: Find a start time for every operation to minimize the makespan β the time at which the last operation finishes.
Small concrete instance (3 jobs Γ 3 machines)
Input: For each job
jand operation indexk: the machineΞΌ(j,k)and processing timep(j,k).Output: Start times
s(j,k) β₯ 0minimisingCmax = max_{j,k} (s(j,k) + p(j,k)).Why It Matters
Modeling Approaches
Approach 1 β Constraint Programming (CP)
Decision variables
s(j,k) β [0, UB]β start time of operation(j,k), whereUBis a loose upper bound (e.g., sum of all durations).Constraints
with
M = UB(a sufficiently large constant).Trade-offs: Standard MIP solvers (Gurobi, CPLEX) apply LP relaxations and branch-and-bound automatically. The big-M weakens LP bounds; tightening with time-indexed or positional formulations improves this at the cost of more variables.
Example Model (OR-Tools CP-SAT, Python)
Key Techniques
1. Edge-Finding Propagation
Given a set of tasks on a machine, Edge-Finding deduces that if a task
tcannot fit between any subsetSof other tasks and the end of the schedule, thentmust be scheduled after all ofS. This tightens lower bounds on start times far beyond simple pairwise reasoning.2. Symmetry Breaking & Dominance Rules
When two operations on the same machine have no ordering constraint between them, we can fix their relative order without loss of generality (e.g., shorter first when durations are equal). More generally, active schedules β where no operation can be started earlier without delaying another β always contain an optimal solution, reducing the search space dramatically.
3. Branch-and-Bound with Shifting Bottleneck Decomposition
The Shifting Bottleneck heuristic solves a single-machine subproblem (1|r_j|L_max) for each machine in turn, treating already-scheduled machines as release-time constraints. This produces very good primal solutions quickly and is used as an upper-bound oracle inside B&B.
Challenge Corner
Bonus: For the 3-job Γ 3-machine instance above, what is the optimal makespan? Can you prove it via a lower-bounding argument without running a solver?
References
Beta Was this translation helpful? Give feedback.
All reactions