Mathematics (UK)

🇬🇧 United Kingdom Curriculum

Lesson 19: Decision Maths — Networks (Intro)

🎧 Audio narration for this lesson is coming soon.

Decision mathematics asks: what is the best route, the cheapest network, the smartest schedule? It is the mathematics behind sat-navs, delivery rounds for Royal Mail, fibre-broadband rollouts, and project planning. This introduction covers graphs and networks, traversability, Dijkstra's shortest-path algorithm, and minimum spanning trees — algorithms you can run by hand that power real logistics across the UK.

Graphs, nodes, and edges

A graph (network) is a set of nodes/vertices (points) joined by edges/arcs (lines). Edges may carry weights (distances, times, costs) and may be directed (one-way). The degree of a vertex is the number of edges meeting there. Simple facts: the sum of all degrees = 2 × (number of edges), so the number of odd-degree vertices is always even.

A trail uses no edge twice; a path repeats no vertex; a cycle is a closed path. Graphs model anything with connections: the London Underground (stations = vertices, lines = edges), motorway junctions, computer networks, friendships in a school year group. Real exam skill: translating a scenario into a clean sketch graph with weights labelled.

Worked example: five towns A–E with road distances (km): A–B 4, A–C 7, B–C 3, B–D 6, C–D 2, C–E 5, D–E 3. Vertex degrees: A:2, B:3, C:4, D:3, E:2 — sum 14 = 2 × 7 edges. ✓ Two odd vertices (B and D) — remember that count; it decides the next section.

Traversability — Euler's insight

A graph is traversable (Eulerian) if you can draw it without lifting your pen or reusing an edge, returning to the start — possible exactly when every vertex has even degree. If exactly two vertices have odd degree, a trail exists that uses every edge once but starts at one odd vertex and ends at the other (a semi-Eulerian trail). More odd vertices: impossible without retracing.

For the towns graph above (odd vertices B, D), a route inspection trail exists from B to D covering every road once. The Königsberg bridges problem (1736) launched this subject: four land masses joined by seven bridges, with odd degrees everywhere — Euler proved the stroll impossible. The same mathematics schedules gritting lorries and postal rounds.

Route inspection (Chinese postman): to traverse every edge and return to the start with minimum retracing, pair up the odd vertices and add the shortest paths between pairs. Worked example: a postie in Bath must cover a network of streets totalling 340 m whose odd vertices are P and Q, joined by a shortest path of 140 m. Minimum round route = 340 + 140 = 480 m (the P–Q streets are walked twice). With four odd vertices, compare the three possible pairings and take the cheapest total — that comparison is the exam question.

Dijkstra's algorithm — shortest paths

Dijkstra's algorithm finds the shortest route from a start vertex to everywhere else. Method: give the start a permanent label 0; repeatedly, from the most recently made permanent vertex, update the working values of its neighbours (permanent label + edge weight), keeping the smaller value; make the smallest working value permanent; repeat. When your target becomes permanent, its label is the shortest distance — trace back through the vertices that produced each label to recover the route.

Worked example: find the shortest route from A to F in this network: A–B 4, A–C 2, C–B 1, C–D 5, B–D 3, B–E 7, D–E 2, D–F 6, E–F 3. Run it:

  • Permanent A = 0. Working: B = 4, C = 2.
  • Smallest working is C (2) → permanent. From C: B = min(4, 2 + 1) = 3; D = 2 + 5 = 7.
  • Smallest working is B (3) → permanent. From B: D = min(7, 3 + 3) = 6; E = 3 + 7 = 10.
  • Smallest working is D (6) → permanent. From D: E = min(10, 6 + 2) = 8; F = 6 + 6 = 12.
  • Smallest working is E (8) → permanent. From E: F = min(12, 8 + 3) = 11.
  • F permanent at 11.

Shortest distance A to F = 11, via A–C–B–D–E–F (2 + 1 + 3 + 2 + 3 = 11 ✓). Every sat-nav in Britain runs a vastly larger version of exactly this. Record working values in a table — in exams, the method marks live in those numbers, not the final answer.

Common slip: making a vertex permanent too early, or failing to update a working value when a shorter route appears (the B = 4 → 3 correction above). System beats speed here.

