Sub topic 5
The forward pass: earliest start and finish
Assume you understand tasks, durations, milestones, and predecessor dependencies. You should also be comfortable reading a task list or simple Gantt chart and adding durations in days. This chapter uses basic Python, but the calculation can also be done by hand.
What the forward pass calculates
A forward pass moves through an activity network from the project's start toward its finish. It calculates two values for each activity:
- Earliest start (ES) is the soonest an activity can begin after all its predecessors are complete.
- Earliest finish (EF) is the soonest an activity can finish.
For an activity with no predecessors, start the calculation at project time zero:
ES = 0
EF = ES + durationFor an activity with predecessors, use the predecessor that finishes latest:
ES = maximum predecessor EF
EF = ES + durationThe maximum is necessary because an activity cannot start until every required predecessor has finished. Its actual start is controlled by the last predecessor to finish.
Worked example
Consider this network:
Calculate the tasks in dependency order. Task A starts at time zero and finishes at time 3. Both B and C depend on A, so both start at time 3. B finishes at time 5, while C finishes at time 7.
Task D depends on both B and C. Its earliest start is therefore the larger of the two predecessor finish times:
ES(D) = max(5, 7) = 7
EF(D) = 7 + 3 = 10The earliest project completion is the greatest EF among the activities that finish the project. In this example, the project can finish no earlier than day 10.
| Task | Duration | Predecessors | Earliest start | Earliest finish |
|---|---|---|---|---|
| A | 3 | None | 0 | 3 |
| B | 2 | A | 3 | 5 |
| C | 4 | A | 3 | 7 |
| D | 3 | B, C | 7 | 10 |
Applying the calculation in Python
The task dictionary below lists every predecessor before the task that depends on it. This is called topological order. A valid forward pass requires this order, because each predecessor's EF must already be known.
tasks = {
"A": (3, []),
"B": (2, ["A"]),
"C": (4, ["A"]),
"D": (3, ["B", "C"]),
}
earliest_start = {}
earliest_finish = {}
for task, (duration, predecessors) in tasks.items():
earliest_start[task] = max(
(earliest_finish[p] for p in predecessors),
default=0,
)
earliest_finish[task] = earliest_start[task] + duration
project_duration = max(earliest_finish.values())
print(earliest_start)
print(earliest_finish)
print(project_duration)The output is:
{'A': 0, 'B': 3, 'C': 3, 'D': 7}
{'A': 3, 'B': 5, 'C': 7, 'D': 10}
10A real calendar schedule may use a project start date instead of zero. In that case, convert each time value into a date after calculating the offsets. Also check that the network has no cycles and that every required predecessor link is present. A cycle would prevent the forward pass from reaching a valid result.
Exercise
Activities A and B both precede C. A has an earliest finish of day 8, B has an earliest finish of day 6, and C takes 4 days. What are C's earliest start and earliest finish?
Show answer
C's earliest start is day 8, because it must wait for the later predecessor. Its earliest finish is day 12.