📚 Math in Society
⇩ Download ▾

7.2 Getting Started

To begin thinking about scheduling, let us consider an auto shop that is converting a car from gas to electric. A number of steps are involved. A time estimate for each task is given.

Some tasks have to be completed before others – we certainly can’t install the new motor before removing the old engine! There are some tasks, however, that can be worked on simultaneously by two different people, like constructing the battery racks and installing the motor.

To help us visualize the ordering of tasks, we will create a digraph.

For example, this digraph shows that Task 1, notated T1 for compactness, needs to be completed before Task 2. The number in parentheses after the task name is the time required for the task.

Digraph of two tasks: a vertex labelled T sub 1, time 2, with an arrow to a vertex labelled T sub 2, time 0.5, showing that task 1 must be finished before task 2 can begin.

The time it takes to complete this job will partially depend upon how many people are working on the project.

For simplicity, we are going to make the very big assumptions that every processor can do every task, that they all would take the same time to complete it, and that only one processor can work on a task at a time.

If we had only one processor working on this task, it is easy to determine the finishing time; just add up the individual times. We assume one person can’t work on two tasks at the same time, ignore things like drying times during which someone could work on another task. Scheduling with one processor, a possible schedule would look like this, with a finishing time of 10 days.

Schedule chart for one processor on a time axis from 0 to 10 days, gridded every half day. P sub 1 runs T sub 1 from 0 to 2, T sub 3 from 2 to 4, T sub 4 from 4 to 5, T sub 5 from 5 to 7, T sub 2 from 7 to 7.5, T sub 6 from 7.5 to 8, T sub 7 from 8 to 8.5, T sub 8 from 8.5 to 9 and T sub 9 from 9 to 10. There is no idle time and the finishing time is 10 days.

In this schedule, all the ordering requirements are met. This is certainly not the only possible schedule for one processor, but no other schedule could complete the job in less time. Because of this, this is an optimal schedule with optimal finishing time – there is nothing better.

For two processors, things become more interesting. For small digraphs like this, we probably could fiddle around and guess-and-check a pretty good schedule. Here would be a possibility:

Schedule chart for two processors on a time axis from 0 to 10 days. P sub 1 runs T sub 1 from 0 to 2, T sub 3 from 2 to 4, T sub 6 from 4 to 4.5 and T sub 9 from 4.5 to 5.5. P sub 2 runs T sub 5 from 0 to 2, T sub 4 from 2 to 3, T sub 2 from 3 to 3.5, T sub 8 from 3.5 to 4 and T sub 7 from 4 to 4.5, then sits idle from 4.5 to 5.5. Finishing time 5.5 days.

With two processors, the finishing time was reduced to 5.5 days. What was processor 2 doing during the last day? Nothing, because there were no tasks for the processor to do. This is called idle time.

Is this schedule optimal? Could it have been completed in 5 days? Because every other task had to be completed before task 9 could start, there would be no way that both processors could be busy during task 9, so it is not possible to create a shorter schedule.

So how long will it take if we use three processors? About 10/3=3.33 days? Again we will guess-and-check a schedule:

Schedule chart for three processors on a time axis from 0 to 10 days. P sub 1 runs T sub 1 from 0 to 2, T sub 2 from 2 to 2.5, T sub 6 from 2.5 to 3, T sub 8 from 3 to 3.5 and T sub 9 from 3.5 to 4.5. P sub 2 runs T sub 3 from 0 to 2, idles from 2 to 2.5, runs T sub 7 from 2.5 to 3 and then idles to the end. P sub 3 runs T sub 4 from 0 to 1 and T sub 5 from 1 to 3, then idles. Finishing time 4.5 days.

With three processors, the job still took 4.5 days. It is a little harder to tell whether this schedule is optimal. However, it might be helpful to notice that since Task 1, 2, 6, and 9 have to be completed sequentially, there is no way that this job could be completed in less than 2+0.5+0.5+1=4 days, regardless of the number of processors. Four days is, for this digraph, the absolute minimum time to complete the job, called the critical time.

Critical time can be determined by looking at the longest sequence of tasks in the digraph, called the critical path 

Adapted from Math in Society by David Lippman, hosted on LibreTexts (math.libretexts.org) and licensed under CC BY-SA 3.0. Changes were made. License: CC-BY-SA-3.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.