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.

Last updated: October 2026

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

TermMeaningIndustrial example
Node (vertex)A point in the networkPlant, warehouse, workstation, intersection
Arc (edge)A connection between two nodesRoad, conveyor, pipeline, data link
Directed arcFlow allowed one way onlyOne-way aisle, pipeline with check valve
PathA sequence of arcs joining two nodesA route from plant to customer
CycleA path that returns to its start nodeA loop in a conveyor network
Connected graphEvery node can reach every other nodeA complete plant utility grid
TreeA connected graph with no cyclesA branch power distribution
Spanning treeA tree that touches all nn nodes; it has exactly n−1n - 1 arcsThe 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):

ArcS–AS–BA–BA–CB–CB–DC–DC–TD–T
Length4215810263

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):

  1. Give the source a permanent label of 0 and every other node a tentative label of infinity.
  2. 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.
  3. Make the node with the smallest tentative label permanent.
  4. Repeat until the destination is permanent, then trace predecessors back to the source.

Worked example (shortest path S to T):

StepNode made permanentLabelUpdates made
1S0A = 4 (via S), B = 2 (via S)
2B2A = min(4, 2 + 1) = 3 (via B); C = 10; D = 12
3A3C = min(10, 3 + 5) = 8 (via A)
4C8D = min(12, 8 + 2) = 10 (via C); T = 14 (via C)
5D10T = min(14, 10 + 3) = 13 (via D)
6T13Done

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 n−1n - 1 arcs are chosen.

Arc (length)DecisionReason
A–B (1)AddNo cycle
S–B (2)AddNo cycle
C–D (2)AddNo cycle
D–T (3)AddNo cycle
S–A (4)RejectS, A, B are already connected
A–C (5)AddJoins {S, A, B} to {C, D, T}; 5 arcs = n−1n - 1, 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):

ArcS→AS→BA→BA→CB→DD→CC→TD→T
Capacity108469386

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.

  1. Path S→A→C→T: bottleneck min(10, 6, 8) = 6. Send 6.
  2. Path S→B→D→T: bottleneck min(8, 9, 6) = 6. Send 6.
  3. 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.
  4. 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 8+6=148 + 6 = 14. 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 askedModelHand method
Best route between two pointsShortest pathDijkstra labels
Connect all points at least total lengthMinimal spanning treeKruskal or Prim
Most throughput from source to sinkMaximum flowAugmenting paths; verify with a cut
Least-cost shipping from supplies to demandsTransportation or transshipmentVAM and MODI, or LP
One-to-one pairing at least costAssignmentHungarian method
Earliest project completionLongest path (CPM)Forward and backward pass
Test Your Knowledge

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?

A

11

B

12

C

13

D

15

Test Your Knowledge

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?

A

165 m

B

175 m

C

185 m

D

200 m

Test Your Knowledge

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?

A

Maximum throughput exceeds 1,200 cartons per hour because flow can split around the cut

B

Maximum throughput is the average of all cut capacities in the network

C

Maximum throughput is exactly 1,200 cartons per hour, and only those arcs limit it

D

Maximum throughput cannot be known without simulating the conveyor

Sections you finish are checked off in the contents.