Salick Academy

Graph Theory and Critical Path Analysis

No calculator

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

degrees=2×(number of edges)\sum \text{degrees} = 2 \times (\text{number of edges})

Every edge has two ends, so it contributes 1 to the degree of each vertex it touches — 2 in total.

A graph has degrees 3,3,2,2,23, 3, 2, 2, 2. How many edges?

degrees=12edges=122=6\sum \text{degrees} = 12 \quad \Rightarrow \quad \text{edges} = \frac{12}{2} = 6

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 nn vertices has exactly

n1 edgesn - 1 \text{ edges}

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 n1n-1 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 max(5,9)=9\max(5,9) = 9 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

float=LSES=LFEF\text{float} = \text{LS} - \text{ES} = \text{LF} - \text{EF}

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:

BDE4+5+3=12 B \to D \to E \qquad 4 + 5 + 3 = 12 \ \checkmark

which matches the project duration, as it must.