Sub topic 1
Modelling a project as an activity network
Prerequisites
This chapter assumes you know what a task, a duration, a milestone, and a dependency are. You should be able to read a simple task list or Gantt chart and add durations in days. Basic Python (dictionaries, loops, functions) helps with the code, but you can follow the logic without it.
Activities, durations, and dependencies
An activity network is a diagram of a project. Each box is an activity, a piece of work with a duration. Each arrow is a dependency, which means one activity must finish before the next one can start.
Activity durations and what they assume
A duration is your estimate of how long an activity takes. The method treats each estimate as fixed. It assumes the same team works at the same pace and that no delays occur outside the network. Treat the results as a plan built on those estimates, not as a forecast.
Paths through the network and their lengths
A path is any chain of activities that follows the arrows from start to finish. Its length is the sum of its durations. In the network above, A, B, D is 8 days, and A, C, D is 10 days.
Checking the network before you calculate
Check three things before you calculate:
- No cycles. A cycle is a loop, such as A depends on D and D depends on A. A cycle makes the schedule impossible.
- No open ends. Every activity except the last should have a successor, and every activity except the first should have a predecessor.
- Every duration is a number of days, not a blank or a range.
The forward pass: earliest start and finish
The forward pass moves from start to finish. An activity's earliest start is the latest earliest finish among its predecessors. Its earliest finish is its earliest start plus its duration.
tasks = {
"A": (3, []),
"B": (2, ["A"]),
"C": (4, ["A"]),
"D": (3, ["B", "C"]),
}
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
print(ef) # {'A': 3, 'B': 5, 'C': 7, 'D': 10}Exercise
Using the forward pass, what is the earliest finish of D?
Show answer
10 days. D starts when the later of B (day 5) and C (day 7) finishes, so it starts on day 7 and finishes on day 10.
Estimate: