Sub topic 1
Activities, Durations and Dependencies in a Schedule Network
Prerequisites
This chapter assumes you know basic project vocabulary (scope, schedule, cost, resources), can read a simple activity network or Gantt chart, and can add durations.
Activities, durations and dependencies
A schedule network is a diagram of a project's activities. Each activity has a duration, and some activities cannot start until others finish. Those links are dependencies. In this chapter, every dependency is finish-to-start: a successor begins only after its predecessor ends.
Finding the critical path
The critical path is the longest chain of dependent activities through the network. Its total duration sets the project duration. The following code runs a forward pass to find the earliest finish of each activity.
activities = {
"A": (3, []),
"B": (5, ["A"]),
"C": (4, ["A"]),
"D": (3, ["B", "C"]),
}
finish = {}
for name, (dur, preds) in activities.items():
start = max((finish[p] for p in preds), default=0)
finish[name] = start + dur
print("Project duration:", max(finish.values())) # 11The path A, B, D takes 11 days. The path A, C, D takes 10 days, so it is not critical.
Float and near-critical paths
Float (also called slack) is the delay an activity can absorb without moving the project finish. Activities on the critical path have zero float. The next code block adds a backward pass to compute float for each activity.
duration = max(finish.values())
late_start = {}
for name in reversed(list(activities)):
dur, _ = activities[name]
succs = [s for s, (_, p) in activities.items() if name in p]
late_finish = min((late_start[s] for s in succs), default=duration)
late_start[name] = late_finish - dur
for name, (dur, _) in activities.items():
early_start = finish[name] - dur
print(name, late_start[name] - early_start) # A 0, B 0, C 1, D 0Activity C has 1 day of float. It is a near-critical activity: a 2-day delay to C would push the project finish out by 1 day.
> Ignore a near-critical path at your peril. Compressing only the critical path can make a near-critical path the new critical path.
Why and when to compress a schedule
Compression shortens the duration without changing scope. Teams compress when a deadline is fixed, when a delay has already pushed the finish date, or when a late finish would cost more than the extra effort. Only critical-path activities can shorten the project, so compression starts there.
Exercise
In the network above, by how many days can activity B be extended before the project duration grows?
Show answer
B has zero float, so any extension increases the project duration. B cannot be extended for free.