Job Shop Scheduling Calculator

Schedule jobs that each follow their own route through the machines, so that the last one finishes as early as possible. Build the schedule with Giffler and Thompson’s algorithm and the SPT, LPT, MWKR and LWKR rules, use Jackson’s rule for two machines, prove the optimum with branch and bound, and follow every step down to the Gantt chart.

  • Giffler–Thompson
  • SPT, LPT, MWKR, LWKR
  • Jackson’s rule
  • Exact branch and bound
  • Gantt chart
  • Free, no sign-up

Job routes

JobOp 1Op 2Op 3
Algorithm

Giffler–Thompson with MWKR. In each conflict, the job with the most work left goes first. Usually the best rule.

Each row is a job, and its operations are done from left to right: pick the machine and type the time. Times can be integers, decimals or fractions (3, 2.5, 3/4). Leave a time empty when the job needs fewer operations. Job names can be edited.

Result

Optimal schedule

MWKR finds an optimal schedule here.

Makespan Cmax19
Order on each machine
M1
  1. J4
  2. J1
  3. J3
  4. J2
M2
  1. J2
  2. J1
  3. J4
  4. J3
M3
  1. J3
  2. J4
  3. J1
  4. J2

All algorithms on this problem

AlgorithmCmaxGap
31+12 (63.2%)
24+5 (26.3%)
19optimal
24+5 (26.3%)
19optimal

Gaps are measured against the optimum found by branch and bound. Click a row to see that algorithm step by step.

Step-by-step solution

Step 1 of 14
Step 1 of 14

Giffler–Thompson

Giffler and Thompson build an active schedule one operation at a time. The candidates are the next operation of every unfinished job, each with its earliest start (when both its job and its machine are free) and its earliest completion. The smallest earliest completion c* fixes a machine M*. Every candidate on M* that can start before c* is in conflict, and a priority rule chooses which one goes first. Every active schedule can be built this way, an optimal one included.

Rule MWKR (most work remaining): in a conflict, the job with the most work left, this operation included, goes first, so that long jobs are not left for the end. It is usually the best simple rule for the makespan. Ties go to the lower job number.

JobJob routesTotal work
J1M1 5M2 4M3 312
J2M2 6M1 2M3 412
J3M3 4M1 5M2 211
J4M1 3M3 6M2 514

Tip: use the ← and → keys to move between steps.

About job shop scheduling

What is the job shop problem?

In a job shop, every job has its own route through the machines: one job goes from the lathe to the mill and then to the drill, another from the drill to the lathe. A machine works on one operation at a time, an operation cannot be interrupted, and a job is on one machine at a time. The goal in Jₘ || Cₘₐₓ is the schedule with the smallest makespan, the moment the last job is finished.

Unlike the flow shop, each machine can take the jobs in a different order, so a schedule is one sequence per machine. The problem is NP-hard even with two machines once jobs can have three operations, and it is one of the hardest problems in combinatorial optimization: the 10 × 10 benchmark ft10 of Fisher and Thompson, published in 1963, was only solved in 1989.

The disjunctive graph

Roy and Sussmann (1964) model a job shop as a graph. Every operation is a vertex. Conjunctive arcs link the consecutive operations of each job, and disjunctive edges join every pair of operations that share a machine. A schedule gives every disjunctive edge a direction. If the result has no cycle, the longest path from start to finish is the makespan, and its operations form the critical path.

Giffler and Thompson’s algorithm

A schedule is active when no operation could start earlier without delaying another one. Giffler and Thompson (1960) showed how to build every active schedule, and some active schedule is always optimal. At each step, take the next operation of every job, find the earliest completion c* and its machine M*, and choose one of the operations on M* that can start before c*.

Priority rules make that choice. SPT and LPT look at the operation time, MWKR and LWKR at the work left in the job. For the makespan, MWKR is usually the best of them. The comparison table shows how each rule does on your data.

Jackson’s rule for two machines

When there are two machines and every job has at most two operations, Jackson (1956) gives an optimal schedule. Split the jobs by route, order the jobs that go from M1 to M2 and those that go from M2 to M1 with Johnson’s rule, and let each machine start with the jobs that begin there.

Branch and bound

The exact method branches on the conflict sets of Giffler and Thompson, so it only explores active schedules. Each partial schedule gets a lower bound from the work left in each job and from a one-machine relaxation of each machine: Jackson’s preemptive schedule with release times and tails, the classic bound of Carlier and Pinson. Nodes that cannot beat the best schedule found so far are pruned. On Fisher and Thompson’s 6 × 6 instance ft06 it proves the optimum of 55 in a few thousand nodes.

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 schedule. Problems can have up to 10 jobs and 6 machines. The exact search runs for up to 36 operations and stops after a node or time limit, in which case the best schedule found is shown with a lower bound.

Frequently asked questions

What is the difference between a flow shop and a job shop?

In a flow shop every job visits the machines in the same order. In a job shop each job has its own route, so a machine can meet the jobs in any order and a schedule is one sequence per machine. Every flow shop is a special job shop, which is why the job shop is harder.

What is the makespan?

The makespan Cₘₐₓ is the time at which the last operation finishes, measured from time 0. Minimizing it finishes the whole set of jobs as early as possible.

Which priority rule is the best?

For the makespan, MWKR (most work remaining) is usually the best simple rule, because it keeps the long jobs moving. SPT finishes many operations early but can leave a long job for the end. No rule is always the best, so the calculator runs all of them and compares them with the exact optimum.

What is an active schedule?

A schedule in which no operation can be moved earlier without delaying another operation. Some optimal schedule is always active, and Giffler and Thompson’s algorithm builds exactly the active schedules, so searching them is enough.

Why does my textbook get a different schedule?

Usually because of ties. When two operations have the same priority, books break the tie in different ways, and a problem often has several optimal schedules with the same makespan. Compare the makespans first. Some books also use the non-delay version of the algorithm, which only considers the operations that can start at the earliest possible moment.

How large can the problem be?

Up to 10 jobs and 6 machines, each job with up to 6 operations. The priority rules run instantly. The exact branch and bound runs for up to 36 operations, which covers Fisher and Thompson’s ft06, and on larger or harder problems it shows the best schedule found with a lower bound.

Related on LearnGraphTheory