Minimum spanning trees — Kruskal and Prim

A spanning tree connects all vertices with no cycles, using (vertices − 1) edges. The minimum spanning tree (MST) is the cheapest such connector — the problem of linking villages to a water main or fibre network at least cost.

Kruskal's algorithm: list edges by weight, cheapest first; add each edge unless it forms a cycle; stop when you have (n − 1) edges. Worked example: connect A, B, C, D, E with edges: C–D 2, B–C 3, A–B 4, D–E 4, A–C 5, B–D 6, C–E 7. Sort: 2, 3, 4, 4, 5, 6, 7. Take C–D (2). Take B–C (3). Take A–B (4). Take D–E (4) — no cycle. That's 4 edges for 5 vertices — done. MST weight = 2 + 3 + 4 + 4 = 13. (A–C at 5 would have formed a cycle A–B–C; skip.)

Prim's algorithm grows the tree from one vertex: repeatedly add the cheapest edge from the tree to a vertex outside it. Both give the same minimum weight. Exam questions may dictate the algorithm and the starting vertex; follow instructions exactly, and list the edges in the order added when asked.

Worked example (real framing): a council connects 5 rural broadband cabinets. The MST weight is the minimum cable cost; any spanning network costing more contains a removable cycle. 'Why a tree?' — because cycles waste cable while connecting nothing new.

Critical paths and scheduling — a taste of project planning

Networks also model time. A project is a set of activities with durations and dependencies (you cannot ice a cake before baking it). The critical path is the longest chain of dependent activities — it sets the shortest possible project time, and any delay on it delays everything. Worked example: to launch a school fete stall: A (book hall, 1 week) → B (design posters, 2 weeks) → D (print and display, 1 week); also A → C (order stock, 3 weeks) → D. Paths: A–B–D = 1 + 2 + 1 = 4 weeks; A–C–D = 1 + 3 + 1 = 5 weeks. The critical path is A–C–D (5 weeks): ordering stock is the task that cannot slip, while poster design has a week of float (spare time). Managers live by this analysis — it tells you where delays matter and where they don't.

Decision maths in the wild

The same algorithms scale: the travelling-salesman question (shortest tour visiting every town) has no fast exact method — for just 20 towns there are more possible tours than seconds since the Big Bang — so logistics firms use heuristics (nearest-neighbour, for instance: always drive to the closest unvisited town) that give good tours quickly. Bin-packing heuristics (first-fit decreasing) load delivery vans. Your GCSE algorithms — Dijkstra, Kruskal, Prim — are the exact, guaranteed versions for the problems that do admit them; recognising which family a problem belongs to is professional judgement.

Worked example — Prim's algorithm on the same network

Using the broadband network from the Kruskal example (edges C–D 2, B–C 3, A–B 4, D–E 4, A–C 5, B–D 6, C–E 7), grow Prim's tree from A: from A, the cheapest edge out is A–B (4). From {A, B}, the cheapest edge to a new vertex is B–C (3). From {A, B, C}, the cheapest out is C–D (2). From {A, B, C, D}, the cheapest out is D–E (4). Total = 4 + 3 + 2 + 4 = 13 — the same 13 as Kruskal, as it must be: the minimum spanning tree's weight is unique even when the edge order (or occasionally the tree) differs. Two algorithms agreeing is the built-in verification.

Common mistakes

  • Counting degrees wrong. A loop adds 2 to a vertex's degree; parallel edges each count.
  • Declaring traversable with 4 odd vertices. Eulerian needs 0 odd; a single open trail needs exactly 2.
  • Dijkstra greedily following the cheapest first edge instead of maintaining working values — the shortest route to F above avoids the direct 12 label via D–F.
  • Kruskal adding a cycle-forming edge because it was cheap. The cycle check is the algorithm, not an optional step.
  • Stopping criteria: MST for n vertices has exactly n − 1 edges; traversability counts are about degrees, not edges.
  • Untraceable route claims. After Dijkstra, verify by summing your claimed route's edges — 10 seconds, one mark saved.

Exam Experience

Question 1. A graph has vertices with degrees 3, 2, 4, 3, 2. State, with a reason, whether the graph has an Eulerian trail that uses every edge exactly once and returns to its starting point. [2 marks]

