Sub topic 6
The backward pass: latest start and finish
This chapter assumes you can already run a forward pass. You know that earliest finish (EF) equals earliest start (ES) plus duration, and that a task's ES is the largest EF among its predecessors. You should also be comfortable reading a predecessor table. The Python examples use only dictionaries, loops, and functions.
The forward pass tells you the earliest each task can happen. The backward pass answers a different question: how late can each task start or finish without delaying the project? The gap between the two answers is float, which the next chapter covers in full.
What the backward pass computes
For every task, the backward pass finds two numbers:
- Latest finish (LF): the latest time the task can finish without pushing the project end date.
- Latest start (LS): the latest time the task can start and still meet its LF. It is
LS = LF - duration.
The pass starts at the end of the network and moves toward the start. This is the reverse of the forward pass, and it uses the same durations and the same links.
The two rules
- Anchor the end. For a task with no successors, set LF to the project end date. By default this is the largest EF found by the forward pass.
- Propagate backward. For any other task, LF is the smallest LS among its successors. Then calculate
LS = LF - duration.
Compare this with the forward pass. Going forward you take the maximum of the predecessors' finish times, because a task must wait for the slowest predecessor. Going backward you take the minimum of the successors' start times, because a task must finish in time for the most demanding successor.
| Pass | Direction | Combine with | Starts from |
|---|---|---|---|
| Forward | Start to end | Maximum of predecessor EF | Project start (0) |
| Backward | End to start | Minimum of successor LS | Project end date |
Worked example
Use the network from the forward pass. A takes 3 days. B (2 days) and C (4 days) both follow A. D (3 days) follows both B and C.
The forward pass gives these values:
| Task | Duration | ES | EF |
|---|---|---|---|
| A | 3 | 0 | 3 |
| B | 2 | 3 | 5 |
| C | 4 | 3 | 7 |
| D | 3 | 7 | 10 |
The project end date is 10. Now work backward, one task at a time:
- D has no successors, so LF = 10. LS = 10 - 3 = 7.
- C has one successor, D, so LF = LS of D = 7. LS = 7 - 4 = 3.
- B also has D as its only successor, so LF = 7. LS = 7 - 2 = 5.
- A has two successors, B and C. LF is the smaller of their LS values: min(5, 3) = 3. LS = 3 - 3 = 0.
Step 4 is where the minimum rule matters. B could start as late as day 5, but C must start by day 3. A has to finish in time for C, so C sets A's LF.
| Task | Duration | ES | EF | LS | LF | LS - ES |
|---|---|---|---|---|---|---|
| A | 3 | 0 | 3 | 0 | 3 | 0 |
| B | 2 | 3 | 5 | 5 | 7 | 2 |
| C | 4 | 3 | 7 | 3 | 7 | 0 |
| D | 3 | 7 | 10 | 7 | 10 | 0 |
The last column is total float. A, C, and D have LS equal to ES, so they cannot slip. B can slip by 2 days.
Processing order
You cannot calculate a task's LF until the LS of every successor is known. In a valid network (no cycles, as covered in the validation chapter), this is always possible if you visit tasks in reverse topological order. That is any order in which every task appears after all of its successors.
If your task list is written so that predecessors come first, reversing the list gives a valid backward order. The code below relies on this, so it only works if the input really is listed predecessors-first.
The backward pass in code
This example runs the forward pass, then the backward pass three times with different end dates.
tasks = {
# name: (duration in days, predecessors); predecessors listed first
"A": (3, []),
"B": (2, ["A"]),
"C": (4, ["A"]),
"D": (3, ["B", "C"]),
}
def forward_pass(tasks):
es, ef = {}, {}
for t, (dur, preds) in tasks.items():
es[t] = max((ef[p] for p in preds), default=0)
ef[t] = es[t] + dur
return es, ef
def backward_pass(tasks, end_date):
succs = {t: [] for t in tasks}
for t, (_, preds) in tasks.items():
for p in preds:
succs[p].append(t)
ls, lf = {}, {}
for t in reversed(list(tasks)):
# Tasks with no successors are anchored to the end date
lf[t] = min((ls[s] for s in succs[t]), default=end_date)
ls[t] = lf[t] - tasks[t][0]
return ls, lf
es, ef = forward_pass(tasks)
project_end = max(ef.values())
for end_date in (project_end, 12, 8):
ls, lf = backward_pass(tasks, end_date)
total_float = {t: ls[t] - es[t] for t in tasks}
print(end_date, total_float)
# 10 {'A': 0, 'B': 2, 'C': 0, 'D': 0}
# 12 {'A': 2, 'B': 4, 'C': 2, 'D': 2}
# 8 {'A': -2, 'B': 0, 'C': -2, 'D': -2}The first line reproduces the table above. The other two lines come from changing the end date, which the next sections explain.
Choosing the end date
The anchor in rule 1 is a choice, and it changes the meaning of the result.
- End date equals the forward-pass finish (10). This is the standard case. At least one path has zero float, and no task has negative float. That zero-float path is the critical path.
- End date later than the forward-pass finish (12). This models a deadline with slack. Every task gains the same 2 days of float, so no task has zero float. The critical path is still the same chain, but now it has 2 days of float instead of none. Many tools define it as the lowest-float path for this reason.
- End date earlier than the forward-pass finish (8). This models an impossible deadline. Float goes negative. Here A, C, and D show -2, which means the chain is 2 days longer than the deadline allows. B shows 0, so it is not the problem even though it looks tight.
Negative float is the useful result. It tells you how much schedule you must recover, and which chain to attack.
Multiple end tasks
A network can have several tasks with no successors. Each one is anchored to the same end date, so each gets LF = end_date. A short branch that ends early therefore gets a lot of float, which is correct: it can finish any time before the project does.
In practice, most scheduling tools add a single finish milestone with zero duration after all open-ended tasks. That makes the rule uniform. The code above does the same thing through default=end_date.
Edge cases
- Zero-duration milestones. A milestone has LS equal to LF. They are processed like any other task and often show zero float when they sit on the critical path.
- Fixed constraints. A "must finish on" or "must start on" date overrides the calculated value. If a successor has a constraint that makes its LS earlier than the network implies, the predecessors inherit that earlier limit through the minimum rule.
- Day-counting convention. This chapter uses an end-of-day convention, where EF = ES + duration. Some tools count the first day as day 1, so a 3-day task starting on day 1 finishes on day 3. The float values come out the same, but the dates differ by one. Match your tool's convention before comparing numbers.
- Calendars. A task's duration in working days must be converted to dates using that task's calendar. Weekends and holidays can make LS and LF fall on different calendar dates than simple subtraction suggests.
- Dependencies other than finish-to-start. The rules above assume finish-to-start links with no lag. Other link types and lags change the formulas, and a later chapter covers them.
Checking your work
Two quick checks catch most mistakes:
- For every task, LS must be greater than or equal to ES, unless the end date is earlier than the forward-pass finish. If it is not, you probably mixed up min and max, or processed a task before its successors.
- At least one start task must have LS = ES = 0 when the end date equals the forward-pass finish. Float should never be negative in that case.
Exercise
A task X (5 days) has two successors, Y and Z. The backward pass gives Y an LS of 14 and Z an LS of 11. The end date equals the forward-pass finish, and X has ES = 4. What are X's LF and LS, and what is its total float?
Show answer
LF is the smaller successor LS, so LF = min(14, 11) = 11. LS = 11 - 5 = 6. Total float = LS - ES = 6 - 4 = 2 days.
Exercise
Using the example network (A=3, B=2, C=4, D=3), the deadline is moved to 9 days. What is the total float of B, and what does it tell you?
Show answer
With an end date of 9, D has LF 9 and LS 6. B has LF 6 and LS 4, and its ES is 3, so its float is 1. A has LF = min(4, 2) = 2 and LS = -1, so its float is -1, as are C's and D's. B has positive float even though the project is 1 day late, because the longer chain A, C, D drives the problem, not B.