A graph is a set of points joined by lines. That simple idea models road networks, precedence in a project, and much else — and critical path analysis turns it into a scheduling tool.
Graphs and terminology
A graph has vertices (nodes) joined by edges (arcs).
| Term | Meaning |
|---|---|
| Degree of a vertex | the number of edges meeting it |
| Path | a sequence of edges visiting no vertex twice |
| Cycle | a closed path returning to its start |
| Connected | every vertex is reachable from every other |
| Simple | no loops and no repeated edges |
| Weighted | each edge carries a number — distance, time, cost |
| Digraph | edges have a direction |
The handshaking lemma
Every edge has two ends, so it contributes 1 to the degree of each vertex it touches — 2 in total.
A graph has degrees . How many edges?
An immediate consequence: the number of odd-degree vertices is always even. The total of all degrees is even, so the odd ones must pair up.
Trees and spanning trees
A tree is a connected graph with no cycles. A tree with vertices has exactly
Add one more edge and a cycle appears; remove one and it is no longer connected.
A spanning tree of a graph includes every vertex and enough edges to connect them, with no cycles. A graph with 6 vertices has spanning trees with 5 edges.
A minimum spanning tree has the smallest total weight. Two algorithms find one:
Kruskal's algorithm. Sort all edges by weight. Add them cheapest first, skipping any edge that would create a cycle, until edges are in place.
Prim's algorithm. Start at any vertex. Repeatedly add the cheapest edge joining the tree so far to a vertex not yet in it.
Activity networks
A project is a set of activities, each with a duration and a list of activities that must finish first.
| Activity | Duration | Depends on |
|---|---|---|
| A | 3 | — |
| B | 4 | — |
| C | 2 | A |
| D | 5 | B |
| E | 3 | C and D |
Drawn as a network, activities run along edges (or sit in boxes) and the dependencies fix the order. A and B can start immediately; E must wait for both C and D.
Earliest and latest times
Forward pass — work left to right to find the earliest start (ES) and earliest finish (EF) of each activity. An activity cannot start until all its predecessors have finished, so take the maximum.
| Activity | ES | EF |
|---|---|---|
| A | 0 | 3 |
| B | 0 | 4 |
| C | 3 | 5 |
| D | 4 | 9 |
| E | 12 |
The project duration is 12.
Backward pass — work right to left to find the latest finish (LF) and latest start (LS) without delaying the project. Take the minimum of the successors' latest starts.
| Activity | LS | LF |
|---|---|---|
| E | 9 | 12 |
| D | 4 | 9 |
| C | 7 | 9 |
| B | 0 | 4 |
| A | 4 | 7 |
The critical path and float
the amount an activity can slip without delaying the project.
| Activity | ES | LS | Float |
|---|---|---|---|
| A | 0 | 4 | 4 |
| B | 0 | 0 | 0 |
| C | 3 | 7 | 4 |
| D | 4 | 4 | 0 |
| E | 9 | 9 | 0 |
Activities with zero float are critical: any delay to one delays the whole project. They form the critical path:
which matches the project duration, as it must.