Skip to the content

Topics Covered

Sequencing Assumptions n × 2 machines Johnson's Algorithm n × 3 machines n × m machines Total Elapsed Time Idle Time
On this page
  1. 1. The Sequencing Problem
  2. 2. Assumptions of Sequencing Problems
  3. 3. n Jobs on 2 Machines — Johnson's Algorithm
  4. 4. n Jobs on 3 Machines
  5. 5. n Jobs on m Machines (General Case)
  6. 6. Computing Idle Time
  7. 7. Two Jobs on m Machines (Graphical Method)
  8. Key Take-aways

1. The Sequencing Problem

DEFINITION

A sequencing problem deals with finding the optimum order in which a number of jobs (tasks) should be processed on a number of machines (resources), so as to minimise a chosen criterion — usually the total elapsed time required to complete all jobs.

Real-Life Applications

2. Assumptions of Sequencing Problems

  1. The processing times of each job on each machine are known and constant.
  2. Each machine can process only one job at a time.
  3. No machine can process more than one job simultaneously; no job is processed on more than one machine simultaneously.
  4. The order in which jobs visit the machines is identical for all jobs (the same routing).
  5. Once started, a job is processed without preemption (no interruptions).
  6. The time taken to move a job from one machine to another is negligible.
  7. All jobs are independent and available at time 0.

Notation

Let \(t_{ij}\) = processing time of job \(j\) on machine \(i\) (or, equivalently, machine \(M_i\)).

The objective is to find the sequence (permutation of jobs) that minimises the makespan — time from start of the first job on the first machine until the last job finishes on the last machine.

3. n Jobs on 2 Machines — Johnson's Algorithm

Each job must be processed first on machine M₁ then on M₂. Let \(t_{1j}\) and \(t_{2j}\) be the processing times of job \(j\) on M₁ and M₂.

Johnson's Algorithm

  1. List all jobs with their times on M₁ and M₂.
  2. Find the smallest processing time across all \(t_{1j}\) and \(t_{2j}\) (the entire table).
  3. If the minimum is on M₁ (a \(t_{1j}\) value), schedule that job as early as possible (next available position at the start).
  4. If the minimum is on M₂ (a \(t_{2j}\) value), schedule that job as late as possible (next available position at the end).
  5. Remove the scheduled job from the list and repeat with the reduced list.
  6. If a tie occurs (the minimum appears multiple times), break it arbitrarily; both choices yield optimum.

After all jobs are placed in the sequence, compute the schedule:

Computing Total Elapsed Time

For each job in sequence position \(k\):

Total elapsed time = M₂ finish time of the last job.

Idle time on M₂ = M₂ start time of first job + sum of gaps between M₂ activities.

Idle time on M₁ = Total elapsed time − (sum of M₁ processing times).

EXAMPLE 1 — Five Jobs on 2 Machines

Times:

JobM₁M₂
A52
B16
C97
D38
E104

Smallest = 1 (job B, on M₁) → schedule B first. Sequence so far: B __ __ __ __.

From remaining {A, C, D, E}, smallest is 2 (job A, on M₂) → schedule A last. Sequence: B __ __ __ A.

From {C, D, E}, smallest is 3 (job D, on M₁) → schedule D next from start. Sequence: B D __ __ A.

From {C, E}, smallest is 4 (job E, on M₂) → schedule E next from end. Sequence: B D __ E A.

Only C left → fills middle. Final sequence: B D C E A.

Schedule:

JobM₁ inM₁ outM₂ inM₂ out
B0117
D14715
C4131522
E13232327
A23282830

Total elapsed time = 30 hours.

Idle time on M₂ = 1 (initial) + 0 + 0 + 1 + 1 = 3 hours.

Idle time on M₁ = 30 − (5+1+9+3+10) = 30 − 28 = 2 hours.

Gantt chart — sequence B → D → C → E → A M₁ M₂ BDCEA BDCEA idle 0510 15202530 Time (hours) →
Fig 3.1 — Gantt chart of the optimal sequence. Each colour is one job; a job's M₂ bar can only start after both its own M₁ bar and the previous job's M₂ bar finish. The whole schedule ends at 30 hours, with the grey gaps showing M₂ idle time (3 h in total, 2 h on M₁).
EXAMPLE 2 — 4 Jobs

