How do standard algorithms find minimum spanning trees, shortest paths and good routes through a network?
Kruskal's and Prim's algorithms for minimum spanning trees, Dijkstra's algorithm for the shortest path, and the route inspection and travelling salesperson problems.
A focused answer to the AQA A-Level Further Mathematics network algorithms content, covering Kruskal's and Prim's algorithms for minimum spanning trees, Dijkstra's algorithm for the shortest path, and the route inspection and travelling salesperson problems.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to apply Kruskal's and Prim's algorithms to find a minimum spanning tree, use Dijkstra's algorithm to find the shortest path between two vertices, solve the route inspection (Chinese postman) problem, and find upper and lower bounds for the travelling salesperson problem.
Minimum spanning trees
Prim's algorithm reaches the same tree by a different route: it grows a single connected tree outward from a chosen start vertex, at each step adding the cheapest edge that joins a new vertex to the tree so far. Prim's never needs an explicit cycle check, because it only ever reaches out to vertices not yet included, which makes it well suited to the matrix form of the algorithm where you cross out columns as vertices join.
Dijkstra's algorithm
Both algorithms always return a minimum spanning tree, but they suit different question formats. Kruskal's works from a sorted edge list and is natural when the network is given as a list of weighted edges; its only subtlety is the cycle check, usually done by tracking which vertices are already joined into the same component. Prim's works from the network's distance matrix, crossing out the column of each newly added vertex and scanning the rows of the joined vertices for the smallest uncrossed entry, which makes it the method examiners pair with a matrix presentation. When edge weights are all distinct the minimum spanning tree is unique, so both algorithms must produce the same tree, a fact you can use to check your work.
Route inspection and travelling salesperson
Route inspection (the Chinese postman problem) finds the least total distance of a closed route that traverses every edge at least once. If every vertex has even degree the network already has an Eulerian circuit and no edge needs repeating, so the answer is just the sum of all edge weights. Otherwise you list the odd-degree vertices (there is always an even number of them), pair them up in every possible way, find the shortest path between each pair, and choose the pairing whose total is smallest. That smallest total is the extra distance added to the sum of all edges, because those paths are the edges you walk twice.
The travelling salesperson problem visits every vertex exactly once and returns to the start with least total distance, and unlike route inspection it has no efficient exact algorithm, so the exam asks for bounds instead. The nearest-neighbour algorithm gives an upper bound: start at a vertex, repeatedly go to the nearest unvisited vertex, then return to the start. A lower bound comes from deleting one vertex, finding a minimum spanning tree of the remaining network, and adding back the two shortest edges from the deleted vertex. The true optimum lies between the best lower bound and the best upper bound, and a question is effectively solved when the two bounds coincide.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20196 marksA network has vertices A, B, C, D, E with edges AB(5), AC(3), BC(4), BD(6), CD(7), CE(8), DE(2). Use Kruskal's algorithm to find a minimum spanning tree, listing the edges in the order chosen, and state its total weight.Show worked answer →
Kruskal's algorithm: sort the edges by weight, then add the cheapest unused edge that does not create a cycle, until edges are chosen.
Sorted edges: DE(2), AC(3), BC(4), AB(5), BD(6), CD(7), CE(8).
Add DE(2): accepted. Add AC(3): accepted. Add BC(4): accepted (connects B to the A-C component). Add AB(5): rejected, it would form a cycle A-B-C-A. Add BD(6): accepted, connecting D to the rest. Now edges are chosen, so stop.
Minimum spanning tree edges in order: DE, AC, BC, BD. Total weight .
Markers reward sorting by weight, the cycle rejection of AB, choosing exactly edges, and the total weight .
AQA 20217 marksApply Dijkstra's algorithm to find the shortest distance from A to E in a network with edges AB(4), AC(2), BC(1), BD(5), CD(8), CE(10), DE(2). Show the order in which vertices receive permanent labels.Show worked answer →
Assign A the permanent label . Update neighbours: B gets working value , C gets .
Smallest working value is C at : make C permanent (order 2). Update from C: B via C is (better than , so B becomes ); D via C is ; E via C is .
Smallest working value is B at : make B permanent (order 3). Update from B: D via B is (better than , so D becomes ).
Smallest working value is D at : make D permanent (order 4). Update from D: E via D is (better than , so E becomes ).
Make E permanent (order 5) at . The shortest distance from A to E is , via the route A, C, B, D, E.
Markers reward correct permanent-labelling order (A, C, B, D, E), the working-value updates, and the final shortest distance with its route.
Related dot points
- Graph terminology including vertices, edges, degree, paths and cycles, special graphs such as trees and complete graphs, the adjacency matrix representation, and Eulerian and Hamiltonian graphs.
A focused answer to the AQA A-Level Further Mathematics graphs and networks content, covering graph terminology such as vertices, edges, degree, paths and cycles, special graphs such as trees and complete graphs, the adjacency matrix representation, and Eulerian and Hamiltonian graphs.
- Activity networks, forward and backward passes to find earliest and latest times, the critical path, float, and resource scheduling with Gantt charts.
A focused answer to the AQA A-Level Further Mathematics critical path analysis content, covering activity networks, forward and backward passes to find earliest and latest times, the critical path, float, and resource scheduling with Gantt charts.
- Formulating linear programming problems, the feasible region and graphical solution, the vertex (objective line) method, slack variables, and the simplex algorithm for maximisation.
A focused answer to the AQA A-Level Further Mathematics linear programming content, covering formulating problems, the feasible region and graphical solution, the vertex and objective line methods, slack variables, and the simplex algorithm for maximisation.
- Two-player zero-sum games, the pay-off matrix, play-safe strategies, saddle points and stable solutions, dominance to reduce a game, and mixed strategies including conversion to linear programming.
A focused answer to the AQA A-Level Further Mathematics game theory content, covering two-player zero-sum games, the pay-off matrix, play-safe strategies, saddle points and stable solutions, dominance to reduce a game, and mixed strategies including conversion to a linear programming problem.
Sources & how we know this
- AQA A-level Further Mathematics (7367) specification — AQA (2017)