15.11 Network Flow Models: Shortest Route, Maximal Flow & Spanning Tree

Key Takeaways

  • Network flow models are named explicitly in the Operations Research bullet of the CIL Mechanical Paper-II syllabus, separately from PERT and CPM.
  • The shortest route problem finds the minimum-cost path between two nodes and is solved systematically by Dijkstra's labelling algorithm.
  • The maximal flow through a network equals the capacity of the minimum cut, which is the max-flow min-cut theorem.
  • A minimum spanning tree connects all n nodes using exactly n minus 1 arcs at least total cost, and is found greedily by Kruskal's or Prim's algorithm.
Last updated: August 2026

Network Terminology

A network is a set of nodes connected by arcs. Each arc may carry a length, a cost, a time or a capacity depending on the problem.

TermMeaning
Node (vertex)A junction, location or state
Arc (edge, branch)A connection between two nodes
Directed arcFlow permitted in one direction only
Undirected arcFlow permitted in either direction
PathA sequence of arcs connecting two nodes
Cycle (loop)A path that returns to its starting node
TreeA connected network containing no cycles
Spanning treeA tree containing all nodes of the network
Connected networkEvery node reachable from every other

A key structural fact used repeatedly: a spanning tree of an $n$-node network contains exactly $n-1$ arcs. Fewer leaves it disconnected; more creates a cycle.

The Operations Research bullet of the syllabus lists network flow models separately from PERT and CPM. Project networks are treated in the project-management section; this section covers the three classical flow problems.

The Shortest Route Problem

Find the minimum-total-length path from a source node to a destination. The arc values may be distance, time or cost.

Dijkstra's labelling algorithm

  1. Label the source node permanently with 0.
  2. From the most recently permanently labelled node, give each directly connected unlabelled node a temporary label equal to the permanent label plus the connecting arc length. If it already has a temporary label, keep the smaller of the two.
  3. Among all temporary labels, make the smallest permanent.
  4. Repeat from step 2 until the destination is permanently labelled.
  5. Backtrack from the destination to recover the route.

The algorithm requires non-negative arc lengths, which is always satisfied by physical distances, times and costs.

Worked example

A network of haul roads connects the pit (node 1) to the washery (node 6):

ArcLength (km)
1-24
1-32
2-45
3-21
3-58
2-510
4-66
5-63

Step by step:

  • Node 1 permanent at 0.
  • Temporary: node 2 gets 4, node 3 gets 2. Smallest is node 3, so node 3 permanent at 2.
  • From node 3: node 2 gets $2 + 1 = 3$, which beats its existing 4, so update to 3. Node 5 gets $2 + 8 = 10$. Smallest temporary is node 2 at 3, so node 2 permanent at 3.
  • From node 2: node 4 gets $3 + 5 = 8$; node 5 gets $3 + 10 = 13$, worse than 10, so keep 10. Smallest is node 4 at 8, so node 4 permanent at 8.
  • From node 4: node 6 gets $8 + 6 = 14$. Smallest temporary is node 5 at 10, so node 5 permanent at 10.
  • From node 5: node 6 gets $10 + 3 = 13$, which beats 14, so update. Node 6 permanent at 13.

The shortest route is 1 - 3 - 5 - 6 with total length 13 km. Note that the direct-looking route through node 2 and node 4 is longer at 14 km, and that node 2's label was improved from 4 to 3 during the process — the step candidates most often skip.

The Maximal Flow Problem

Find the greatest flow that can be pushed from a source to a sink when each arc has a limited capacity. Applications include water and slurry pipelines, conveyor networks, ventilation circuits and traffic on haul roads.

The max-flow min-cut theorem

A cut is a set of arcs whose removal disconnects the source from the sink. The capacity of a cut is the sum of the capacities of its forward arcs.

The maximum flow from source to sink equals the capacity of the minimum cut.

This is one of the most elegant results in operations research and it has an immediate practical reading: the bottleneck is a set of arcs, not a single arc. Increasing the capacity of any arc not in the minimum cut achieves nothing at all.

The augmenting path algorithm

  1. Find any path from source to sink with spare capacity on every arc.
  2. Determine the bottleneck, the smallest remaining capacity along that path.
  3. Push that amount of flow along the path, reducing the forward capacity of each arc by it and increasing the reverse capacity by the same amount.
  4. Repeat until no augmenting path remains.
  5. The total pushed is the maximum flow; verify against the minimum cut.

The reverse-capacity step in stage 3 is essential rather than cosmetic. It permits later iterations to cancel an earlier flow assignment that turns out to be suboptimal, and without it the algorithm can terminate short of the true maximum.

Worked example: maximal flow

A slurry network runs from source S to sink T:

ArcCapacity
S-A10
S-B8
A-C6
A-B4
B-C5
B-D7
C-T9
D-T6

Augmenting paths:

  • S-A-C-T: bottleneck is $\min(10, 6, 9) = 6$. Push 6. Remaining: S-A 4, A-C 0, C-T 3.
  • S-B-D-T: bottleneck is $\min(8, 7, 6) = 6$. Push 6. Remaining: S-B 2, B-D 1, D-T 0.
  • S-B-C-T: bottleneck is $\min(2, 5, 3) = 2$. Push 2. Remaining: S-B 0, B-C 3, C-T 1.
  • S-A-B-C-T: bottleneck is $\min(4, 4, 3, 1) = 1$. Push 1. Remaining: C-T 0.

No further path exists, since both C-T and D-T are saturated. Maximum flow = 6 + 6 + 2 + 1 = 15.

Check against the minimum cut: the cut ${C\text{-}T,; D\text{-}T}$ has capacity $9 + 6 = 15$. The cut ${S\text{-}A,; S\text{-}B}$ has capacity $10 + 8 = 18$. The minimum is 15, matching the flow. Confirmed.

The engineering conclusion is that upgrading the S-A pipeline would achieve nothing; only enlarging C-T or D-T raises throughput.

The Minimum Spanning Tree Problem

Connect all nodes at least total cost, with no requirement that any particular pair be connected directly. Applications include laying power cables to a group of mine substations, routing a compressed-air ring main, and planning a communication network.

The distinction from the shortest route problem is worth stating explicitly: shortest route connects two specified nodes by the cheapest path; minimum spanning tree connects all nodes at least total cost. They generally give different answers.

Kruskal's algorithm (arc-based)

  1. Sort all arcs in ascending order of cost.
  2. Add arcs one at a time in that order, skipping any arc that would form a cycle.
  3. Stop when $n - 1$ arcs have been added.

Prim's algorithm (node-based)

  1. Start from any node.
  2. Repeatedly add the cheapest arc connecting a node already in the tree to one not yet in it.
  3. Stop when all $n$ nodes are included.

Both are greedy algorithms and both are guaranteed to reach a true optimum for this problem — which is unusual, since greedy methods generally do not. Prim's is easier to apply by hand because it never requires an explicit cycle check.

Worked example

Six substations are to be connected by cable:

ArcCostArcCost
1-253-44
1-333-58
2-364-52
2-474-69
5-66

Applying Kruskal, arcs in ascending order: 4-5 (2), 1-3 (3), 3-4 (4), 1-2 (5), 5-6 (6), 2-3 (6), 2-4 (7), 3-5 (8), 4-6 (9).

  • Add 4-5 (2). Tree has 1 arc.
  • Add 1-3 (3). 2 arcs.
  • Add 3-4 (4). 3 arcs. This links the two fragments.
  • Add 1-2 (5). 4 arcs.
  • Next is 5-6 (6). Add it. 5 arcs.

With $n = 6$ nodes we need $n - 1 = 5$ arcs, and we have them. The arcs 2-3, 2-4, 3-5 and 4-6 are all rejected, either because five arcs suffice or because they would close a cycle.

Minimum spanning tree cost $= 2 + 3 + 4 + 5 + 6 = \textbf{20}$.

Summary of the Three Problems

ProblemObjectiveMethodArc attribute
Shortest routeCheapest path between two nodesDijkstra labellingLength, time or cost
Maximal flowGreatest throughput source to sinkAugmenting paths; verify by min cutCapacity
Minimum spanning treeConnect all nodes at least costKruskal or PrimCost

A common examination trap is to present a minimum spanning tree problem in language that sounds like a shortest route problem, or the reverse. The test is simple: if the requirement is to link every location, it is a spanning tree; if it is to travel from one specified place to another, it is a shortest route.

Test Your Knowledge

According to the max-flow min-cut theorem, the maximum flow from source to sink in a capacitated network equals:

A
B
C
D
Test Your Knowledge

A minimum spanning tree of a network with n nodes contains exactly how many arcs?

A
B
C
D
Test Your Knowledge

In Dijkstra's shortest route algorithm, a temporary label on a node may be:

A
B
C
D
Test Your Knowledge

Which problem is being solved when cable must be laid to connect all six substations of a mine at the lowest total cost, with no requirement about which pairs connect directly?

A
B
C
D
Congratulations!

You've completed this section

Continue exploring other exams