Skip to main content
Northern IrelandFurther MathsSyllabus dot point

How do graph and network algorithms solve route, connection and ordering problems?

Graphs and networks, the minimum spanning tree by Kruskal's and Prim's algorithms, the shortest path by Dijkstra's algorithm, and sorting and route-inspection ideas in decision mathematics.

A CCEA A2 Further Maths Discrete answer on graphs and networks, finding a minimum spanning tree by Kruskal's and Prim's algorithms, the shortest path by Dijkstra's algorithm, and the role of sorting and route-inspection algorithms in decision mathematics.

Generated by Claude Opus 4.813 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

CCEA wants you to understand graphs and networks, find a minimum spanning tree with Kruskal's and Prim's algorithms, find the shortest path with Dijkstra's algorithm, and apply the sorting and route-inspection ideas of decision mathematics, carrying out each algorithm step by step.

The answer

Graphs and networks

Minimum spanning tree: Kruskal and Prim

Both give the same minimum total weight; Prim builds one connected piece throughout, while Kruskal may build several fragments that join up.

Shortest path: Dijkstra's algorithm

Sorting and route inspection

Examples in context

Example 1. Laying a fibre network. A telecoms firm connecting towns with the least total cable solves a minimum-spanning-tree problem; Kruskal's or Prim's algorithm gives the cheapest network that still reaches every town. The MST is the literal answer to "connect everything for the least money".

Example 2. Satnav routing. A satellite navigation system finds the quickest route by running a Dijkstra-style shortest-path search over the road network, with edge weights set by distance or expected travel time. The permanent-label idea is how it settles each junction's best time.

Try this

Q1. What is a spanning tree of a network? [1 mark]

  • Cue. A set of edges connecting all the vertices with no cycle.

Q2. Which algorithm is edge-based and sorts edges by weight? [1 mark]

  • Cue. Kruskal's algorithm.

Q3. In Dijkstra's algorithm, what does the final permanent label of the destination represent? [1 mark]

  • Cue. The length of the shortest path to it from the start.

Exam-style practice questions

Practice questions written in the style of CCEA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

CCEA A2 20206 marksExplain the difference between Kruskal's algorithm and Prim's algorithm for finding a minimum spanning tree, and state how each avoids creating a cycle.
Show worked answer →

Both algorithms find a minimum spanning tree (a set of edges connecting all vertices with the least total weight and no cycle).

Kruskal's algorithm is edge-based: list the edges in order of increasing weight, then add each edge in turn provided it does not create a cycle, stopping when all vertices are connected. It avoids a cycle by rejecting any edge whose two ends are already joined.

Prim's algorithm is vertex-based: start from any vertex and repeatedly add the shortest edge that connects a new vertex to the tree already built, until all vertices are included. It avoids a cycle by only ever adding an edge to a vertex not yet in the tree.

Markers reward the edge-based versus vertex-based distinction, the selection rule for each, and how each prevents a cycle.

CCEA A2 20187 marksA network has vertices A to E. Using Dijkstra's algorithm, outline the steps to find the shortest path from A to E, and explain what the final labels represent.
Show worked answer →

Dijkstra's algorithm finds the shortest path from a start vertex to every other vertex in a network with non-negative weights.

Assign A a permanent label of 00. Give each neighbour a temporary (working) label equal to the edge weight from A. Choose the vertex with the smallest temporary label and make it permanent. From that newly permanent vertex, update the temporary labels of its neighbours if a shorter route via it is found (the new label is the smaller of the current label and the permanent label plus the connecting edge).

Repeat, always making permanent the smallest temporary label, until E is permanent. The final permanent label of E is the length of the shortest path from A; trace the route backwards by following the edges that gave each label its final value.

Markers reward the permanent and temporary labelling, the update rule, the order of making labels permanent, and that the final label is the shortest distance with the route recovered by backtracking.

Related dot points

Sources & how we know this