The order of jobs can determine how long a factory spends changing products rather than making them. The loss may not appear in the processing times at all. Changing tools, cleaning equipment, bringing a line to temperature or switching between material types can consume significant time, and the amount often depends on what ran immediately before. This is why production scheduling is not always a matter of putting the most urgent job first.

Consider a single machine with four jobs, A through D. For this example, assume all jobs are available at the start, none can be interrupted, and no due dates or additional resources affect the order. Their processing times are 20, 30, 25 and 15 minutes respectively. Whatever the sequence, processing therefore takes 90 minutes. But changing from one job to another adds setup time, and those changes are not symmetric: changing A to B may be different from changing B to A.

A tiny example with a real decision

The following invented setup-time matrix, in minutes, illustrates the effect. N/A on the diagonal means there is no transition to measure. We assume the machine is initially ready for the first job, so initial setup is zero.

The same jobs can consume different amounts of machine time, even when their processing times never change.
From → ToABCD
AN/A296
B7N/A89
C48N/A2
D356N/A

For the order A → B → C → D, changeovers take 2 + 8 + 2 = 12 minutes. The final completion time is therefore 90 + 12 = 102 minutes. For A → C → B → D, changeovers take 9 + 8 + 9 = 26 minutes, so the same amount of work finishes in 116 minutes. The difference comes entirely from the sequence.

This is the essence of sequence-dependent setup scheduling: the cost of a job depends partly on its predecessor. With more jobs, one can search for a low-setup route through the tasks, but real operations introduce further requirements that complicate the picture.

In those cases, completion time, lateness, setup costs and delivery performance cannot be treated as interchangeable objectives.

Model the total, not just the work

For a no-idle, single-machine schedule in which all jobs must be completed, makespan equals total processing time plus setup time for each adjacent pair (under our initial-ready assumption). The decision is the permutation of jobs. A simple objective is to minimize the sum of setup times along that permutation. This is closely related to a shortest Hamiltonian-path style problem on a directed, weighted graph, which helps explain why sequence matters even when individual job durations do not.

The model changes if tasks have release times, deadlines, priorities, cleaning windows or sequence-dependent eligibility. A sequence that minimizes setup time might miss an urgent order. Another might require keeping a machine idle until material arrives. In those cases, completion time, lateness, setup costs and delivery performance cannot be treated as interchangeable objectives. The planner must decide which are mandatory rules and which represent tradeoffs.

Check a small example yourself

For four jobs, exhaustive enumeration is perfectly reasonable. The Python example below verifies the setup totals and finds a minimum-setup sequence for this illustrative matrix. It does not claim to solve industrial-scale scheduling problems.

When adapting the example to a real line, the first step is not choosing a sophisticated solver.
from itertools import permutations

jobs = ("A", "B", "C", "D")
processing = {"A": 20, "B": 30, "C": 25, "D": 15}
setup = {
    "A": {"B": 2, "C": 9, "D": 6},
    "B": {"A": 7, "C": 8, "D": 9},
    "C": {"A": 4, "B": 8, "D": 2},
    "D": {"A": 3, "B": 5, "C": 6},
}

def schedule_minutes(order):
    process_time = sum(processing[j] for j in order)
    changeover_time = sum(
        setup[left][right]
        for left, right in zip(order, order[1:])
    )
    return process_time + changeover_time

assert schedule_minutes(("A", "B", "C", "D")) == 102
assert schedule_minutes(("A", "C", "B", "D")) == 116
best = min(permutations(jobs), key=schedule_minutes)
print(best, schedule_minutes(best))

When adapting the example to a real line, the first step is not choosing a sophisticated solver. It is checking the setup data. Does the table represent elapsed time, operator labor, line downtime or some combination? Does cleaning happen on the machine or in parallel? Are setups permitted before material arrives? The answers determine whether a plausible-looking schedule represents an executable one.

When the factory refuses to behave like a toy example

Many production environments have several machines, some capable of only certain operations. Jobs may require multiple stages in sequence, a shared maintenance crew, a limited tool or a batch that should stay together. Setup times can depend on product family, contamination rules or the precise history of previous jobs. A good model should describe the operational constraints that matter, while avoiding irrelevant detail that makes planning harder without improving decisions.

It is also useful to distinguish optimization from execution. An algorithm may suggest a low-changeover sequence, while the planner retains discretion to respond to urgent requests, missing materials and equipment condition. In such settings, the goal is often not a timeless perfect schedule but a plan that is good now, explainable and cheap enough to update when conditions change.