Optimal Two- and Three-Stage Production Schedules with Setup Times Included 1: Johnson's Rule Minimizes the Total Elapsed Time on Two MachinesResearch Paper
Motivation
A two-machine flow shop is the simplest multi-stage production system: every job visits machine 1 and then machine 2, each machine works on one job at a time, and the goal is to finish all jobs as early as possible. S. M. Johnson's 1954 paper (Naval Research Logistics Quarterly 1(1):61–68, doi:10.1002/nav.3800010110) answered this question, posed by R. Bellman, with an exact rule, now called Johnson's rule. It is one of the first exact results in machine scheduling. In the three-field notation of Graham, Lawler, Lenstra and Rinnooy Kan (1979) the problem is written . The rule is the standard polynomial case against which the NP-hardness of the three-machine flow shop (Garey, Johnson and Sethi 1976) is contrasted, and it is still used inside heuristics for larger shops.
Timeline:
- 1954. Johnson proves the two-machine rule and a three-machine special case (the latter is the second mission of this series).
- 1976. Garey, Johnson and Sethi prove that the three-machine flow shop is NP-hard in the strong sense, so the two-machine case marks the boundary of tractability.
Setting
There are items . Item needs units of time on machine 1 and then units on machine 2. Each time is setup time plus work time, and the times are otherwise arbitrary. A schedule assigns start times and . It is feasible when all start times are nonnegative, the intervals of distinct items do not overlap on machine 1, the intervals do not overlap on machine 2, and for every item. The total elapsed time is the time at which the last item leaves machine 2.
An order is a permutation , where is the item in position . The as-soon-as-possible schedule of an order processes the items in the order on both machines, with no delay on machine 1. Each item starts on machine 2 as soon as it has left machine 1 and machine 2 is free.
Relation (II). Item is definitely preferred to item when
and the two items are indifferent when equality holds. An order is consistent with all the definite preferences when no item is definitely preferred to an item placed earlier.
For an order the paper uses the quantities
Formalization targets
Goal: Theorem 1 (p. 63)
For positive :
The comparison is against every feasible schedule, including those whose two machines follow different orders.
Milestones
- Lemma 1 (p. 61). Every feasible schedule can be replaced, at no greater total elapsed time, by a feasible schedule that follows one common order on both machines.
- As soon as possible (p. 62). For a fixed common order, is feasible and minimizes among the feasible schedules that follow .
- Closed form (p. 62). , i.e. the total idle time of machine 2 is .
- Adjacent interchange (p. 63). Interchanging the items in positions leaves every other unchanged. Moreover, holds if and only if (II) holds for the pair.
- Interchanges do not increase (p. 63). If the pair in positions satisfies (II) non-strictly, then .
- Lemma 2 (p. 64). Relation (II) is transitive, except when the middle item is indifferent to both others.
- Worked example (p. 65). For and , the order takes 47 units with 4 units of idle time. The reversed order takes 78 units, and every order takes between 47 and 78 units.
Significance
The theorem reduces an optimization over a continuum of start-time vectors, and over orders, to sorting with respect to a pairwise relation. The paper's working rule computes an optimal order in time. The two-machine rule is the building block of Johnson's three-machine result, of the Campbell–Dudek–Smith heuristic for machines, and of lower bounds in branch-and-bound methods for flow shops. The closed form reappears across flow-shop theory as a longest-path formula.
The result is classical and proved. This mission contributes a machine-checked proof in Lean 4 against Mathlib. As far as a search of the platform shows, no formal statement of the flow-shop model or of Johnson's rule exists there. The mission also fixes a reusable Lean model of a two-machine schedule: start times, feasibility, total elapsed time and the as-soon-as-possible schedule of an order.
Difficulty
The paper's argument leaves two steps informal, and a formal proof must supply both. First, Lemma 1 is justified by a picture and the phrase "successive interchanges". The page does not show that each interchange keeps the schedule feasible and does not delay the last completion on machine 2, and this is where most of the modelling work sits. Second, relation (II) is not a strict weak order when there are ties, so the obvious sorting argument fails. Consistency on adjacent pairs does not imply optimality: the items , in that order, satisfy (II) non-strictly on both adjacent pairs, yet take 13 units against an optimum of 10. Lemma 2's exception is exactly this case.
Formalization scope
Items are Fin n (0-based) and times are real numbers. Positivity , is a hypothesis of the goal and of Lemma 1, the as-soon-as-possible step and the closed form, as on p. 61. Lemma 2 and the interchange statements are pure min/sum algebra and carry no positivity. An order is σ : Equiv.Perm (Fin n) with σ k the item in position k. Interchanging positions is σ * Equiv.swap j (j+1). The total elapsed time is Finset.univ.fold max 0 of the machine-2 completion times, so it is when . is indexed by 0-based positions (Lean's is the paper's ), and requires .
Conventions made explicit or corrected:
- "Consistent with all the definite preferences" is imposed on all pairs of positions as the non-strict inequality . The goal also asserts that such an order exists, so its main clause is not vacuous.
- The display of on p. 63 prints the upper limit on the -sum. The definition of on p. 62 and the reduction of (I) to (II) require , and the formalization uses .
- Lemma 2 keeps the page's exception (item 2 indifferent to both items); without it the statement is false.
Measuring the objective by , or comparing only against schedules that follow one common order, would drop Lemma 1 and change the theorem. The goal compares against every feasible start-time schedule. The working rule of p. 64 (a procedure) is not formalized.
Proofs of any milestone are welcome, as are further lemmas about the as-soon-as-possible schedule and a formalization of the working rule. The schedule definitions are the basis for the three-machine mission of this series.
Selected references
- S. M. Johnson, Optimal two- and three-stage production schedules with setup times included, Naval Research Logistics Quarterly 1(1):61–68, 1954. doi:10.1002/nav.3800010110
- M. R. Garey, D. S. Johnson, R. Sethi, The complexity of flowshop and jobshop scheduling, Mathematics of Operations Research 1(2):117–129, 1976. doi:10.1287/moor.1.2.117
- R. L. Graham, E. L. Lawler, J. K. Lenstra, A. H. G. Rinnooy Kan, Optimization and approximation in deterministic sequencing and scheduling: a survey, Annals of Discrete Mathematics 5:287–326, 1979. doi:10.1016/S0167-5060(08)70356-X
- H. G. Campbell, R. A. Dudek, M. L. Smith, A heuristic algorithm for the n job, m machine sequencing problem, Management Science 16(10):B630–B637, 1970. doi:10.1287/mnsc.16.10.B630