Flow shop scheduling: Johnson's rule
Two-machine flow shop sequencing by Johnson's rule, timetable and idle-time calculation, the three-machine extension under the dominance condition, and heuristics for more machines.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
In many shops every job visits the same machines in the same order – turning then grinding, printing then binding, machining then painting. The order in which jobs enter such a flow shop changes how long the second machine sits idle and therefore when the last job is finished. Johnson's rule gives the best sequence for two machines in a few minutes by hand, and it extends to some three-machine cases.
Key ideas
Flow shop. n jobs, m machines, every job follows the same machine order M1 → M2 → … → Mm. Here we consider permutation schedules: the same job sequence on every machine. For two machines (and for three machines under Johnson's condition) the best permutation schedule is optimal among all schedules.
Objective: makespan. The makespan C_max is the time from the start of the first job on M1 to the finish of the last job on the last machine. Minimising it maximises machine utilisation and minimises total idle time on the last machine.
Assumptions. All jobs are available at time zero; processing times are known and include set-up (set-ups independent of sequence); a machine handles one job at a time and a job is on one machine at a time; no preemption; unlimited buffer between machines; transfer time negligible.
Johnson's rule (n jobs, 2 machines).
- List the times aᵢ on M1 and bᵢ on M2.
- Find the smallest time among all remaining aᵢ and bᵢ.
- If it is on M1 (aᵢ), place job i at the earliest free position in the sequence; if it is on M2 (bᵢ), place it at the latest free position.
- Remove the job and repeat until all are placed.
- Ties: if a job's aᵢ = bᵢ, put it in either end; if two jobs tie on M1, take either first; if they tie on M2, take either last. Different tie choices give the same makespan. Equivalent form: put jobs with aᵢ ≤ bᵢ first, in increasing aᵢ; then jobs with aᵢ > bᵢ, in decreasing bᵢ.
Why it works. The first job should be quick on M1 so M2 starts early; the last job should be quick on M2 so little work is left after M1 finishes. The total idle time on M2 is what the sequence controls.
Three machines. If min(aᵢ) ≥ max(bᵢ) or min(cᵢ) ≥ max(bᵢ) (M2 is dominated by M1 or M3), form two fictitious machines with times gᵢ = aᵢ + bᵢ and hᵢ = bᵢ + cᵢ and apply Johnson's rule to them; the resulting sequence is optimal for the three machines. If neither condition holds, the method is only a heuristic.
More than three machines. No simple optimal rule exists; heuristics such as Campbell–Dudek–Smith (CDS, which applies Johnson's rule to m − 1 grouped two-machine problems), Palmer's slope index and NEH are used, or branch and bound for small problems.
Gantt chart check. Always draw (or tabulate) start and finish times: on M1 jobs follow back to back; on M2 a job starts at the later of (its M1 finish, the previous job's M2 finish).
Formulas
Finish on M1: C₁(k) = C₁(k−1) + a(k)
Finish on M2: C₂(k) = max[C₁(k), C₂(k−1)] + b(k)
- k = position in the sequence, a(k), b(k) = processing times of the job in position k on M1 and M2 (h or min); C₁(0) = C₂(0) = 0.
Makespan C_max = C₂(n)
Idle time on M2 = C_max − Σ bᵢ
Idle time on M1 (after its last job, until C_max) = C_max − Σ aᵢ
Three-machine reduction: gᵢ = aᵢ + bᵢ, hᵢ = bᵢ + cᵢ
- Valid when min aᵢ ≥ max bᵢ or min cᵢ ≥ max bᵢ; then C_max is found from the three-machine table, not from g and h.
Worked examples
Example 1 (standard) – five jobs, two machines. Times (h): A: M1 5, M2 2; B: 1, 6; C: 9, 7; D: 3, 8; E: 10, 4.
- Smallest time = 1 (B on M1) → B first.
- Next smallest = 2 (A on M2) → A last.
- Next = 3 (D on M1) → D second.
- Next = 4 (E on M2) → E fourth (latest free position).
- C fills the middle. Sequence B–D–C–E–A.
- Timetable (M1 start–finish | M2 start–finish):
- B: 0–1 | 1–7
- D: 1–4 | 7–15
- C: 4–13 | 15–22
- E: 13–23 | 23–27
- A: 23–28 | 28–30
- Makespan = 30 h. Idle time on M2 = 30 − (2 + 6 + 7 + 8 + 4) = 30 − 27 = 3 h (0–1, 22–23 and 27–28). Checking all 120 sequences confirms 30 h is the minimum.
Example 2 (GATE level) – three machines by Johnson's extension. Times (h) on M1, M2, M3: job 1: 8, 3, 4; job 2: 6, 2, 7; job 3: 7, 4, 5; job 4: 11, 5, 3; job 5: 9, 1, 5.
- Check: min M1 = 6 ≥ max M2 = 5, so the extension is optimal.
- Fictitious times g = M1 + M2, h = M2 + M3: job 1 (11, 7), job 2 (8, 9), job 3 (11, 9), job 4 (16, 8), job 5 (10, 6).
- Only job 2 has g ≤ h (8 ≤ 9), so job 2 goes first.
- Jobs with g > h in decreasing h: job 3 (9), job 4 (8), job 1 (7), job 5 (6). Sequence 2–3–4–1–5.
- Timetable (finish times on M1, M2, M3):
- Job 2: 6, 8, 15
- Job 3: 13, 17, 22
- Job 4: 24, 29, 32
- Job 1: 32, 35, 39
- Job 5: 41, 42, 47
- Makespan = 47 h. Idle time on M3 = 47 − 24 = 23 h. Enumeration of all 120 sequences gives the same minimum, 47 h.
Common mistakes
- Placing a job whose minimum is on M2 at the front: M2 minimum means "as late as possible".
- In the "aᵢ ≤ bᵢ first" form, ordering the second group by increasing bᵢ instead of decreasing.
- Starting a job on M2 when M1 finishes it, without checking that M2 is free.
- Applying the three-machine extension without checking the dominance condition.
- Reporting the makespan from the fictitious g/h machines instead of the real three-machine times.
- Calling Johnson's rule a heuristic: for two machines it is exactly optimal for makespan.
For GATE PI
Expect four to six jobs on two machines with a request for the optimal sequence, the minimum makespan or the idle time of a machine; sometimes a three-machine problem that satisfies the dominance condition. Practise doing the sequence and the timetable together, and always verify start times on the second machine from the timetable.
Quick check
- Job P: M1 = 2, M2 = 7; job Q: M1 = 6, M2 = 3. What is the optimal sequence and makespan?
- Under Johnson's rule, where does a job with the overall smallest time on M2 go?
- Three-machine times satisfy min M3 = 6 and max M2 = 5. Can Johnson's extension be used?
- Σ M2 times = 20 h and makespan = 26 h. What is the idle time on M2?
Answers: 1. P–Q; P: M1 0–2, M2 2–9; Q: M1 2–8, M2 9–12; makespan 12. 2. In the last available position. 3. Yes, because min M3 ≥ max M2. 4. 6 h.
Interview questions
All Production Planning and Operations Management interview questionsTry answering each one aloud before you open it.
1.What is Johnson's rule in flow shop scheduling?Concept
Johnson's rule is a scheduling algorithm used to minimize the total time required to complete a set of jobs in a two-machine flow shop. It involves sequencing jobs in a specific order to reduce idle time and improve efficiency. The rule states that jobs should be ordered by selecting the job with the shortest processing time on the first machine and placing it at the beginning, or the job with the shortest processing time on the second machine and placing it at the end.
2.Explain the steps involved in applying Johnson's rule.Concept
- List all jobs and their processing times on both machines. 2. Identify the job with the shortest processing time. 3. If the shortest time is on the first machine, schedule that job as early as possible. If it's on the second machine, schedule it as late as possible. 4. Remove the scheduled job from the list and repeat the process until all jobs are scheduled.
3.Why is Johnson's rule specifically used for two-machine flow shops?Application
For two machines Johnson proved that his rule gives the minimum makespan exactly: the sequence controls only the idle time on the second machine, and putting jobs that are short on M1 early and jobs that are short on M2 late minimises that idle time. With three or more machines the interaction between stages is more complex and no simple rule is optimal in general, except the three-machine case where the middle machine is dominated.
4.What are the limitations of Johnson's rule?Application
Johnson's rule is limited to two-machine flow shops and cannot be directly applied to more complex systems with more than two machines. It also assumes that all jobs are available at the start and that there are no interruptions or breakdowns. Additionally, it does not account for setup times between jobs or variations in job priorities.
5.How does Johnson's rule help in reducing idle time in a flow shop?Application
Johnson's rule helps reduce idle time by sequencing jobs in a way that minimizes the waiting time between jobs on both machines. By selecting jobs based on the shortest processing times, it ensures that each machine is utilized as efficiently as possible, reducing the time machines spend waiting for the next job to be processed.
6.What happens if two jobs have the same processing time on both machines in Johnson's rule?Application
If two jobs have the same processing time on both machines, Johnson's rule does not specify a preference for their order. In such cases, the jobs can be scheduled in any order without affecting the overall completion time. However, other factors like job priorities or due dates might be considered to decide the sequence.
7.Can Johnson's rule be applied to a flow shop with more than two machines? Why or why not?Application
Only in a special case. For three machines, if the middle machine is dominated (min time on M1 ≥ max time on M2, or min time on M3 ≥ max time on M2), you form fictitious machines with times M1+M2 and M2+M3, apply Johnson's rule, and the sequence is optimal. Otherwise, and for four or more machines, the problem is NP-hard and heuristics such as Campbell–Dudek–Smith (which applies Johnson's rule to grouped two-machine problems), Palmer's slope index or NEH are used.
8.Consider a flow shop with two machines. Job A takes 3 hours on Machine 1 and 5 hours on Machine 2. Job B takes 4 hours on Machine 1 and 2 hours on Machine 2. Use Johnson's rule to determine the job sequence.Numerical
According to Johnson's rule, we compare the processing times. Job B has the shortest time on Machine 2 (2 hours), so it should be scheduled last. Therefore, the sequence is Job A first, followed by Job B.
9.In a two-machine flow shop, Job X takes 6 hours on Machine 1 and 4 hours on Machine 2. Job Y takes 2 hours on Machine 1 and 3 hours on Machine 2. Determine the optimal job sequence using Johnson's rule.Numerical
Using Johnson's rule, we find the shortest processing time, which is Job Y on Machine 1 (2 hours). Therefore, Job Y should be scheduled first, followed by Job X. The sequence is Job Y, then Job X.
10.What are some real-world applications of Johnson's rule in production planning?Application
Johnson's rule is used in manufacturing environments where two sequential processes are involved, such as assembly lines with two main stages. It helps in optimizing the production schedule to minimize completion time and improve efficiency. Industries like automotive, electronics, and textiles often use this rule to streamline operations and reduce lead times.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?