← The collection

Shortest Job First.

Queue five known-duration jobs and compare complete schedules’ average waiting.

Interactive experimentintuitiveField note ·
INTERACTIVE EXPERIMENT / P60

Shortest Job First

Queue five known-duration jobs and compare complete schedules’ average waiting.

PLAY & EXPLAIN

Five jobs all arrive at time zero. Choose their nonpreemptive order to reduce average waiting. All jobs have equal priority and known durations; the server never idles.

Selected schedule
JobDurationStart / waitCompletion
Jobs queued
0
Mean wait among queued jobs
—
Full schedule makespan
Incomplete

Compare complete schedules before comparing averages. Shortest processing time minimises total completion time under these conditions. Real arrival times, unknown durations, priorities and starvation concerns require other policies.

Known durations, equal priorities, simultaneous arrivals and nonpreemption are assumed. Changing arrivals, deadlines, fairness and starvation can require another scheduling objective.

THE SHORT VERSION

Shortest Job First, explained.

Shortest-job-first orders available jobs by processing duration and minimises total completion time in the basic single-server setting with all jobs available initially.

01 / THE MECHANISM

Why it happens

Five durations eight, two, six, one and three share arrival time zero. A player-built order or two presets produce exact start and completion ledgers; every complete non-idling schedule finishes at time twenty.

Shortest-job-first orders available jobs by processing duration and minimises total completion time in the basic single-server setting with all jobs available initially.

Read the result

Compare average waits only across complete schedules of the same five jobs. Partial-schedule averages reflect different job subsets.

02 / FOLLOW IT THROUGH

A worked example

Reduce average waiting without changing final completion

  1. Use arrival order for durations eight, two, six, one and three; inspect the waiting ledger.

  2. Switch to shortest-job-first order D, B, E, C, A and compare mean wait falling from 10.2 to 4.4.

  3. Observe that both complete non-idling schedules still finish at time twenty, separating makespan from mean waiting.

OPTIONAL DEEPER DETAILGo deeper: inside the model

Inside this model

Five durations eight, two, six, one and three share arrival time zero. A player-built order or two presets produce exact start and completion ledgers; every complete non-idling schedule finishes at time twenty.

03 / BEYOND THE EXPERIMENT

Where this idea is useful

A practical use

Separate minimising the final completion time from reducing the average time individual jobs wait.

CHECK YOUR INTUITION

A common misconception

THE TEMPTING CONCLUSION

“Finishing the final job at the same time makes all schedules equivalent.”

THE MORE USEFUL DISTINCTION

Different orders redistribute completion and waiting times among jobs even when total processing work and makespan stay fixed.

What this explanation leaves out

  • Known durations, equal priorities, simultaneous arrivals and nonpreemption are assumed. Changing arrivals, deadlines, fairness and starvation can require another scheduling objective.
ONE MORE QUESTION

Does shortest-job-first solve fairness for an ongoing queue?

No. Unknown durations, changing arrivals, priorities and starvation concerns introduce objectives absent from the simultaneous-arrival toy.

TAKE THE IDEA WITH YOU

Whose waiting time changes when you reorder work without changing its total duration?

Associated thinkers

Associated withW. E. Smith ↗

Associations marked provisional are awaiting source review.

Further reading

Explore the original research or the teaching reference behind this experiment.