📚 Operations Research · Computer Science · Mathematics

The World of
Scheduling Problems

From factory floors to microprocessors — how mathematics orders the chaos of competing tasks across limited resources in time.

Scroll to explore
Scheduling
Series
1
Part 1 The World of Scheduling Problems
2
Part 2 Scheduling with CP-SAT
3
Part 3 When Scheduling Meets Reality
4
Part 4 Scheduling in the Wild

Anatomy of a Scheduling Problem

Every scheduling problem — whether you're coordinating hospital surgeries or rendering a video game frame — has the same three components.

📋

Inputs (What you have)

  • Jobs / tasks to process
  • Machines / processors / workers
  • Processing times per job
  • Release dates (earliest a job can start)
  • Due dates and deadlines
  • Job priorities and weights
  • Precedence relationships
🔒

Constraints (What you must obey)

  • Each machine processes ≤ 1 job at a time
  • Job operations cannot overlap on a machine
  • Precedence must be respected
  • Preemption may or may not be allowed
  • Setup times between jobs
  • Resource capacity limits
  • Shift windows and availability
🎯

Objectives (What to optimise)

  • Makespan — finish everything as fast as possible
  • Total wait — reduce how long jobs spend in the system
  • Max lateness — don't let any job be badly overdue
  • Total tardiness — reduce overtime across all jobs
  • Late job count — minimize how many jobs miss deadlines
  • Weighted wait — prioritize high-value jobs finishing sooner
  • Multi-objective trade-offs

Every Problem Has Three Parts

In 1979, Ronald Graham showed that any scheduling problem — no matter how complex — can be described by just three things. Click each to see what varies.

🏭
Machine Setup
What resources do you have?
📋
Job Properties
What do the jobs look like?
🎯
What to Optimize
How do you measure success?

8 Scheduling Problem Families

Each family has a different machine environment — changing just one assumption can shift a problem from polynomial-time solvable to NP-hard.

🔧
Single Machine
Polynomial

One machine processes jobs one at a time. The simplest environment — but choosing the right sequence dramatically changes total wait time and tardiness, even when overall duration stays fixed.

Best for
Single-server queuesPrint spoolersDatabase queries
⚙️
Parallel Machines
NP-hard (2+ machines)

Multiple identical machines run in parallel. Assign each job to exactly one machine and sequence it. Equivalent to bin packing — minimize the heaviest bin. Even with 2 machines, this is NP-hard.

Best for
Cloud compute clustersMulti-core CPUsPrinting farms
🌊
Flow Shop
Polynomial (2 machines) / NP-hard

Think of a production line — every job visits each machine in the same fixed order (e.g. cut → paint → assemble). No job can skip ahead or take a different route. With just 2 machines, Johnson's (1954) algorithm finds the fastest possible schedule in seconds. With 3 or more machines, the problem becomes NP-hard.

Best for
Assembly linesSemiconductor fabsPipeline compilers
🏭
Job Shop
NP-hard (2+ machines)

Each job has its own unique routing through the machines. The most general and most studied scheduling model. Even with just 2 machines, finding the optimal schedule is NP-hard. This is the "benchmark" for metaheuristics.

Best for
Custom manufacturingHospital OR suitesCircuit board assembly
🔄
Open Shop
Polynomial (2 machines) / NP-hard

Operations can be done in any order — the scheduler has full routing flexibility. Surprisingly, with just 2 machines this is solvable in O(n log n) despite the freedom, via Gonzalez & Sahni's algorithm.

Best for
Medical tests (any order)Car service centersLab analysis workflows
📊
Project Scheduling
Polynomial via CPM

Tasks have precedence dependencies (A must finish before B can start). The Critical Path Method (CPM) finds the longest chain of dependent tasks — the minimum project duration. Slack reveals flexibility.

Best for
Construction projectsSoftware releasesFilm production
👥
Staff / Shift Scheduling
NP-hard

Assign workers to shifts to cover demand while respecting labor laws, preferences, and fairness. Unlike machine scheduling, workers are not identical and have complex availability constraints.

Best for
Nurse rosteringAirline crew pairingCall center staffing
💻
CPU Process Scheduling
Polynomial (preemptive)

Operating systems preemptively schedule processes. Allowing jobs to be paused and resumed changes the complexity landscape dramatically — many NP-hard problems become solvable in polynomial time.

