About flow shop scheduling
What is the flow shop problem?
In a flow shop, n jobs go through the same m machines in the same order: first machine 1, then machine 2, and so on. A machine works on one job at a time, and a job is on one machine at a time. In the permutation flow shop, written Fₘ | prmu | Cₘₐₓ, every machine processes the jobs in the same sequence, and the goal is the sequence with the smallest makespan Cₘₐₓ, the moment the last job leaves the last machine.
For two machines Johnson’s rule finds an optimal sequence quickly. From three machines on the problem is NP-hard (Garey, Johnson and Sethi, 1976): no fast exact method is known, which is why heuristics such as CDS, Palmer, Gupta and NEH are used in practice.
Johnson’s rule
Johnson’s rule (1954) takes the smallest processing time left. If it is on the first machine, the job goes as early as possible. If it is on the second, as late as possible. This is optimal for two machines.
For three machines, each job is replaced by the times M1 + M2 and M2 + M3 and the two-machine rule is applied. The result is optimal when machine 2 is dominated, that is when the smallest time on machine 1 or on machine 3 is at least the largest time on machine 2. Otherwise it is a heuristic.
CDS, Palmer and Gupta
The CDS heuristic of Campbell, Dudek and Smith (1970) builds m − 1 two-machine problems. Problem k adds up the first k machines and the last k machines, Johnson’s rule solves it, and the best of the m − 1 sequences is kept.
Palmer’s slope index (1965) favours jobs whose times increase along the line: it weights machine i by 2i − m − 1 and sorts the jobs by decreasing weighted sum. Gupta’s heuristic (1971) uses an index modelled on Johnson’s rule. Some books write it with the opposite sign of e and sort in decreasing order. That gives the same sequence.
The NEH heuristic
NEH (Nawaz, Enscore and Ham, 1983) sorts the jobs by decreasing total processing time and inserts them one at a time at the position that keeps the partial makespan smallest. It is widely regarded as the best constructive heuristic for the makespan of the permutation flow shop, and it is often optimal on small problems. The comparison table shows how each method does on your data.
Completion times, critical path and Gantt chart
Once the sequence is fixed, the schedule follows from one recurrence: an operation starts when its machine is free and the job has left the previous machine, so C(j, i) = max(C(previous job, i), C(j, i − 1)) + p(j, i). The makespan is the last value.
A critical path is a chain of operations without waiting, from the first job on the first machine to the last job on the last machine, whose times add up to the makespan. The Gantt chart draws the schedule machine by machine, with the idle time as gaps.
How this calculator works
Every time is read exactly, fractions and decimals included, and all sums are exact, so there is no rounding. Ties are always broken by job number, so the same data gives the same sequence. The exact method is a depth-first branch and bound that starts from the NEH sequence and prunes with a machine-based lower bound. It runs for up to 10 jobs. Problems can have up to 12 jobs and 8 machines.
Frequently asked questions
What is the makespan?
The makespan Cₘₐₓ is the time at which the last job leaves the last machine, measured from the start of the first job. Minimizing it finishes the whole batch as early as possible and keeps the machines busy.
Is Johnson’s rule always optimal?
For two machines, yes. For three machines it is optimal when the middle machine is dominated, which the calculator checks for you. In other cases, and for four or more machines, it is not, and the problem becomes NP-hard. Then CDS applies the rule to several two-machine problems.
Which heuristic is the best?
On average NEH gives the shortest makespans, followed by CDS, then Palmer and Gupta. On a given problem any of them can win, so the calculator runs all of them and compares them with the exact optimum when there are at most 10 jobs.
Why does my textbook get a different sequence?
Usually because of ties. When two times are equal, books break the tie in different ways, and a problem often has several optimal sequences with the same makespan. Check the makespan first: if it is the same, both answers are correct. Gupta’s index is also written with two sign conventions that give the same order.
What is a permutation flow shop?
A flow shop in which every machine processes the jobs in the same order, so a schedule is just one sequence of the jobs. For the makespan with two or three machines, some optimal schedule is always of this kind, so nothing is lost by searching only sequences.
How large can the problem be?
Up to 12 jobs and 8 machines. The heuristics run instantly. The exact branch and bound runs for up to 10 jobs, and for larger problems the calculator compares the heuristics with a lower bound instead.