Flow Shop Schedule Generator
Every job needs the first machine and then the second, in that order. The sequence you choose changes when everything finishes, sometimes by a lot, because the second machine sits idle whenever it has caught up with the first. Johnson's rule settles it in one sort — and unusually for scheduling, it is not a heuristic: for two machines it is provably optimal, and this page confirms that by trying every order.
What this generator does
Builds jobs with two processing times each, applies Johnson's rule to order them, and computes the makespan by simulating both machines. It then enumerates every permutation of the jobs and confirms that none finishes sooner, and reports what the same jobs would cost in their listed order for comparison.
How to use this tool
- Choose how many jobs, then read the two processing times for each.
- Try to find the sequence that finishes earliest.
- Generate the answer and compare against your order and against the listed order.
- Look at which jobs Johnson's rule puts first — the ones that clear machine one quickly.
Understanding the controls
- How many jobs
- Between 2 and 8. Every one of the up-to-40,320 orders is enumerated to confirm the answer, which stays instant at eight.
- Seed
- Any word reproduces the same jobs and the same optimal sequence.
Common use cases
- Teaching Johnson's rule with the optimality actually demonstrated
- Production sequencing worked examples with a known answer
- Showing that resequencing alone can save time with no extra resource
- Test instances for a scheduling implementation
- Setting a reproducible exercise from a seed
How this generator works
Johnson's rule sorts jobs by their shortest processing time on either machine. A job whose first-machine time is the smaller goes to the front of the queue; one whose second-machine time is smaller goes to the back. The makespan simulation tracks when each machine becomes free, with the second machine unable to start a job before it arrives. The check enumerates every permutation, which is what turns 'provably optimal' from a claim into something the page has actually verified.
Randomness and fairness
The processing times are random; the sequence is computed and then confirmed against every alternative. A seed reproduces the jobs exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Two machines only. Johnson's rule extends to three under restrictive conditions and is not optimal in general beyond that.
- Every job visits both machines in the same order, which is what makes it a flow shop rather than a job shop.
- No setup times, machine breakdowns, release dates or due dates.
- Makespan is the only objective; minimising average completion time gives a different sequence.
- The schedule is not retained, so seed a case you want to revisit.
Privacy and your data
The jobs and the enumeration run entirely in your browser. Nothing about the problem or your seed is transmitted or kept.
Related generators
- Makespan Scheduling Problem GeneratorJobs across identical machines, scheduled longest-first, with two lower bounds that often prove the schedule optimal.
- Transportation Problem GeneratorBalanced supply-and-demand shipping problems solved by the least-cost rule, with exhaustive search saying honestly whether that answer was optimal.
- Task Assignment OptimiserThe cheapest one-to-one matching of people to tasks, proved optimal against every possible assignment.
- Set Cover Problem GeneratorCoverage problems where greedy selection is compared against the true minimum found by exhaustive search, so the cost of approximation is visible.