Sub topic 8
Reading the critical path from zero float
This chapter assumes you can run a forward and backward pass and that you know total float and free float. You need to be comfortable with early and late dates in days. The code uses basic Python.
The rule
Total float is the number of days an activity can slip without delaying the project end date. It is calculated as:
total float = latest start - earliest start
= latest finish - earliest finishAn activity with zero total float has no slack. Any delay to it moves the project end date. The critical path is the chain of zero-float activities that runs from the project start to the project end. Its length equals the minimum project duration.
You do not have to search for the longest path. The forward and backward passes already contain the answer. Float is the gap between the two passes, and the critical path is where that gap is zero.
Worked example
Take four activities. A takes 3 days with no predecessors. B takes 2 days after A. C takes 4 days after A. D takes 3 days after both B and C.
| Activity | Duration | ES | EF | LS | LF | Total float | Critical |
|---|---|---|---|---|---|---|---|
| A | 3 | 0 | 3 | 0 | 3 | 0 | Yes |
| B | 2 | 3 | 5 | 5 | 7 | 2 | No |
| C | 4 | 3 | 7 | 3 | 7 | 0 | Yes |
| D | 3 | 7 | 10 | 7 | 10 | 0 | Yes |
Reading down the Critical column gives A, C, D. The project takes 10 days. B has 2 days of total float, so it can start as late as day 5 without moving the end date.
Check the answer another way. Path A-B-D is 3 + 2 + 3 = 8 days. Path A-C-D is 3 + 4 + 3 = 10 days. The difference between the two path lengths, 2 days, is the float on B.
Why zero float and longest path agree
Every path from start to end has a length, and the project cannot finish before the longest one does. For an activity on that longest path, the earliest it can finish and the latest it can finish are the same date. Nothing is in the way of either pass, so ES equals LS, and float is zero.
An activity on a shorter path has room. The backward pass starts from the project end date, which the longest path set. A short path therefore gets late dates that are later than its early dates, and that difference is its float.
Reading the path from the table
Zero float tells you which activities are critical. It does not tell you the order or which activities connect. In a larger network, two steps recover the path.
- Collect every activity with zero total float.
- Link activity X to activity Y when Y is a successor of X and EF of X equals ES of Y.
Step 2 matters because zero-float activities can sit on separate, unconnected chains. Two zero-float activities that never touch are not one path. They are a sign that the data needs checking, which the next section covers.
Gotchas when reading float
Negative float
If the project has a required finish date earlier than the calculated end, the backward pass starts from that date instead. Every critical activity then shows negative float. For example, if the end date is day 8 and the calculated finish is day 10, the critical path has float of -2. That figure is the number of days you must recover. Negative float is a warning, and you cannot ignore it.
Float is shared along a chain
Total float belongs to a chain of activities, not to one activity alone. Suppose B in a longer example had a successor E, and both sat on a path with 2 days of float. If B uses 2 days, E has none left. Free float helps here. It is the delay an activity can absorb without delaying the earliest start of any successor. In the original example, B has free float of 2, because D can start on day 7 and B finishes on day 5.
| Measure | Question it answers | Delay affects |
|---|---|---|
| Total float | How late can this finish before the project end moves? | Project end date |
| Free float | How late can this finish before a successor's early start moves? | Next activity's early dates |
Float depends on the dates you used
Float is derived from the durations, the dependencies, and any date constraints. If any of them is wrong, the critical path is wrong too. A missing dependency will make an activity look like it has float when it does not. A constraint such as "must start on" can force an activity to look critical or noncritical in ways that do not follow from its logic.
Ties: more than one critical path
If B took 4 days instead of 2, paths A-B-D and A-C-D would both be 10 days long. Both would show zero float on every activity. The project then has two critical paths. A delay on either one delays the end date, so the schedule has more ways to slip.
The code below computes float and lists every critical path. It follows only links where the predecessor's earliest finish equals the successor's earliest start.
tasks = {
# name: (duration in days, predecessors); predecessors listed first
"A": (3, []),
"B": (4, ["A"]),
"C": (4, ["A"]),
"D": (3, ["B", "C"]),
}
def critical_paths(tasks):
# Forward pass
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
end = max(ef.values())
# Successor lookup
succs = {t: [] for t in tasks}
for t, (dur, preds) in tasks.items():
for p in preds:
succs[p].append(t)
# Backward pass
ls, lf = {}, {}
for t in reversed(list(tasks)):
lf[t] = min((ls[s] for s in succs[t]), default=end)
ls[t] = lf[t] - tasks[t][0]
total_float = {t: ls[t] - es[t] for t in tasks}
critical = {t for t in tasks if total_float[t] == 0}
def extend(path):
last = path[-1]
nxt = [s for s in succs[last] if s in critical and es[s] == ef[last]]
if not nxt:
yield path
return
for s in nxt:
yield from extend(path + [s])
starts = [t for t in critical if not tasks[t][1]]
paths = [p for s in starts for p in extend([s])]
return end, total_float, paths
end, total_float, paths = critical_paths(tasks)
print(end) # 10
print(total_float) # {'A': 0, 'B': 0, 'C': 0, 'D': 0}
print(paths) # [['A', 'B', 'D'], ['A', 'C', 'D']]A routine that follows only one driving predecessor would return one of these two paths and hide the other. If you report a single path from a tied network, say that it is one of several.
Near-critical paths
Zero float is a sharp line, but real schedules are not sharp. A path with 1 day of float is not critical, yet one day of slip on it makes it critical. A path with 2 days of float can overtake the critical path after a modest delay.
Set a threshold, such as total float of 3 days or less, and list those activities as near-critical. Then watch them with the same attention as the critical path. This is a decision rule, so choose the threshold relative to your typical estimate error and to the project length.
Common mistakes
- Picking the path with the most activities. Length is measured in duration. A path of five 1-day tasks is shorter than a path of one 8-day task.
- Treating zero float as "most important". Critical means no schedule slack. A noncritical activity can still be vital to quality or cost.
- Reading float from a stale schedule. Float changes whenever an actual date, duration, or dependency changes. A critical path from last month may be wrong today.
- Ignoring open ends. An activity with no successor is treated as if it feeds the project end. An activity with no predecessor is treated as if it starts at the project start. If either was a mistake in the data, float is misleading.
- Mixing units. Calendar days and working days give different float values, so keep one unit.
Summary of the method
- Run the forward pass to get ES and EF, and the project end date.
- Run the backward pass from that end date, or from the required date, to get LS and LF.
- Subtract ES from LS for total float.
- Select zero-float activities and join them using the EF equals ES test.
- Report the path, its length, any ties, and the near-critical paths.
Exercise
A project has activities P (5 days, no predecessors), Q (3 days, after P), R (6 days, after P) and S (2 days, after Q and R). Find the total float of each activity, the critical path, and the project duration.
Show answer
Forward pass: P ES 0, EF 5. Q ES 5, EF 8. R ES 5, EF 11. S ES max(8, 11) = 11, EF 13. The project duration is 13 days. Backward pass: S LF 13, LS 11. R LF 11, LS 5. Q LF 11, LS 8. P LF min(LS of Q = 8, LS of R = 5) = 5, LS 0. Total float is LS - ES: P 0, Q 8 - 5 = 3, R 0, S 0. The critical path is P, R, S, which is 5 + 6 + 2 = 13 days. Q has 3 days of float, matching the gap between path P-R-S (13) and path P-Q-S (10).
Exercise
In a schedule, two paths each have a length of 20 days, and a third path has a length of 19 days. How many critical paths are there, and how should you treat the third path?
Show answer
There are two critical paths, because both 20-day paths have zero float. The 19-day path has 1 day of total float, so it is near-critical. It becomes a third critical path after one day of slip, so monitor it alongside the other two.