Question 2. The network shows distances between towns: A–B 3, A–C 7, B–C 2, B–D 8, C–D 4, D–E 4, B–E 11. Use Dijkstra's algorithm to find the shortest distance from A to E, and state the route. [3 marks]

Question 3. For the network in Question 2, use Kruskal's algorithm to find the weight of the minimum spanning tree. [3 marks]

Mark scheme.

  • Q1: B1 for 'No'. B1 for the reason: two vertices have odd degree (the two 3s), so only an open trail between those vertices exists; an Eulerian circuit needs all degrees even.
  • Q2: M1 for correct working values showing the updates (from A: B = 3, C = 7; C improves to 3 + 2 = 5 via B; D = 5 + 4 = 9 via C, beating 3 + 8 = 11 via B; E = 9 + 4 = 13 via D). M1 for making vertices permanent in the order A, B, C, D, E. A1 for shortest distance 13 via A–B–C–D–E.
  • Q3: M1 for adding edges in ascending order skipping cycles: A–B (3), B–C (2), C–D (4), D–E (4). M1 for rejecting B–D (8) and A–C (7) as cycle-forming/not needed once connected. A1 for MST weight 2 + 3 + 4 + 4 = 13.
Key idea. Algorithms are recipes: write the working values, respect the stopping rules, and verify the final route by adding its edges.
Try it. A network of 6 villages must be linked by fibre cable. Explain why the cheapest solution has exactly 5 cable sections, and what goes wrong if a 6th section is added. Then run Dijkstra mentally on: X–Y 5, X–Z 3, Z–Y 1, Y–W 4, Z–W 6 — shortest X to W? (X–Z–Y–W = 8.)

📈 Interactive Graph: Function Explorer — Decision Maths

Explore how functions behave — a core skill for Decision Maths.

🎛️ Interactive Explorer: Quadratic Explorer — Decision Maths

Drag the sliders to change the coefficients of y = ax² + bx + c and watch the parabola transform live.

1 0 0

Notice how a controls the width and direction, b shifts the axis of symmetry, and c moves the graph up and down.

Key Terms

Graph
Vertices joined by edges — the model for networks, routes, and relationships.
Vertex / edge
A node / a connection between nodes; edges may be weighted.
Degree
The number of edges meeting at a vertex; Eulerian trails need 0 or 2 odd vertices.
Dijkstra's algorithm
The greedy shortest-path algorithm: permanent/tentative labelling from the start.
Spanning tree
A cycle-free subgraph connecting all vertices; minimum weight = cheapest network.
Kruskal's algorithm
Build the MST by adding shortest edges that avoid cycles.
Prim's algorithm
Build the MST by growing from a start vertex via the shortest connecting edge.
Chinese postman problem
Shortest closed route traversing every edge; duplicate the shortest odd-pairing path.
Critical path
The longest task path determining minimum project duration.
Float
Slack time on non-critical tasks — scheduling freedom.

Discussion Questions

  1. For the warehouse network in this lesson (A-B 4, A-C 7, B-C 2, B-D 5, C-D 6, C-E 3, D-E 8): (a) use Dijkstra from A to find the shortest distance to E; (b) use Kruskal to find the minimum spanning tree and its weight.
  2. A school caretaker must check every corridor (edges, lengths in m): a triangle ABC (AB 30, BC 40, CA 50) plus a spur from B to D (25 m). Starting and ending at A, find the shortest inspection route. (Hint: which vertices are odd?)
  3. Tasks: P (4 days), Q (3, after P), R (5, after P), S (2, after Q,R), T (6, after R). Draw the activity network, find the critical path and minimum duration, and compute Q's float.
  4. Explain why Dijkstra's algorithm is 'greedy but correct': what choice does it make at each step, and why can it never need to revise a permanent label? (Give the intuition, not a formal proof.)
  5. A delivery firm in Bristol serves 6 shops. Model the problem of (a) visiting each shop once and returning (travelling salesman) vs. (b) the postman traversing every road. Which is harder computationally, and why? (Research: P vs NP.)
Keep reading to complete this lesson

🎬 Watch & Learn

Free video lessons on “Decision Maths — Networks (Intro)” — pick a result below: