2.4 Graph Theory & Network Models: Shortest Path, Minimal Spanning Tree & Maximum Flow
Key Takeaways
A network is a set of nodes joined by arcs; directed arcs allow flow one way, and a spanning tree connects all n nodes with exactly n − 1 arcs and no cycles.
Dijkstra's algorithm finds shortest paths from a source by permanently labeling, at each step, the unlabeled node with the smallest tentative distance; it requires non-negative arc lengths.
Kruskal's algorithm builds a minimal spanning tree by adding the cheapest remaining arc that does not form a cycle until n − 1 arcs are chosen.
The max-flow min-cut theorem states that the maximum flow from source to sink equals the smallest total capacity of any cut separating them.
Transportation, transshipment, assignment, and CPM scheduling problems are all special network models, so the same node-and-arc thinking applies across the exam.
2.4 Graph Theory & Network Models
The specification names graph theory and networks among the modeling techniques. Network models are linear programs with a special structure, but they have fast hand-solution methods. That makes them good exam material: a few minutes of careful bookkeeping gives an exact answer.
1. Graph Theory Vocabulary
| Term | Meaning | Industrial example |
|---|---|---|
| Node (vertex) | A point in the network | Plant, warehouse, workstation, intersection |
| Arc (edge) | A connection between two nodes | Road, conveyor, pipeline, data link |
| Directed arc | Flow allowed one way only | One-way aisle, pipeline with check valve |
| Path | A sequence of arcs joining two nodes | A route from plant to customer |
| Cycle | A path that returns to its start node | A loop in a conveyor network |
| Connected graph | Every node can reach every other node | A complete plant utility grid |
| Tree | A connected graph with no cycles | A branch power distribution |
| Spanning tree | A tree that touches all nodes; it has exactly arcs | The minimum set of cables linking all buildings |
Many exam models are special cases of network flow. The transportation and assignment problems are bipartite networks, the transshipment problem adds intermediate nodes, and CPM finds the longest path through a project network.
The example network for the rest of this section has six nodes (S, A, B, C, D, T) and nine undirected arcs with these lengths (miles or costs):
| Arc | S–A | S–B | A–B | A–C | B–C | B–D | C–D | C–T | D–T |
|---|---|---|---|---|---|---|---|---|---|
| Length | 4 | 2 | 1 | 5 | 8 | 10 | 2 | 6 | 3 |
2. Shortest Path: Dijkstra's Algorithm
Use: fastest route for a delivery truck or AGV, least-cost path through a supply network, or equipment replacement modeled as a path.
Procedure (non-negative arc lengths only):
- Give the source a permanent label of 0 and every other node a tentative label of infinity.
- From the node most recently made permanent, update each neighbor's tentative label to the smaller of its current label and (permanent label + arc length). Record the predecessor.
- Make the node with the smallest tentative label permanent.
- Repeat until the destination is permanent, then trace predecessors back to the source.
Worked example (shortest path S to T):
| Step | Node made permanent | Label | Updates made |
|---|---|---|---|
| 1 | S | 0 | A = 4 (via S), B = 2 (via S) |
| 2 | B | 2 | A = min(4, 2 + 1) = 3 (via B); C = 10; D = 12 |
| 3 | A | 3 | C = min(10, 3 + 5) = 8 (via A) |
| 4 | C | 8 | D = min(12, 8 + 2) = 10 (via C); T = 14 (via C) |
| 5 | D | 10 | T = min(14, 10 + 3) = 13 (via D) |
| 6 | T | 13 | Done |
Tracing back: T ← D ← C ← A ← B ← S. The shortest path is S–B–A–C–D–T with length 13. The direct-looking route S–A–C–T has length 15, which shows why greedy choices made from the source are not enough.
Warning
Dijkstra's algorithm can fail with negative arc lengths, such as a cost network that includes a rebate. Those cases need the Bellman-Ford algorithm or an LP formulation.
3. Minimal Spanning Tree (MST)
Use: connect every node at minimum total arc length when anything that is connected can reach anything else. Examples are laying fiber or compressed-air lines to all buildings, or connecting all sensors in a plant.
Kruskal's algorithm: sort arcs from shortest to longest. Add each arc in order unless it creates a cycle. Stop when arcs are chosen.
| Arc (length) | Decision | Reason |
|---|---|---|
| A–B (1) | Add | No cycle |
| S–B (2) | Add | No cycle |
| C–D (2) | Add | No cycle |
| D–T (3) | Add | No cycle |
| S–A (4) | Reject | S, A, B are already connected |
| A–C (5) | Add | Joins {S, A, B} to {C, D, T}; 5 arcs = , so stop |
The MST uses arcs A–B, S–B, C–D, D–T, and A–C, for a total length of 13. Prim's algorithm gives the same tree by growing from any node and always adding the cheapest arc leaving the current tree.
Note
The MST is not the same as the set of shortest paths. Here the MST and the S-to-T shortest path both total 13 by coincidence, but the MST must reach every node, while a shortest path only joins two nodes.
4. Maximum Flow and the Max-Flow Min-Cut Theorem
Use: the most material, vehicles, or data that can move from a source to a sink through arcs with limited capacity, such as conveyor throughput, pipeline capacity, or evacuation routes.
Directed capacities (units per hour):
| Arc | S→A | S→B | A→B | A→C | B→D | D→C | C→T | D→T |
|---|---|---|---|---|---|---|---|---|
| Capacity | 10 | 8 | 4 | 6 | 9 | 3 | 8 | 6 |
Augmenting-path method (Ford–Fulkerson): find any path from S to T with spare capacity on every arc, send the smallest spare capacity along it, update the residual capacities, and repeat until no path remains.
- Path S→A→C→T: bottleneck min(10, 6, 8) = 6. Send 6.
- Path S→B→D→T: bottleneck min(8, 9, 6) = 6. Send 6.
- Path S→B→D→C→T: residuals are S→B 2, B→D 3, D→C 3, C→T 2, so the bottleneck is 2. Send 2.
- Arcs C→T and D→T are now full, so no path reaches T. Maximum flow = 14.
Check with a cut. A cut is a set of arcs whose removal separates S from T; its capacity is the total capacity of the arcs crossing from the S side to the T side. The cut {C→T, D→T} has capacity . Cutting the source arcs {S→A, S→B} would cost 18. The max-flow min-cut theorem says the maximum flow equals the minimum cut capacity, so 14 is optimal. The saturated arcs into T are the bottleneck; adding capacity anywhere else cannot raise throughput.
5. Choosing the Right Network Model
| Question asked | Model | Hand method |
|---|---|---|
| Best route between two points | Shortest path | Dijkstra labels |
| Connect all points at least total length | Minimal spanning tree | Kruskal or Prim |
| Most throughput from source to sink | Maximum flow | Augmenting paths; verify with a cut |
| Least-cost shipping from supplies to demands | Transportation or transshipment | VAM and MODI, or LP |
| One-to-one pairing at least cost | Assignment | Hungarian method |
| Earliest project completion | Longest path (CPM) | Forward and backward pass |
Using the six-node example network in this section, a planner adds a new arc A–T with length 9. What is the new shortest path length from S to T?
11
12
13
15
Five buildings must be connected with underground compressed-air piping. The candidate pipe runs (in meters) are 1–2: 40, 1–3: 65, 2–3: 30, 2–4: 70, 3–4: 50, 3–5: 80, 4–5: 45. What is the minimum total length of piping that connects all five buildings?
165 m
175 m
185 m
200 m
In a maximum-flow study of a plant conveyor network, the engineer finds a set of arcs with a total capacity of 1,200 cartons per hour whose removal disconnects the source from the sink, and no cut with a smaller capacity exists. What can be concluded?
Maximum throughput exceeds 1,200 cartons per hour because flow can split around the cut
Maximum throughput is the average of all cut capacities in the network
Maximum throughput is exactly 1,200 cartons per hour, and only those arcs limit it
Maximum throughput cannot be known without simulating the conveyor
Sections you finish are checked off in the contents.