Sub topic 1
Modelling a project as an activity network
A critical path calculation starts from a model of the project, not from a calendar. This chapter shows how to turn a task list into an activity network: a set of activities, their durations, and the dependencies between them. Every later calculation in this tutorial (forward pass, backward pass, float, critical path) runs on that model, so errors made here carry through to every result.
Prerequisites
This chapter assumes you already know:
- Basic project management terms: task, duration, milestone, dependency.
- How to read a simple task list or Gantt chart.
- Arithmetic with durations in days.
- Optionally, for the code examples: Python dictionaries, loops, and functions.
You do not need to know any scheduling algorithm yet.
From task list to network
A task list tells you what work exists. A network also tells you what must happen before what. The two views hold the same activities, but only the network can answer the question "how soon can this project finish?"
An activity network has three ingredients:
- Nodes or arrows that stand for activities. An activity is a piece of work with a start, a finish, and a duration.
- Dependencies. A dependency is a rule that one activity cannot start (or finish) until another has started (or finished).
- Durations. Each activity carries one number of working time, covered in the next chapter.
Two drawing conventions exist:
| Convention | Activities are | Dependencies are | Typical use |
|---|---|---|---|
| Activity-on-node (AON), also called precedence diagramming | Boxes (nodes) | Arrows between boxes | Most modern scheduling tools |
| Activity-on-arrow (AOA), also called arrow diagramming | Arrows | Nodes (events) between arrows | Older texts, some construction scheduling |
This tutorial uses activity-on-node. AON needs no placeholder activities. AOA sometimes needs a "dummy" activity (zero duration, drawn as a dashed arrow) to express a dependency that no real work represents. AON also supports dependency types other than finish-to-start without extra tricks, which a later chapter covers.
A small worked example
Suppose a team is preparing a product release with four activities:
| Activity | Description | Duration (days) | Predecessors |
|---|---|---|---|
| A | Write specification | 3 | none |
| B | Draft user guide | 2 | A |
| C | Build feature | 4 | A |
| D | Final review | 3 | B, C |
A predecessor of an activity is one that must be done before it can proceed. A successor is the reverse: an activity that waits on it. In the table, A is a predecessor of B and C, and B and C are both predecessors of D. Recording predecessors is enough, because successors can be derived from them. Many tools store only predecessors for that reason.
Here is the same project as a diagram.
The network has a shape you will meet constantly: it splits after A (B and C can run in parallel) and merges before D (D needs both). Splits and merges are where schedule risk concentrates, because a merge activity waits for the slowest of its predecessors.
What counts as a dependency
A dependency belongs in the network only if it is a real constraint on ordering. Project management guides usually sort dependencies by where the constraint comes from:
- Mandatory (hard logic). Physics or contract forces the order. You cannot paint a wall before it is built.
- Discretionary (soft logic). The team prefers an order by convention or best practice, but could choose another. For example, finishing the database design before building screens.
- External. The constraint comes from outside the project, such as a supplier delivery or a regulator's approval.
- Internal. The constraint comes from inside the team's own control, such as one engineer needing to finish a module before testing it.
The distinction matters later. Discretionary dependencies are the first candidates to relax when you need to shorten a schedule, and mandatory ones are not. If you record every dependency as equally firm, you lose that option.
Common modelling mistakes
- Too many dependencies. Adding "just in case" links makes the network look longer than the work really is. Each unnecessary link can lengthen the longest path.
- Too few dependencies. Missing links make activities appear to start earlier than they can. The schedule looks short and then slips.
- Dependencies on a person, not on work. "Wait for Priya" is a resource constraint, not a logical dependency. Resources are handled separately, in a later chapter.
- Activities too large. An activity called "Development" with a 60-day duration hides internal ordering. Break it down until each activity has a clear output and a single owner.
- Activities too small. Hundreds of one-hour activities make the network hard to maintain without improving the answer.
Milestones and the start and finish of the project
A milestone is an event with zero duration, such as "Specification approved". Milestones are useful in a network because they give a single point that several activities can depend on. They never add time to a path.
Networks should have exactly one logical start and one logical finish. If several activities have no predecessors, each is a start activity. If several have no successors, each is an end activity. It is common practice to add a zero-duration "Project start" milestone ahead of all start activities and a "Project end" milestone after all end activities. This keeps the algorithms simple, because every path then begins and ends at one known place.
Representing the network in code
The following Python stores the network as a dictionary. Each key is an activity name, and each value holds a duration and a list of predecessors. The code derives the successor lists, then finds the start and end activities.
tasks = {
"A": {"duration": 3, "preds": []},
"B": {"duration": 2, "preds": ["A"]},
"C": {"duration": 4, "preds": ["A"]},
"D": {"duration": 3, "preds": ["B", "C"]},
}
def build_successors(tasks):
"""Derive each activity's successors from the stored predecessors."""
succs = {name: [] for name in tasks}
for name, info in tasks.items():
for pred in info["preds"]:
succs[pred].append(name)
return succs
succs = build_successors(tasks)
starts = [n for n, info in tasks.items() if not info["preds"]]
ends = [n for n in tasks if not succs[n]]
print(succs) # {'A': ['B', 'C'], 'B': ['D'], 'C': ['D'], 'D': []}
print(starts) # ['A']
print(ends) # ['D']Storing only predecessors keeps the data in one place. Storing both directions by hand invites inconsistency, where B lists A as a predecessor but A does not list B as a successor.
If a predecessor name is misspelled, succs[pred] raises a KeyError. That failure is useful, because a link to an activity that does not exist is a real error in the model. A fuller check of the network is the subject of a later chapter.
Connecting the network to the critical path
The activity network is the only input the critical path method needs, apart from the durations. Later chapters use the network in this order:
- Enumerate the paths through the network and add up their lengths.
- Check that the network has no cycles and no open ends.
- Run the forward pass to get earliest start and finish times.
- Run the backward pass to get latest start and finish times.
- Compare the two to get float, and read the critical path from the zero-float activities.
For the four-activity example, there are two paths: A, B, D (3 + 2 + 3 = 8 days) and A, C, D (3 + 4 + 3 = 10 days). The longer one, A, C, D, sets the minimum project duration. You can see this by inspection here. With hundreds of activities you cannot, which is why the method exists. It also explains why the network must be right: change one link, such as making B a predecessor of C, and the longest path changes.
Summary of the modelling rules
- Model each piece of work as an activity with a duration.
- Record dependencies as predecessor links, and derive successors from them.
- Prefer activity-on-node diagrams, which avoid dummy activities.
- Keep only real ordering constraints, and separate resource limits from logic.
- Give the network one start and one finish, adding zero-duration milestones if needed.
Exercise
A project has activities P (2 days, no predecessors), Q (5 days, predecessor P), R (3 days, predecessor P), S (1 day, predecessors Q and R) and T (2 days, predecessor R). List the successors of each activity, identify the start and end activities, and say which activity is a merge point.
Show answer
Successors: P has Q and R; Q has S; R has S and T; S has none; T has none. The start activity is P. The end activities are S and T, so the network has two ends, and a zero-duration "Project end" milestone after both would give it a single finish. S is the merge point, because it waits for both Q and R.
Exercise
Your team lists "Wait for the one available tester" as a predecessor of Test login and Test checkout, which share a single tester. What kind of constraint is this, and where should it be handled?
Show answer
It is a resource constraint, not a logical dependency, because the work itself could be done in either order or in parallel if more testers were available. Leave it out of the network logic and handle it during resource analysis, which a later chapter covers. Recording it as a dependency would hide that the real limit is staffing.