Best for
OS task schedulingKubernetes podsReal-time systems

Objective Functions Explained

The same schedule can look "optimal" or "terrible" depending on what you measure. The same 5-job instance shows radically different orderings under each criterion.

Each job has a completion time, a due date, and possibly a priority weight. Lateness is how far past the deadline a job finishes. Tardiness counts only the late part (zero if on time). These metrics all measure schedule quality differently — optimizing one can easily worsen another.

Makespan
How long does the whole schedule take?
The time the last job finishes. Equivalent to minimizing the length of the entire schedule. Best for machine utilization and throughput. On a single machine, the total duration is the same regardless of order.
Good heuristic: Any order achieves minimum makespan on a single machine. On parallel machines, use the LPT (Longest Processing Time first) heuristic.
Total Wait
How long do jobs spend in the system overall?
Sum of all completion times — proportional to average time a job spends waiting. Minimized by SPT (Shortest Processing Time first). Every job that starts earlier benefits all jobs behind it.
Good heuristic: Sort by processing time, shortest first (SPT rule). Proven optimal for a single machine. Intuition: short jobs unblock the queue faster.
Max Lateness
How badly does the worst job miss its deadline?
The worst-case deviation from any due date — a single very late job dominates. Minimized by EDD (Earliest Due Date first) on a single machine — Jackson's rule, proven optimal.
Good heuristic: Sort by due date, earliest first (EDD / Jackson's Rule). Minimizes the single biggest overrun across all jobs.
Total Tardiness
How much overtime do all jobs accumulate?
Sum of how late each job is — zero for on-time jobs, positive for late ones. Unlike max lateness, it counts all late jobs, not just the worst. NP-hard even on a single machine.
Good heuristic: No simple sorting rule exists — use dynamic programming or branch & bound for exact results. The ATC heuristic works well in practice.
Late Job Count
How many jobs miss their deadline at all?
A binary measure — each job is either on time or late, regardless of how late. Useful when the penalty is all-or-nothing. Moore's algorithm solves this in O(n log n) on a single machine.
Good heuristic: Moore's algorithm — sequence by due date, and whenever a job would be late, drop the longest job seen so far from the on-time set.
Weighted Wait
What if some jobs matter more than others?
Each job has a priority weight. High-priority, short jobs should run first. The Weighted SPT rule (WSPT) sorts by processing time divided by weight, ascending — provably optimal for a single machine.
Good heuristic: Smith's Rule — sort by (processing time ÷ weight), lowest first. A high-priority short job always displaces a low-priority long one.

Deeper Concepts Worth Knowing

Beyond the classic problem types, these concepts define the frontier of modern scheduling research and practice.

⚡ Online vs Offline Algorithm Design

In offline scheduling, all jobs are known in advance. In online scheduling, jobs arrive over time and decisions must be made without future knowledge. Online algorithms are evaluated by their competitive ratio — worst-case performance versus the optimal offline solution. The classic result: no online algorithm for identical parallel machines can guarantee better than a 4/3 ratio. Ride-hailing dispatch is a textbook online problem: ride requests arrive in real time, drivers are the machines, and each assignment must be made immediately with no knowledge of future demand.

✂️ Preemptive vs Non-preemptive Key Distinction

Allowing preemption — stopping a job mid-execution and resuming later — fundamentally changes problem complexity. The weighted completion time problem, for instance, becomes solvable in polynomial time with preemption, but is NP-hard without it. Preemption is natural in OS scheduling but costly (context switches) in manufacturing.

🎲 Stochastic Scheduling Uncertainty

Real processing times are random. Stochastic scheduling replaces fixed durations with probability distributions. A key result: for exponentially distributed processing times, SEPT (Shortest Expected Processing Time) minimizes expected total wait — the same structural insight as deterministic SPT, but now in expectation.

🔗 The Makespan-Tardiness Trade-off Multi-objective

Finishing everything fast and hitting every deadline pull in opposite directions. The Pareto frontier — the set of non-dominated schedules — must be explicitly computed. Modern schedulers use weighted objectives or constraint methods to navigate this trade-off systematically.

🧩 MIP vs Constraint Programming Formulation

Scheduling problems can be modeled as Mixed-Integer Programs (MIPs) — time-indexed, disjunctive, or position-based formulations each offer different trade-offs. But in practice, Constraint Programming (CP) consistently outperforms MIP on scheduling: CP's global constraints (like no-overlap and cumulative) match scheduling structure directly, enabling far tighter propagation. The choice of formulation alone can affect solve time by orders of magnitude.

🔬 The Critical Ratio (CR) Dynamic Rule

A dynamic dispatching rule: Critical Ratio = (time remaining until deadline) ÷ (remaining processing time). A ratio below 1 means the job is already at risk. Unlike SPT or EDD, it updates as the clock advances. The Apparent Tardiness Cost (ATC) rule builds on this idea and is one of the best-performing single-pass heuristics known.

Where Scheduling Lives

Every domain with limited resources and competing demands has a scheduling problem hiding inside it.

✈️

Airline Operations

Gate assignment, crew pairing, aircraft rotation, maintenance windows — airlines solve millions of scheduling variables daily. Delay propagation makes this a stochastic, online problem.

Job Shop · Multi-objective
🏥

Hospital Operating Rooms

Sequence surgeries across multiple ORs, accounting for surgeon availability, equipment sterilization, patient recovery rooms, and emergency preemptions.

Job Shop · Precedence · Deadlines
🤖

Robotic Semiconductor Fabs

Wafers flow through hundreds of processing steps. Re-entrant flow (visiting same machine multiple times), wet clean time windows, and cassette lot scheduling push the frontier of scheduling theory.

Flow Shop · Re-entrant
☁️

Cloud Job Scheduling

Kubernetes, AWS Batch, and cloud schedulers pack containerized workloads onto heterogeneous machines. Bin-packing heuristics, priority queues, and gang scheduling for distributed ML jobs.

Parallel Machines · Weighted Wait
🚛

Last-Mile Delivery

Vehicle routing with time windows (VRPTW) is scheduling over space and time simultaneously. Each delivery has a time window; the "machine" (vehicle) must visit jobs in a spatial sequence.

Parallel · Time Windows · Tardiness
📺

Video Rendering Pipelines

GPU render farms schedule frames and shader passes with complex dependencies. Critical path determines minimum render time; resource leveling balances VRAM usage.

Project Scheduling · Critical Path
🏗️

Construction Projects

Activity networks with resource constraints (RCPSP). Crashing analysis lets you trade cost for time by adding resources to critical-path activities. Classic CPM + resource leveling.

Project Scheduling · Resources
🧬

Gene Sequencing Labs

Sequencers process DNA samples — open shop characteristics since many tests are order-independent. Batching compatible samples reduces setup and reagent cost.

Open Shop · Batching
🎓

University Timetabling

Assign courses to rooms and timeslots, satisfying hard constraints (no conflicts) and soft constraints (student preferences, lecturer availability). A classic graph coloring problem.

Parallel Machines · Multi-objective

Tools & Libraries for Scheduling

A mix of constraint solvers, simulation frameworks, and scheduling-focused libraries commonly applied to scheduling problems. They vary widely in scope — some are general-purpose, others are narrower.

ℹ️ The tools below are a small selection of open source options. The broader ecosystem — including commercial solvers, cloud platforms, and domain-specific tools — is much larger.
Google OR-Tools CP-SAT
Open SourcePython

Google's constraint programming solver with first-class scheduling primitives — interval variables, no-overlap constraints, and cumulative resources. The most widely used open-source scheduler in production today.

Best for
Job shopFlow shopResource-constrained schedulingVehicle routing
Timefold formerly OptaPlanner
Open SourcePython / Java

Purpose-built constraint satisfaction engine for planning and scheduling problems. Declarative model: define constraints and let the solver find feasible, optimized schedules. The dominant tool for employee and shift scheduling in enterprise.

Best for
Nurse rosteringShift schedulingCrew pairingTimetabling
SimPy
Open SourcePython

Discrete-event simulation framework. Not an optimizer — a simulator. Use it to model a scheduling environment, test heuristic policies, and measure performance before committing to an optimization formulation. Essential for stochastic scheduling.

Best for
Stochastic schedulingPolicy evaluationQueueing systemsWhat-if analysis
PyJobShop pyjobshop.org
Open SourcePython

Python library dedicated specifically to machine scheduling problems. Models single machine, parallel machine, flow shop, job shop, open shop, and flexible job shop problems with a clean, unified API. Solves via CP-SAT under the hood. Designed to make the gap between theory and code as small as possible.

Best for
Job shopFlow shopOpen shopLearning & researchBenchmarking

Reference Material

For those who want to go deeper — the complexity landscape across problem types and the foundational papers behind this field.

Complexity Table — Polynomial vs NP-hard10 environments × 6 objectives

Small changes in problem structure — adding one constraint, changing the objective — can flip a problem from easy to intractable.

Environment Makespan Total Wait Max Lateness Total Tardiness Late Job Count Weighted Wait
Single machinePolynomialPolynomialPolynomialNP-hardPolynomialPolynomial
Single machine + release datesNP-hardNP-hardPolynomialNP-hardNP-hardNP-hard
Single machine + preemptionPolynomialPolynomialPolynomialPolynomialPolynomialNP-hard
2 identical parallel machinesNP-hardPolynomialNP-hardNP-hardNP-hardNP-hard
Parallel machines + preemptionPolynomialPolynomialPolynomialPolynomialPolynomialNP-hard
2-machine flow shopPolynomialNP-hardNP-hardNP-hardNP-hardNP-hard
3-machine flow shopNP-hardNP-hardNP-hardNP-hardNP-hardNP-hard
2-machine job shopNP-hardNP-hardNP-hardNP-hardNP-hardNP-hard
2-machine open shopPolynomialNP-hardNP-hardNP-hardNP-hardNP-hard
Single machine + precedencePolynomialNP-hardNP-hardNP-hardNP-hardNP-hard

Source: Pinedo, M. (2016). Scheduling: Theory, Algorithms, and Systems. 5th ed. Springer. · Complexity results as of 2024.

Foundational Papers & Books6 references

📘 Pinedo, M. (2022)

Scheduling: Theory, Algorithms, and Systems. 6th ed. Springer.
The definitive modern textbook — now in its sixth edition. Covers all problem types, complexity results, practical heuristics, and new topics including stochastic parallel machine scheduling and online scheduling. The primary reference for the complexity table on this page. Earlier editions from 1995 onward.

📘 Pinedo, M. (2016)

Planning and Scheduling in Manufacturing and Services. 2nd ed. Springer.
Companion volume focused on applied scheduling — covers job shop, flexible assembly, lot scheduling, supply chains, workforce scheduling, and transportation. Each chapter includes a real-world case study or system implementation.

📗 Graham, Lawler, Lenstra & Rinnooy Kan (1979)

Optimization and Approximation in Deterministic Sequencing and Scheduling: A Survey. Annals of Discrete Mathematics, Vol. 5, pp. 287–326.
The paper that introduced the three-field notation framework used universally to describe scheduling problems today.

📙 Lawler, Lenstra, Rinnooy Kan & Shmoys (1993)

Sequencing and Scheduling: Algorithms and Complexity. Chapter 9 in Handbooks in Operations Research and Management Science, Vol. 4, pp. 445–522. North-Holland.
A comprehensive survey chapter covering exact algorithms, NP-hardness proofs, and the landscape of polynomial-time special cases.

📕 Brucker, P. (2007)

Scheduling Algorithms. 5th ed. Springer.
Algorithm-focused companion to Pinedo. Strong on exact methods, branch-and-bound, and complexity for machine scheduling variants.

📓 Johnson, S.M. (1954)

Optimal Two- and Three-Stage Production Schedules with Setup Times Included. Naval Research Logistics Quarterly.
The original paper solving the 2-machine flow shop problem in O(n log n) — widely regarded as the founding result of modern scheduling theory.

📒 Moore, J.M. (1968)

An n Job, One Machine Sequencing Algorithm for Minimizing the Number of Late Jobs. Management Science.
A deceptively simple O(n log n) algorithm for minimizing the count of late jobs on one machine — an elegant and often-overlooked result.

Thanks to Cemalettin Ozturk for pointing to Pinedo's work.

Part 2 of 4 · Continue Reading

Scheduling with CP-SAT

Now that you know the problem types — learn how to model and solve them in Python. A hands-on tutorial covering single machine through RCPSP, with working code and animated Gantt charts throughout.

Read: Scheduling with CP-SAT
Scheduling
Series
1
Part 1 The World of Scheduling Problems
2
Part 2 Scheduling with CP-SAT
3
Part 3 When Scheduling Meets Reality
4
Part 4 Scheduling in the Wild