Sub topic 8
Find the Critical Path
Assume you already have a work breakdown structure, task durations, and finish-to-start dependencies. A finish-to-start dependency means that one task must finish before another can begin. This chapter uses elapsed project days, where day 0 is the project start. If you use calendar dates, apply the same calculations while skipping non-working days.
What the critical path means
The critical path is the longest connected sequence of dependent tasks from the project start to its finish. Its length determines the shortest possible project duration under the current schedule.
A task on this path has no scheduling flexibility. If it takes one extra day, the project finish also moves one day later unless you change the plan.
The critical path does not mean the tasks are the most important from a business perspective. It describes timing. A small task can be critical if later work depends on it.
Calculate earliest dates with a forward pass
A forward pass calculates the earliest start and earliest finish for every task.
Use these rules:
- A task with no predecessors starts at day 0.
- A task's earliest start is the latest earliest finish among its predecessors.
- Earliest finish equals earliest start plus duration.
For example, consider this schedule:
| Task | Duration | Predecessors |
|---|---|---|
| Wireframes | 5 days | None |
| Mockups | 7 days | Wireframes |
| Backend | 12 days | Wireframes |
| Frontend | 10 days | Mockups |
| Integration | 4 days | Frontend, Backend |
The forward pass produces these earliest dates:
| Task | Earliest start | Earliest finish |
|---|---|---|
| Wireframes | 0 | 5 |
| Mockups | 5 | 12 |
| Backend | 5 | 17 |
| Frontend | 12 | 22 |
| Integration | 22 | 26 |
Integration cannot start at day 17 because Frontend finishes later, at day 22. Therefore, the project finishes at day 26.
Calculate slack with a backward pass
Slack, also called float, is the amount of time a task can move later without delaying the project finish.
To calculate it, work backward from the project finish:
- Set the latest finish of the final task to the project finish.
- A task's latest finish is the earliest latest start of its successors.
- Latest start equals latest finish minus duration.
- Slack equals latest start minus earliest start.
For the example, the results are:
| Task | Earliest start | Latest start | Slack |
|---|---|---|---|
| Wireframes | 0 | 0 | 0 |
| Mockups | 5 | 5 | 0 |
| Backend | 5 | 10 | 5 |
| Frontend | 12 | 12 | 0 |
| Integration | 22 | 22 | 0 |
Tasks with zero slack form the critical path:
Wireframes → Mockups → Frontend → Integration
Backend has five days of slack. It can start as late as day 10 and still finish by day 22, before Integration needs it.
Verify the calculation with Python
The script below performs both passes. It assumes that each task appears after its predecessors in the dictionary. Durations are simple working periods, not calendar dates.
tasks = {
"Wireframes": (5, []),
"Mockups": (7, ["Wireframes"]),
"Backend": (12, ["Wireframes"]),
"Frontend": (10, ["Mockups"]),
"Integration": (4, ["Frontend", "Backend"]),
}
start, finish = {}, {}
# Forward pass
for name, (duration, predecessors) in tasks.items():
start[name] = max((finish[p] for p in predecessors), default=0)
finish[name] = start[name] + duration
project_finish = max(finish.values())
successors = {name: [] for name in tasks}
for name, (_, predecessors) in tasks.items():
for predecessor in predecessors:
successors[predecessor].append(name)
latest_start, latest_finish = {}, {}
# Backward pass
for name in reversed(list(tasks)):
duration, _ = tasks[name]
latest_finish[name] = min(
(latest_start[successor] for successor in successors[name]),
default=project_finish,
)
latest_start[name] = latest_finish[name] - duration
slack = {name: latest_start[name] - start[name] for name in tasks}
critical_path = [name for name in tasks if slack[name] == 0]
print(f"Project duration: {project_finish} days")
print("Critical path:", " -> ".join(critical_path))
for name in tasks:
print(f"{name}: slack={slack[name]} days")Check the model before trusting the result
The critical path is only as reliable as the schedule model. Recheck these points:
- Every dependency reflects a real constraint.
- No dependency creates a circular loop.
- Durations use the same unit.
- Holidays and non-working days are handled consistently.
- Resource limits are represented if two tasks cannot actually run together.
- Multiple critical paths are possible. A change can create a new critical path after the schedule is updated.
Exercise
Backend finishes on day 17, but Integration starts on day 22 because Frontend finishes on day 22. How much slack does Backend have?
Show answer
Backend has 5 days of slack. It can finish as late as day 22 without delaying Integration.