Skip to main content
ExamExplained
WA · Mathematics Applications
Mathematics Applications study scene
§-Syllabus dot point
WAMathematics ApplicationsSyllabus dot point

How do we connect every site in a network at the least total cost?

Solve connector problems by finding a minimum spanning tree using Prim's algorithm and interpret its total weight.

How to solve a connector problem by finding a minimum spanning tree with Prim's algorithm, confirm it has n minus 1 edges, and interpret its total weight as the least connection cost.

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. Connector problems
  3. Prim's algorithm
  4. Kruskal's algorithm as an alternative
  5. Interpreting the result

What this dot point is asking

You must solve connector problems with Prim's algorithm, confirm the tree has n1n - 1 edges, and interpret the total weight.

Connector problems

A connector problem asks for the least-cost set of links that connects every vertex. The solution is a spanning tree: it spans (reaches) every vertex, and it is a tree (connected, no cycles). The minimum spanning tree has the smallest possible total weight.

Prim's algorithm

Prim's algorithm grows the tree outward from a starting vertex.

The key restriction is that each added edge must reach a new vertex; an edge joining two vertices already in the tree would form a cycle and is never added. (Kruskal's algorithm, which adds the globally cheapest cycle-free edge regardless of connection, gives the same minimum spanning tree.)

Kruskal's algorithm as an alternative

Kruskal's algorithm builds the same minimum spanning tree but works globally rather than growing from one vertex. List all edges in order of increasing weight, then add the cheapest edge that does not form a cycle, regardless of where it is in the network, until n1n - 1 edges have been added. It is often quicker to apply on paper because you sort the edges once and work down the list, skipping any edge that would close a loop. Either algorithm gives the same minimum total weight; choose whichever is faster for the given network.

Interpreting the result

The total weight of the minimum spanning tree is the minimum total cost (length, dollars, cable) to connect every site. It is not the shortest route between two points; a connector problem is about linking everything, not travelling between two named vertices. Read the wording carefully: "connect all", "link every", "least cabling" signal a spanning tree.

In context, the tree's edges are the links that should actually be built, and its total weight is the figure you report (for example, "the cheapest network connecting all six towns uses these five roads and costs $30000\$30\,000"). If a question asks whether a particular link is in the minimum spanning tree, run the algorithm and check; a link can be the cheapest single edge yet still be excluded if adding it would create a cycle with cheaper alternatives.

Exam-style practice questions

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

WACE 20227 marksSix towns are to be joined by fibre cable. The possible links (cost in \thousands)arethousands) are AB=7,, AC=5,, BC=8,, BD=9,, CD=7,, CE=5,, DE=15,, DF=6,, EF=8.(a)UsePrimsalgorithmstartingat. (a) Use Prim's algorithm starting at A$ to find the minimum spanning tree. (b) State its total cost and the number of edges.
Show worked answer →

Prim's adds the cheapest edge that reaches a new vertex.

Start at AA. Cheapest from AA: AC=5AC = 5, add CC. Cheapest from {A,C}\{A,C\}: CE=5CE = 5, add EE. Cheapest reaching a new vertex from {A,C,E}\{A,C,E\}: AB=7AB = 7 (or CD=7CD = 7); take AB=7AB = 7, add BB. Cheapest reaching new: CD=7CD = 7, add DD. Cheapest reaching FF: DF=6DF = 6, add FF. (5 marks)

Edges: ACAC, CECE, ABAB, CDCD, DFDF, that is 55 edges for 66 towns (n1=5n-1 = 5). Total cost =5+5+7+7+6=30= 5 + 5 + 7 + 7 + 6 = 30, that is $30000\$30\,000. (2 marks)

Markers reward growing from AA by cheapest new-vertex edges, exactly 55 edges, and total $30000\$30\,000.

WACE 20244 marksExplain the difference between a minimum spanning tree and a shortest path, and state how many edges a minimum spanning tree of nn vertices contains.
Show worked answer →

One connects everything; the other links two points.

A minimum spanning tree connects all vertices together at the least total weight with no cycles; it is about the whole network. A shortest path is the route of least total weight between two specific vertices only. (2 marks)

A minimum spanning tree of nn vertices has exactly n1n - 1 edges. (2 marks)

Markers reward the connect-everything versus single-journey distinction and the n1n - 1 edge count.

ExamExplained