Times:

JobM₁M₂
145
296
382
463

Smallest = 2 (job 3, on M₂) → schedule 3 last. Sequence: __ __ __ 3.

Next smallest = 3 (job 4, on M₂) → schedule 4 second-last. Sequence: __ __ 4 3.

Next = 4 (job 1, on M₁) → schedule 1 first. Sequence: 1 __ 4 3.

Only job 2 left → middle. Final: 1 2 4 3.

Compute total elapsed time (left as exercise) ≈ 29.

4. n Jobs on 3 Machines

Each job goes through M₁ → M₂ → M₃. Let \(t_{1j}, t_{2j}, t_{3j}\) be the times.

Special Case — Reducible to 2 Machines

Johnson's procedure can be applied directly to a 3-machine problem provided at least one of the following holds:

If either condition holds, define two "pseudo-machines":

\[ G_j \;=\; t_{1j} + t_{2j}, \quad H_j \;=\; t_{2j} + t_{3j}. \]

Apply Johnson's algorithm to \(G_j\) vs \(H_j\) (as if it were a 2-machine problem). The resulting sequence is optimal for the original 3-machine problem.

If Neither Condition Holds

The algorithm gives a near-optimum but not guaranteed optimum. Heuristic methods or exact branch-and-bound is needed for guarantee.

Computing Total Time

Same as 2-machine case but with one extra column. For each job in sequence:

EXAMPLE 1 — Three machines, four jobs

Times:

JobM₁M₂M₃
A854
B1069
C628
D736

Check: min(\(t_{1j}\)) = 6, max(\(t_{2j}\)) = 6 — condition (min M₁ ≥ max M₂) holds with equality ⇒ Johnson applies.

Pseudo-machines:

JobG = M₁+M₂H = M₂+M₃
A139
B1615
C810
D109

Apply Johnson on G, H. Smallest = 8 (job C, G) → C first. Next 9 (job A and D, H) → A or D last (tie). Pick D last; then A second-last; B remains middle.

Sequence: C B A D.

Compute total elapsed time by following the three-machine schedule.

EXAMPLE 2

If max(M₂) is moderate but min(M₃) is large, the second condition often holds. For example, M₁ = 5, 4, 3; M₂ = 2, 1, 3; M₃ = 7, 8, 6. max(M₂) = 3; min(M₃) = 6 ≥ 3 ✓. Apply Johnson on (M₁+M₂, M₂+M₃).

5. n Jobs on m Machines (General Case)

For \(m \ge 3\) machines, the general problem of minimising the total elapsed time is NP-hard: no algorithm is known that is guaranteed to find the optimum in polynomial time. Johnson's reduction in Section 4 covers only the special three-machine case in which the middle machine is dominated.

Heuristic Extension of Johnson's Algorithm

If for all \(j = 2, 3, \ldots, m - 1\): min(\(t_{1j}\)) ≥ max(\(t_{kj}\)) for \(k = 2, \ldots, m - 1\), OR similarly for the last machine, then we can reduce by:

\[ G_j \;=\; \sum_{i=1}^{m-1} t_{ij}, \quad H_j \;=\; \sum_{i=2}^{m} t_{ij}, \]

and apply Johnson's 2-machine algorithm on (G, H).

Other Approaches

EXAMPLE — Reduction to 2 machines for 4-machine problem

Jobs A, B, C, D each have 4 machine times. If conditions are met:

\(G_j = t_{1j} + t_{2j} + t_{3j}\) and \(H_j = t_{2j} + t_{3j} + t_{4j}\). Apply Johnson on (G, H).

6. Computing Idle Time

Idle time on a machine is the time during which the machine is waiting (not processing). Computed as:

For machine \(M_k\):

\[ \text{Idle}(M_k) \;=\; \text{Total elapsed time} - \sum_{j} t_{kj}. \]

This includes both the time before the machine starts (waiting for upstream machines) and any gaps between consecutive jobs.

Detailed Idle Time

EXAMPLE

From the 5-job, 2-machine example earlier:

7. Two Jobs on m Machines (Graphical Method)

This sub-problem considers only 2 jobs, each having its own order of machines (not necessarily the same). Solved graphically on a (job 1 time × job 2 time) plot — but is outside the scope of most undergraduate syllabi.

Key Take-aways