Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Solution: Kruskal’s algorithm: Yorkshire

Explore technology-assisted decision-making. Learn to optimize outcomes with advanced algorithms and techniques in different industries.

How did you do?

In the previous exercise, you were asked to a) work out where the towns were located on the map and b) apply Kruskal’s algorithm to find a solution to GigaFibre’s planning task to connect the cities in Yorkshire to their network.

Here’s the solution to b). First, we order the edges by their distance. The table below has the edges order in ascending order by their distance. Did you get this bit right?

First city Second city Distance km
Whitby Scarborough 9
Wakefield Leeds 13
Wakefield Huddersfield 19
Leeds Harrogate 21
Leeds Huddersfield 23
Wakefield Doncaster 30
Leeds Doncaster 41
Huddersfield Doncaster 45
Scarborough Hull 59
Whitby Harrogate 71
Scarborough Harrogate 80
Leeds Hull 80
Hull Harrogate 83
Scarborough Leeds 91

You should next have worked your way down the list considering which edges to include in the design. If an edge introduces a cycle into the solution we remove it from the solution, ignore it, and then move on to the next edge.

The image below shows the edges used after applying Kruskal’s algorithm. So an optimum plan for GigaFibre’s network in the Yorkshire region includes connections between Huddersfield and Wakefield, Wakefield and Doncaster, Wakefield and Leeds, Leeds and Harrogate, Harrogate and Whitby, Whitby and Scarborough, and Scarborough and Hull. The sum of the connections included in the plan is 229 km.

Did you get it right?

A full text description of the image is available below:

Connecting Yorkshire solution – image full text description (PDF)

This article is from the free online

Introduction to Technology-Assisted Decision-Making

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now