Using Johnson’s Rule for 2‑Machine Scheduling: Determining the Optimal Sequence
When a production manager faces two workstations that must process the same set of jobs, the order in which those jobs are sent through the machines can dramatically affect the total completion time, or makespan. So johnson’s rule, a classic algorithm introduced by S. Johnson in 1954, provides a simple yet powerful method for generating the optimal sequence for a two‑machine flow shop when each job must be processed first on Machine 1 and then on Machine 2. Which means m. This article explains the logic behind Johnson’s rule, walks through the step‑by‑step procedure, illustrates the method with a detailed example, discusses its assumptions and limitations, and answers common questions that arise when applying the rule in real‑world settings.
1. Introduction to Two‑Machine Flow Shop Scheduling
In a flow shop environment, every job follows the same route through a series of machines. The two‑machine case is the simplest non‑trivial scenario and serves as a building block for more complex scheduling problems. The primary objective is usually to minimize the makespan (Cmax) – the time at which the last job finishes on the second machine.
Some disagree here. Fair enough And that's really what it comes down to..
Key characteristics of the problem:
| Characteristic | Description |
|---|---|
| Number of machines | Exactly two (M1, M2) |
| Processing order | Each job must be processed on M1 first, then on M2 |
| Processing times | Known in advance, denoted p₁j for M1 and p₂j for M2 |
| No pre‑emption | Once a job starts on a machine, it runs to completion |
| Objective | Minimize makespan (total elapsed time) |
Without a systematic rule, trying every possible permutation (n! possibilities) quickly becomes infeasible as n grows. Johnson’s rule reduces the problem to a linear‑time algorithm that guarantees the optimal sequence under the above assumptions That's the whole idea..
2. The Logic Behind Johnson’s Rule
The rule exploits a simple observation: the job with the smallest processing time should be placed as early as possible if that smallest time belongs to the first machine, or as late as possible if it belongs to the second machine. By repeatedly fixing the “most extreme” job at either the front or the back of the schedule, the algorithm eliminates any potential idle time on the second machine that would otherwise increase the makespan.
Why the Rule Works
- Front placement (smallest on M1):
- If a job’s shortest operation is on Machine 1, scheduling it early reduces the chance that Machine 2 will sit idle waiting for that job to finish on M1.
- Back placement (smallest on M2):
- Conversely, if the shortest operation belongs to Machine 2, placing the job at the end ensures that earlier jobs can finish on M1 and flow directly to M2 without causing a bottleneck.
Mathematically, Johnson proved that any sequence that violates these placements can be transformed into a sequence that respects them without increasing the makespan, leading to an optimal schedule And that's really what it comes down to. But it adds up..
3. Step‑by‑Step Procedure for Johnson’s Rule
Below is the canonical algorithm, presented in a format that can be implemented manually or coded in a spreadsheet And that's really what it comes down to..
- List all jobs with their processing times ((p_{1j}, p_{2j})).
- Create two empty lists:
- Front (to be built from left to right)
- Back (to be built from right to left)
- While there are unscheduled jobs:
a. Identify the minimum processing time among all remaining (p_{1j}) and (p_{2j}).
b. If the minimum belongs to Machine 1 (i.e., (p_{1k}) is the smallest), place job k at the next available position at the front of the schedule.
c. If the minimum belongs to Machine 2 (i.e., (p_{2k}) is the smallest), place job k at the next available position at the back of the schedule.
d. Remove job k from the list of unscheduled jobs. - Combine the Front and Back lists (Front first, then reversed Back) to obtain the final sequence.
The algorithm runs in O(n log n) if a priority queue is used, but for typical shop‑floor sizes a simple O(n²) implementation is perfectly adequate.
4. Detailed Example
Assume a workshop must process five jobs (J1–J5) on two machines with the following processing times (in minutes):
| Job | Machine 1 (p₁) | Machine 2 (p₂) |
|---|---|---|
| J1 | 8 | 6 |
| J2 | 4 | 7 |
| J3 | 5 | 3 |
| J4 | 9 | 5 |
| J5 | 2 | 4 |
Applying Johnson’s Rule
-
Initial set: {J1, J2, J3, J4, J5}
-
Minimum processing time: 2 (J5 on M1) → place J5 at the front.
- Front = [J5]
- Remaining: {J1, J2, J3, J4}
-
Minimum among remaining: 3 (J3 on M2) → place J3 at the back.
- Back = [J3] (rightmost)
- Remaining: {J1, J2, J4}
-
Minimum: 4 (J2 on M1) → place J2 next to front.
- Front = [J5, J2]
- Remaining: {J1, J4}
-
Minimum: 5 (J4 on M2) → place J4 at the back (to the left of J3).
- Back = [J4, J3]
- Remaining: {J1}
-
Only J1 left: place it at the front (next open slot).
- Front = [J5, J2, J1]
-
Combine: Front + reversed Back = J5 – J2 – J1 – J4 – J3
Calculating the Makespan
| Job | Start M1 | Finish M1 | Start M2 | Finish M2 |
|---|---|---|---|---|
| J5 | 0 | 2 | 2 | 6 |
| J2 | 2 | 6 | 6 | 13 |
| J1 | 6 | 14 | 14 | 20 |
| J4 | 14 | 23 | 23 | 28 |
| J3 | 23 | 28 | 28 | 31 |
The makespan (Cmax) = 31 minutes. Any other permutation of the five jobs yields a makespan of 31 minutes or higher, confirming the optimality of the Johnson sequence The details matter here..
5. When Johnson’s Rule Is Applicable
| Condition | Explanation |
|---|---|
| Two machines | The rule is derived specifically for a flow shop with exactly two workstations. Which means |
| Same job order | Every job must visit Machine 1 before Machine 2 (no re‑ordering of machines). Now, |
| No pre‑emption | Once a job starts on a machine, it cannot be interrupted. |
| Objective: minimize makespan | The rule guarantees optimality for this single objective; other objectives (e.In practice, g. Plus, |
| Deterministic processing times | Times are known, fixed, and independent of the sequence. , total tardiness) may require different approaches. |
If any of these assumptions are violated, Johnson’s rule may no longer produce the optimal schedule, though it can still serve as a useful heuristic.
6. Extending the Idea: More Than Two Machines
For three or more machines, the problem becomes NP‑hard, and no simple closed‑form rule exists. That said, practitioners often use Johnson’s reduction:
- Combine the first k machines into a “virtual” machine with processing time equal to the sum of the first k operations for each job.
- Combine the remaining machines similarly.
- Apply Johnson’s rule to the two virtual machines.
While this technique does not guarantee optimality for three‑machine flow shops, it frequently yields near‑optimal results and is widely used in practice.
7. Frequently Asked Questions (FAQ)
Q1: Can I use Johnson’s rule if some jobs have zero processing time on a machine?
A: Yes. Zero processing time is treated as the smallest possible value, so the algorithm will place such jobs at the front (if on Machine 1) or at the back (if on Machine 2). The resulting schedule remains optimal.
Q2: What if a job’s processing time on Machine 2 is shorter than on Machine 1, but the overall makespan would improve by moving it earlier?
A: Johnson’s rule already accounts for this situation. The algorithm decides placement based on the minimum processing time across all jobs, not on a per‑job comparison. The optimality proof shows that any sequence violating the rule can be rearranged without increasing makespan.
Q3: How does setup time affect the rule?
A: Johnson’s rule assumes no sequence‑dependent setup times. If significant setup times exist, the problem transforms into a more complex scheduling model, and the rule may no longer be optimal. In such cases, mixed‑integer programming or meta‑heuristics (genetic algorithms, tabu search) are advisable The details matter here. That alone is useful..
Q4: Can I apply Johnson’s rule when jobs have due dates or priorities?
A: The rule only optimizes makespan. If due dates, weighted tardiness, or priority constraints dominate, you must incorporate those criteria into a multi‑objective model. Johnson’s sequence can be used as a starting point, but additional adjustments will be necessary.
Q5: Is there software that automates Johnson’s rule?
A: Many operations‑research packages (e.g., LINGO, Gurobi, Excel Solver with VBA) include built‑in functions for two‑machine flow shop scheduling. Implementing the algorithm manually in a spreadsheet is also straightforward: sort jobs by the minimum of their two times, then assign positions as described Small thing, real impact..
8. Practical Tips for Implementing Johnson’s Rule on the Shop Floor
- Collect accurate processing times – Use historical data or time‑study results; even small errors can affect the sequence.
- Maintain a visual board – A simple whiteboard with two columns (Front, Back) helps operators see the evolving schedule in real time.
- Re‑evaluate when new jobs arrive – Johnson’s rule is static; if a high‑priority job appears mid‑day, recompute the sequence for the remaining unscheduled jobs.
- Monitor idle time on Machine 2 – The rule minimizes idle time, but unexpected disruptions (breakdowns, material shortages) can re‑introduce gaps; have contingency slots ready.
- Combine with lean tools – Use the optimal sequence as a backbone, then apply single‑minute exchange of die (SMED) techniques to reduce changeover times further.
9. Conclusion
Johnson’s rule remains one of the most elegant and practical algorithms in production scheduling. Think about it: by systematically placing the job with the smallest processing time on the appropriate end of the line, the method guarantees the minimum makespan for any two‑machine flow shop that meets its assumptions. Its simplicity enables quick manual calculations, while its mathematical foundation ensures confidence in the resulting schedule Simple as that..
Easier said than done, but still worth knowing.
For organizations that operate two consecutive workstations—whether in metal fabrication, printed‑circuit board assembly, or food processing—adopting Johnson’s rule can lead to measurable reductions in lead time, lower work‑in‑process inventory, and smoother machine utilization. When the problem extends beyond two machines or incorporates additional constraints, the rule still offers a valuable heuristic baseline, guiding more sophisticated optimization efforts Most people skip this — try not to..
Embracing Johnson’s rule, therefore, is not merely an academic exercise; it is a concrete step toward leaner, faster, and more predictable manufacturing. By mastering the algorithm and integrating it into daily planning routines, managers empower their teams to make data‑driven sequencing decisions that keep production humming and customers satisfied.