Sub topic 12
Dependencies and the Critical Path
Assume you know basic project terms such as task, milestone, deliverable, and schedule. This chapter focuses on how task relationships turn effort estimates into a project duration.
Model dependencies before scheduling
A dependency is a relationship that determines when one task can start or finish. For example, testing may depend on the application being available. The first task is the predecessor; the later task is the successor.
Common dependency types include:
- Finish-to-start: Task B cannot start until Task A finishes. This is the most common type.
- Start-to-start: Task B can start when Task A starts, perhaps after a short delay.
- Finish-to-finish: Task B cannot finish until Task A finishes.
- External dependency: Your team depends on a supplier, approval, or other outside event.
A dependency is different from a preference. “Design should finish before development” is a dependency if development cannot proceed without the design. If both can proceed with partial information, model the relationship more carefully instead of forcing a complete sequence.
Find the critical path
The critical path is the longest connected path through the dependency network. Its length determines the earliest possible project completion date under the stated assumptions.
In the diagram, the path Research → Design → Build → Test takes 12 days. Research → Test takes only 4 days, so it does not determine the finish date. If any task on the 12-day path takes longer, the project finish usually moves by the same amount.
A task's float, also called slack, is the time it can slip without delaying the project finish. Tasks on the critical path have zero float in a simple schedule. A task can become critical later when estimates change or another path gains delays.
| Task | Duration | Predecessor | Path role |
|---|---|---|---|
| Research | 2 days | None | Critical |
| Design | 3 days | Research | Critical |
| Build | 5 days | Design | Critical |
| Test | 2 days | Build | Critical |
Do not confuse the critical path with the busiest team or the task with the largest estimate. A short task can be critical if it has no scheduling flexibility. A long task can have float if other work can continue while it runs.
Calculate a basic path
For a small network, list each task's earliest start and finish:
- Set the earliest start of a task to the latest earliest finish of its predecessors.
- Add the task duration to get its earliest finish.
- The largest earliest finish is the earliest project completion.
- Trace backward through the predecessor that produced each latest finish. That chain is the critical path.
The following code finds the longest finish-to-start path in a small directed acyclic graph:
tasks = {
"research": (2, []),
"design": (3, ["research"]),
"build": (5, ["design"]),
"test": (2, ["build", "research"]),
}
finish = {}
path = {}
for name, (duration, predecessors) in tasks.items():
if predecessors:
predecessor = max(predecessors, key=lambda item: finish[item])
start = finish[predecessor]
path[name] = path[predecessor] + [name]
else:
start = 0
path[name] = [name]
finish[name] = start + duration
end = max(finish, key=finish.get)
print(f"Project duration: {finish[end]} days")
print("Critical path:", " -> ".join(path[end]))This calculation assumes tasks are ordered before the loop runs. A production scheduler must also detect cycles, such as A depending on B while B depends on A.
Exercise
Design takes 3 days and depends on research, which takes 2 days. Build takes 4 days and depends on design. Documentation takes 3 days and depends only on research. Which path controls the earliest finish?
Show answer
Research → Design → Build controls the finish at 9 days. Research → Documentation takes 5 days, so documentation has 4 days of float if no other constraints apply.